Use JSX for toaster message

pull/2463/head
David Disu 3 years ago committed by yann300
parent 6fd39fde70
commit cb5f5e0064
  1. 4
      apps/remix-ide/src/app/files/fileManager.ts
  2. 6
      libs/remix-ui/helper/src/lib/helper-components.tsx
  3. 2
      libs/remix-ui/toaster/src/lib/toaster.tsx

@ -4,7 +4,7 @@ import * as packageJson from '../../../../../package.json'
import Registry from '../state/registry' import Registry from '../state/registry'
import { EventEmitter } from 'events' import { EventEmitter } from 'events'
import { RemixAppManager } from '../../../../../libs/remix-ui/plugin-manager/src/types' import { RemixAppManager } from '../../../../../libs/remix-ui/plugin-manager/src/types'
import { fileChangedToastMsg, storageFullMessage } from '@remix-ui/helper' import { fileChangedToastMsg, recursivePasteToastMsg, storageFullMessage } from '@remix-ui/helper'
import helper from '../../lib/helper.js' import helper from '../../lib/helper.js'
/* /*
@ -275,7 +275,7 @@ class FileManager extends Plugin {
const provider = this.fileProviderOf(src) const provider = this.fileProviderOf(src)
if (provider.isSubDirectory(src, dest)) { if (provider.isSubDirectory(src, dest)) {
this.call('notification', 'toast', 'File(s) to paste is an ancestor of the destination folder') this.call('notification', 'toast', recursivePasteToastMsg())
} else { } else {
await this.inDepthCopy(src, dest) await this.inDepthCopy(src, dest)
} }

@ -78,3 +78,9 @@ export const storageFullMessage = () => (
</span> </span>
</div> </div>
) )
export const recursivePasteToastMsg = () => (
<div>
File(s) to paste is an ancestor of the destination folder
</div>
)

@ -49,7 +49,7 @@ export const Toaster = (props: ToasterProps) => {
} }
}) })
} }
}, [props.message, state.message]) }, [props.message])
useEffect(() => { useEffect(() => {
if (state.hiding) { if (state.hiding) {

Loading…
Cancel
Save