theme.js 519 B

12345678910111213141516171819202122232425262728293031
  1. const THEME_ENUM = {
  2. primary: 'primary',
  3. native: 'native',
  4. };
  5. function themeToRGB(theme) {
  6. const map = {
  7. [THEME_ENUM.primary]: '#006EFF',
  8. [THEME_ENUM.native]: '#07C160',
  9. };
  10. return map[theme];
  11. }
  12. function themeToSeal(theme) {
  13. const map = {
  14. [THEME_ENUM.primary]: 'primary',
  15. [THEME_ENUM.native]: 'success',
  16. };
  17. return map[theme];
  18. }
  19. function getTheme(theme) {
  20. return THEME_ENUM[theme] || THEME_ENUM.primary;
  21. }
  22. module.exports = {
  23. THEME_ENUM,
  24. themeToRGB,
  25. themeToSeal,
  26. getTheme,
  27. };