1
0
mirror of https://github.com/trezor/trezor-wallet synced 2025-02-22 04:52:03 +00:00
trezor-wallet/src/utils/notification.js
2018-10-26 16:48:12 +02:00

54 lines
1.1 KiB
JavaScript

import colors from 'config/colors';
import icons from 'config/icons';
const getPrimaryColor = (type) => {
let color;
switch (type) {
case 'info':
color = colors.INFO_PRIMARY;
break;
case 'error':
color = colors.ERROR_PRIMARY;
break;
case 'warning':
color = colors.WARNING_PRIMARY;
break;
case 'success':
color = colors.SUCCESS_PRIMARY;
break;
default:
color = null;
}
return color;
};
const getSecondaryColor = (type) => {
let color;
switch (type) {
case 'info':
color = colors.INFO_SECONDARY;
break;
case 'error':
color = colors.ERROR_SECONDARY;
break;
case 'warning':
color = colors.WARNING_SECONDARY;
break;
case 'success':
color = colors.SUCCESS_SECONDARY;
break;
default:
color = null;
}
return color;
};
const getIcon = type => icons[type.toUpperCase()];
export {
getPrimaryColor,
getSecondaryColor,
getIcon,
};