Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
renderAccountStatus() {
// console.log( 'STATUS: ', this.props.acct.model.status )
if (true) {
toast('This dApp is not connected to a Content Node. To launch your own Content Node, please visit menlo.one for more info.', {
className: 'toast-red-bk',
type: toast.TYPE.ERROR,
toastId: ToastType.Account,
autoClose: false
})
return (
<ul>
<li>
<span>Not connected to Content Node. <a title="Launch a Content Node" href="https://www.menlo.one/docs/">Launch a Content Node</a></span>
</li>
</ul>
)
}
if (this.props.acct.model.status === MetamaskStatus.LoggedOut) {
toast('You must first sign into Metamask to take part in discussions.', {
toastId: ToastType.Account,
.catch(function(error) {
console.log('error retrieving or setting crime pins');
console.log(error);
_this.setState({
loading: false
});
toast(
<p>
We're sorry, but the application could not process your request. Please try again later.
</p>,
{
type: toast.TYPE.INFO
}
);
});
}
static success(message: string, requireDismissal: boolean = false) {
Notifiable.showNotification(message, toast.TYPE.SUCCESS, requireDismissal);
}
export function dismiss(toastId: number) {
toast.dismiss(toastId);
}
export const container = (
);
export const INFO = toast.TYPE.INFO;
export const SUCCESS = toast.TYPE.SUCCESS;
export const WARNING = toast.TYPE.WARNING;
export const ERROR = toast.TYPE.ERROR;
notify = () => this.orderToast = toast("Placing Order", { type: toast.TYPE.INFO, autoClose: false});
toastSuccess = () => toast.update(this.orderToast, { type: toast.TYPE.SUCCESS,autoClose: 3000, render: <div><h4>Order Succesfully Placed</h4><h5>Redirecting to homepage</h5></div>, onClose: () => this.props.history.push('/home') });
const propTypes = {
icon: PropTypes.string,
message: PropTypes.node.isRequired,
type: PropTypes.oneOf(Object.values(toast.TYPE)).isRequired,
};
const defaultProps = {
icon: null,
};
const defaultIcons = {
[toast.TYPE.INFO]: 'help',
[toast.TYPE.SUCCESS]: 'checkmark',
[toast.TYPE.WARNING]: 'warning',
[toast.TYPE.ERROR]: 'close',
[toast.TYPE.DEFAULT]: 'about',
};
const Toast = ({
icon,
type,
message,
content,
small,
}) => (
<div role="alert">
<div>
<div></div></div></div>
retryNotification = (id) => toast.update(id, {...this.state.options, render: 'Alien planet destroyed!', type: toast.TYPE.SUCCESS });
_showAlert = (data) => {
let type = toast.TYPE.SUCCESS
if (data.msg) {
if (data.status !== 'OK') {
type = toast.TYPE.ERROR;
}
this.toastId = toast(
data.msg, {
autoClose: 4000,
type: type,
});
}
}
.catch(function(error) {
toast(
<p>Main Neighborhood map could not load. Please try again later,
or try the neighborhood search.</p>, {
type: toast.TYPE.INFO,
});
});
}