How to use the @codesandbox/notifications.NotificationStatus.SUCCESS 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 / pages / index.tsx View on Github external
render={({ location }) => {
          if (process.env.NODE_ENV === 'production') {
            routeDebugger(
              `Sending '${location.pathname + location.search}' to analytics.`
            );
            if (!DNT) {
              trackPageview();
            }
          }
          return null;
        }}
      />
      
      
        <content>
          </content>
github codesandbox / codesandbox-client / packages / app / src / app / components / CreateNewSandbox / queries.ts View on Github external
.then(() => {
        notificationState.addNotification({
          message: `Successfully created ${selectedSandboxes.length} template${
            selectedSandboxes.length === 1 ? '' : 's'
          }`,
          status: NotificationStatus.SUCCESS,
          actions: {
            primary: [
              {
                label: 'Undo',
                run: () => {
                  track('Template - Removed', {
                    source: 'Undo',
                  });
                  unmakeTemplates(unpackedSelectedSandboxes);
                },
              },
            ],
          },
        });
      }),
  ]);
github codesandbox / codesandbox-client / packages / app / src / app / pages / Dashboard / Content / routes / TeamView / RemoveTeamMember / index.js View on Github external
onCompleted={() => {
            notificationState.addNotification({
              message: isOwnUser
                ? 'Succesfully left the team'
                : 'Succesfully removed from team',
              status: NotificationStatus.SUCCESS,
            });

            history.push(dashboardUrl());
          }}
        >
github codesandbox / codesandbox-client / packages / app / src / app / pages / Dashboard / Content / routes / CreateTeam / index.js View on Github external
}).then(({ data }) => {
                notificationState.addNotification({
                  message: `Succesfully created team '${data.createTeam.name}'`,
                  status: NotificationStatus.SUCCESS,
                });

                history.push(teamOverviewUrl(data.createTeam.id));
              });
            };
github codesandbox / codesandbox-client / packages / common / src / utils / notifications.ts View on Github external
export function convertTypeToStatus(
  type: NotificationType
): NotificationStatus {
  switch (type) {
    case 'notice':
      return NotificationStatus.NOTICE;
    case 'warning':
      return NotificationStatus.WARNING;
    case 'error':
      return NotificationStatus.ERROR;
    case 'success':
      return NotificationStatus.SUCCESS;
    default:
      return NotificationStatus.NOTICE;
  }
}