Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit 8ad34b0

Browse files
committed
refactor(Themes): move defaultTheme to config
1 parent a6c30b4 commit 8ad34b0

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

config/general.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
general behavior of the site
33
*/
44

5+
export const DEFAULT_THEME = 'cyan'
6+
57
export const PAGE_SIZE = {
68
S: 10,
79
D: 20,

config/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export { PAGE_SIZE, WORD_LIMIT, TAG_COLORS } from './general'
1+
export { DEFAULT_THEME, PAGE_SIZE, WORD_LIMIT, TAG_COLORS } from './general'
22
export {
33
GRAPHQL_ENDPOINT,
44
ISSUE_ADDR,

stores/ThemeStore/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,22 @@
66
import { types as t, getParent } from 'mobx-state-tree'
77
import R from 'ramda'
88

9-
import { makeDebugger, markStates, themeSkins, defaultTheme } from '../../utils'
9+
import { DEFAULT_THEME } from '../../config'
10+
import { makeDebugger, markStates, themeSkins } from '../../utils'
1011

1112
/* eslint-disable no-unused-vars */
1213
const debug = makeDebugger('S:ThemeStore')
1314
/* eslint-enable no-unused-vars */
1415

1516
export const ThemeDefaults = {
16-
curTheme: defaultTheme,
17+
curTheme: DEFAULT_THEME,
1718
}
1819

1920
export const ThemeStore = t
2021
.model('ThemeStore', {
2122
curTheme: t.optional(
2223
t.enumeration('theme', R.keys(themeSkins)),
23-
defaultTheme
24+
DEFAULT_THEME
2425
),
2526
})
2627
.views(self => ({

utils/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ export {
8989
*/
9090
export {
9191
theme,
92-
defaultTheme,
9392
themeMeta,
9493
themeSkins,
9594
themeCoverMap,

utils/themes/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import R from 'ramda'
1515
import skinsData from './skins'
1616

17-
export const defaultTheme = 'cyan'
1817
export const themeSkins = { ...skinsData }
1918

2019
// cover color of a theme

0 commit comments

Comments
 (0)