Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions playground/src/components/ToastCode.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
import * as React from 'react';

import { themes } from './constants';
import { themes, typeMap } from './constants';

function getType(type: string) {
switch (type) {
case 'default':
default:
return 'toast';
case 'success':
return 'toast.success';
case 'error':
return 'toast.error';
case 'info':
return 'toast.info';
case 'warning':
return 'toast.warn';
}
return typeMap[type] || typeMap.default
}

export interface ToastCodeProps {
Expand Down
10 changes: 9 additions & 1 deletion playground/src/components/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ export const transitions = {

export const themes = <const>['light', 'dark', 'colored'];

export const typeMap = {
default: 'toast',
success: 'toast.success',
error: 'toast.error',
info: 'toast.info',
warning: 'toast.warn'
};

export const positions = {
TOP_LEFT: 'top-left',
TOP_RIGHT: 'top-right',
Expand All @@ -59,4 +67,4 @@ export const typs = {
WARNING: 'warning',
ERROR: 'error',
DEFAULT: 'default'
};
};