react-toastify#ToastOptions TypeScript Examples

The following examples show how to use react-toastify#ToastOptions. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: toast.tsx    From Cromwell with MIT License 5 votes vote down vote up
success(text: string, options?: ToastOptions) {
        return toastify.info(<div className={styles.container}>
            <Alert severity="success" className={styles.alert}><p>{String(text)}</p></Alert>
        </div>, {
            className: styles.toast,
            ...(options ?? {}),
        })
    }
Example #2
Source File: toast.tsx    From Cromwell with MIT License 5 votes vote down vote up
warning(text: string, options?: ToastOptions) {
        return toastify.info(<div className={styles.success} >
            <Alert severity="warning" className={styles.alert}><p>{String(text)}</p></Alert>
        </div>, {
            className: styles.toast,
            ...(options ?? {}),
        })
    }
Example #3
Source File: toast.tsx    From Cromwell with MIT License 5 votes vote down vote up
error(text: string, options?: ToastOptions) {
        return toastify.info(<div className={styles.success}>
            <Alert severity="error" className={styles.alert}><p>{String(text)}</p></Alert>
        </div>, {
            className: styles.toast,
            ...(options ?? {}),
        })
    }
Example #4
Source File: toast.tsx    From Cromwell with MIT License 5 votes vote down vote up
info(text: string, options?: ToastOptions) {
        return toastify.info(<div className={styles.success}>
            <Alert severity="info" className={styles.alert}><p>{String(text)}</p></Alert>
        </div>, {
            className: styles.toast,
            ...(options ?? {}),
        })
    }
Example #5
Source File: toast.tsx    From Cromwell with MIT License 5 votes vote down vote up
success(text: string, options?: ToastOptions) {
        toastify.info(<div className={styles.container}>
            <Alert severity="success" className={styles.alert}>{text}</Alert>
        </div>, {
            className: styles.toast,
            ...(options ?? {}),
        })
    }
Example #6
Source File: toast.tsx    From Cromwell with MIT License 5 votes vote down vote up
warning(text: string, options?: ToastOptions) {
        toastify.info(<div className={styles.success} >
            <Alert severity="warning" className={styles.alert}>{text}</Alert>
        </div>, {
            className: styles.toast,
            ...(options ?? {}),
        })
    }
Example #7
Source File: toast.tsx    From Cromwell with MIT License 5 votes vote down vote up
error(text: string, options?: ToastOptions) {
        toastify.info(<div className={styles.success}>
            <Alert severity="error" className={styles.alert}>{text}</Alert>
        </div>, {
            className: styles.toast,
            ...(options ?? {}),
        })
    }
Example #8
Source File: toast.tsx    From Cromwell with MIT License 5 votes vote down vote up
info(text: string, options?: ToastOptions) {
        toastify.info(<div className={styles.success}>
            <Alert severity="info" className={styles.alert}>{text}</Alert>
        </div>, {
            className: styles.toast,
            ...(options ?? {}),
        })
    }
Example #9
Source File: Toast.tsx    From game-store-monorepo-app with MIT License 5 votes vote down vote up
defaultToastOptions: ToastOptions = {
  position: 'bottom-right',
}