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

Commit d24ba67

Browse files
committed
Merge branch 'doraemon' into dev
2 parents 5a668a3 + 73459a7 commit d24ba67

File tree

8 files changed

+74
-38
lines changed

8 files changed

+74
-38
lines changed

components/ThemeSelector/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
AuthorName,
2323
} from './style'
2424

25-
import { makeDebugger, themeKeys, themeDescs, uid } from '../../utils'
25+
import { makeDebugger, themeKeys, themeMeta, uid } from '../../utils'
2626
/* eslint-disable no-unused-vars */
2727
const debug = makeDebugger('c:ThemeSelector:index')
2828
/* eslint-enable no-unused-vars */
@@ -58,7 +58,7 @@ const DetailStyle = ({ curTheme, changeTheme }) => (
5858
{name}
5959
</ThemeTitle>
6060
<ThemeDesc onClick={changeTheme.bind(this, name)}>
61-
{themeDescs[name]}
61+
{themeMeta[name].desc}
6262
</ThemeDesc>
6363
<AuthorInfo>
6464
<AuthorIcon src={`${ICON_CMD}/author.svg`} />

containers/Doraemon/helper/defaultSuggestion.js

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,16 @@
66
login --
77
*/
88
import { ICON_CMD, ICON_BASE } from '../../../config'
9+
import { themeMeta } from '../../../utils'
910

1011
const cmds = {
1112
theme: {
1213
title: 'theme',
13-
desc: 'theme desc..',
14+
desc: 'awesome themes for hackers',
1415
raw: 'theme',
1516
logo: `${ICON_CMD}/themes.svg`,
1617

17-
threads: {
18-
cyan: {
19-
title: 'cyan theme',
20-
desc: `cyan desc`,
21-
raw: `cyan`,
22-
cmd: 'theme',
23-
},
24-
solarized: {
25-
title: 'solarizedDark theme',
26-
desc: `solarizedDark desc`,
27-
raw: `solarized`,
28-
cmd: 'theme',
29-
},
30-
},
18+
threads: { ...themeMeta },
3119
},
3220
user: {
3321
title: 'user',

containers/Doraemon/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ class DoraemonContainer extends React.Component {
3434
// debug('suggestion.raw: ', suggestions.toJSON())
3535

3636
return (
37-
<div>
37+
<React.Fragment>
3838
<PageOverlay visible={visible} onClick={logic.hidePanel} />
3939
<PanelContainer visible={visible}>
4040
<InputEditor value={inputValue} searching={false} prefix={prefix} />
4141
{logic.repoNotFound(doraemon) && <AlertBar>Repo not found</AlertBar>}
4242
<ResultsList suggestions={suggestions} activeRaw={activeRaw} />
4343
</PanelContainer>
44-
</div>
44+
</React.Fragment>
4545
)
4646
}
4747
}

stores/ThemeStore/index.js

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

9-
import { makeDebugger, markStates, themeDict } from '../../utils'
9+
import { makeDebugger, markStates, themeDict, defaultTheme } from '../../utils'
1010

1111
/* eslint-disable no-unused-vars */
1212
const debug = makeDebugger('S:ThemeStore')
1313
/* eslint-enable no-unused-vars */
1414

1515
export const ThemeDefaults = {
16-
curTheme: 'default',
16+
curTheme: defaultTheme,
1717
}
1818

1919
export const ThemeStore = t
2020
.model('ThemeStore', {
21-
curTheme: t.optional(t.enumeration('theme', R.keys(themeDict)), 'default'),
21+
curTheme: t.optional(
22+
t.enumeration('theme', R.keys(themeDict)),
23+
defaultTheme
24+
),
2225
})
2326
.views(self => ({
2427
get root() {

utils/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ export {
8989
*/
9090
export {
9191
theme,
92+
defaultTheme,
93+
themeMeta,
9294
themeDict,
93-
themeDescs,
9495
themeKeys,
9596
themeCoverMap,
9697
themeCoverIndexMap,

utils/themes/Github.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const threadTitle = '#7b7878'
1818

1919
const Github = {
2020
logoText: descText,
21-
cover: primaryColor,
21+
cover: 'white',
2222
coverIndex: '#F9FCFC',
2323
contrastFg: '#eca014',
2424
htmlBg: bannerBg,

utils/themes/index.js

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ import Yellow from './Yellow'
2222
import Green from './Green'
2323
import IronGreen from './IronGreen'
2424

25+
export const defaultTheme = 'cyan'
2526
export const themeDict = {
26-
default: { ...Cyan },
27-
/* cyan: { ...Cyan }, */
27+
cyan: { ...Cyan },
2828
solarized: { ...SolarizedDark },
2929
purple: { ...Purple },
3030
yellow: { ...Yellow },
@@ -36,21 +36,11 @@ export const themeDict = {
3636

3737
export const themeKeys = R.keys(themeDict)
3838

39-
export const themeDescs = {
40-
cyan: 'inspired by the rethinkdb.com admin panel',
41-
default: 'inspired by the rethinkdb.com admin panel',
42-
solarized: 'inspired by Emacs solarized theme',
43-
purple: 'inspired ubuntu OS terminal',
44-
yellow: 'inspired by vimawesome.com',
45-
github: 'inspired by github.com',
46-
blue: 'inspired by myself i think ?',
47-
green: 'inspired by Olive theme from Vivaldi project',
48-
ironGreen: 'inspired by dribbble: shots/2478998-Forum-Concept',
49-
}
50-
5139
export const themeCoverMap = R.map(R.path(['cover']), themeDict)
5240
export const themeCoverIndexMap = R.map(R.path(['coverIndex']), themeDict)
5341

5442
// shorthand for style-components
5543
export const theme = themepath =>
5644
R.path(['theme', ...R.split('.', themepath)]) || 'wheat'
45+
46+
export { default as themeMeta } from './theme_meta'

utils/themes/theme_meta.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// cmd is for doraemon usage
2+
3+
const themeMeta = {
4+
cyan: {
5+
title: 'cyan',
6+
desc: 'inspired by rethinkdb admin proj',
7+
raw: 'cyan',
8+
cmd: 'theme',
9+
},
10+
solarized: {
11+
title: 'solarized',
12+
desc: 'a theme inspired by famous solarized proj',
13+
raw: 'solarized',
14+
cmd: 'theme',
15+
},
16+
purple: {
17+
title: 'purple',
18+
desc: 'a theme like ubuntu OS terminal',
19+
raw: 'purple',
20+
cmd: 'theme',
21+
},
22+
yellow: {
23+
title: 'yellow',
24+
desc: 'inspired by vimawesome.com',
25+
raw: 'yellow',
26+
cmd: 'theme',
27+
},
28+
github: {
29+
title: 'github',
30+
desc: 'github-like theme',
31+
raw: 'github',
32+
cmd: 'theme',
33+
},
34+
blue: {
35+
title: 'blue',
36+
desc: 'inspired by a dribble collection',
37+
raw: 'blue',
38+
cmd: 'theme',
39+
},
40+
green: {
41+
title: 'green',
42+
desc: "inspired by Vivaldi's Olive theme",
43+
raw: 'green',
44+
cmd: 'theme',
45+
},
46+
ironGreen: {
47+
title: 'ironGreen',
48+
desc: 'inspired by dribbble: shots/2478998-Forum-Concept',
49+
raw: 'ironGreen',
50+
cmd: 'theme',
51+
},
52+
}
53+
54+
export default themeMeta

0 commit comments

Comments
 (0)