How to use the @codesandbox/notifications/lib/state.NotificationStatus.WARNING function in @codesandbox/notifications

To help you get started, we’ve selected a few @codesandbox/notifications examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github codesandbox / codesandbox-client / packages / app / src / app / overmind / effects / notificationToast.ts View on Github external
warning(message: string) {
    notificationState.addNotification({
      message,
      status: NotificationStatus.WARNING,
    });
  },
  notice(message: string) {
github codesandbox / codesandbox-client / packages / app / src / app / overmind / effects / vscode / index.ts View on Github external
const getStatus = () => {
      switch (type) {
        case 'error':
          return NotificationStatus.ERROR;
        case 'warning':
          return NotificationStatus.WARNING;
        case 'success':
          return NotificationStatus.SUCCESS;
        default:
          return NotificationStatus.NOTICE;
      }
    };
github codesandbox / codesandbox-client / packages / app / src / app / overmind / namespaces / server / actions.ts View on Github external
server.hasUnrecoverableError = unrecoverable;
      server.error = error;

      if (unrecoverable) {
        effects.notificationToast.add({
          title: `Container Error`,
          message: error,
          status: NotificationStatus.ERROR,
        });
        effects.executor.closeExecutor();
      } else {
        effects.notificationToast.add({
          title: `Container Warning`,
          message: error,
          status: NotificationStatus.WARNING,
        });
      }

      break;
    }
    case 'shell:exit':
      effects.codesandboxApi.exitShell(data);
      break;
    case 'shell:out':
      effects.codesandboxApi.outShell(data);
      break;
  }
};