Skip to content

Commit 4b45970

Browse files
style(overmind-devtools-client): fixed coloring on code example
1 parent 3313603 commit 4b45970

File tree

3 files changed

+25
-8
lines changed

3 files changed

+25
-8
lines changed

packages/node_modules/overmind-devtools-client/src/components/Devtools/index.tsx

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { createElement, FunctionComponent, Fragment } from 'react'
22
import { useOvermind } from '../../overmind'
33
import * as styles from './styles'
44
import * as text from '../../styles/text'
5+
import { colors } from '../../theme'
56
import Input from '../common/Input'
67
import Button from '../common/Button'
78
import Workspace from '../Workspace'
@@ -62,13 +63,29 @@ const Devtools: FunctionComponent = () => {
6263
)
6364
}
6465

65-
let code = `const overmind = createOvermind(config, {
66-
devtools: "localhost:${state.port}",
67-
})`
6866
return state.isConnecting ? (
6967
<div className={styles.wrapper}>
7068
<h1>Waiting for an app to connect to {state.port}...</h1>
71-
<pre className={styles.code}>{code}</pre>
69+
<pre className={styles.code}>
70+
<span style={{ color: colors.purple }}>const</span> overmind ={' '}
71+
{state.port === 3031 ? (
72+
<Fragment>
73+
<span style={{ color: colors.green }}>createOvermind</span>(config)
74+
</Fragment>
75+
) : (
76+
<Fragment>
77+
<span style={{ color: colors.green }}>createOvermind</span>(config,{' '}
78+
{'{'}
79+
{`\n`}
80+
{' '}devtools:{' '}
81+
<span style={{ color: colors.yellow }}>
82+
"localhost:{state.port}"
83+
</span>
84+
{`\n`}
85+
{'}'})
86+
</Fragment>
87+
)}
88+
</pre>
7289
</div>
7390
) : (
7491
<Workspace />

packages/node_modules/overmind-devtools-client/src/components/Devtools/styles.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const input = css({
2727
})
2828

2929
export const code = css({
30-
border: '2px dashed var(--colors-white4)',
30+
borderRadius: 3,
3131
padding: '10px',
32-
background: 'var(--colors-black2)'
32+
background: colors.dark,
3333
})

packages/node_modules/overmind-devtools-client/src/overmind/state.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
type State = {
2323
isConnecting: boolean
2424
error: string
25-
port: string
25+
port: number
2626
apps: Apps
2727
currentAppName: string
2828
newPortValue: string
@@ -48,7 +48,7 @@ const state: State = {
4848
error: null,
4949
showApps: false,
5050
currentAppName: null,
51-
port: '3031',
51+
port: 3031,
5252
apps: {},
5353
newPortValue: '',
5454
currentTab: Tab.State,

0 commit comments

Comments
 (0)