Skip to content

Commit bb22174

Browse files
committed
Adjust illustration
1 parent 73519fa commit bb22174

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

packages/docs/src/components/graph.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @jsx jsx */
2-
import { jsx, get } from 'theme-ui'
2+
import { jsx, get, useThemeUI } from 'theme-ui'
33
import { useState, useEffect, Fragment } from 'react'
44
import merge from 'deepmerge'
55
import Logo from './logo'
@@ -54,6 +54,10 @@ const initialState = {
5454

5555
const Node = ({ x, y, color = 0, ...props }) => {
5656
const inset = !!(y % 2)
57+
58+
// adjust for logo position
59+
const isLogo = y === 2 && x === 0
60+
5761
return (
5862
<circle
5963
{...props}
@@ -63,7 +67,7 @@ const Node = ({ x, y, color = 0, ...props }) => {
6367
fill="currentcolor"
6468
strokeWidth={1 / 8}
6569
sx={{
66-
color: colors[color] || 'background',
70+
color: isLogo ? 'background' : colors[color] || 'background',
6771
transitionProperty: 'stroke, color',
6872
transitionTimingFunction: 'ease-out',
6973
transitionDuration: '.4s',
@@ -137,6 +141,7 @@ const randomizeColors = state => {
137141
}
138142

139143
export default ({ width = 32, height = 9, scale = 32 }) => {
144+
const { theme } = useThemeUI()
140145
const rows = Array.from({ length: height / 3 }).map((n, y) =>
141146
Array.from({
142147
length: Math.floor(width / 3 + (y % 2 ? 0 : 1)),
@@ -171,6 +176,8 @@ export default ({ width = 32, height = 9, scale = 32 }) => {
171176
)
172177
}
173178

179+
const logoColor = get(theme.colors, `${get(colors, get(state, '2.0') || 1)}`)
180+
174181
return (
175182
<svg
176183
xmlns="http://www.w3.org/2000/svg"
@@ -199,7 +206,7 @@ export default ({ width = 32, height = 9, scale = 32 }) => {
199206
))
200207
)}
201208
<g transform="translate(0 6)">
202-
<Logo size={2} />
209+
<Logo size={2} color={logoColor} />
203210
</g>
204211
</svg>
205212
)

packages/docs/src/components/logo.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const css = {
1515
`,
1616
}
1717

18-
export default ({ size = 256, ...props }) => (
18+
export default ({ size = 256, color = 'inherit', ...props }) => (
1919
<svg
2020
{...props}
2121
xmlns="http://www.w3.org/2000/svg"
@@ -27,7 +27,8 @@ export default ({ size = 256, ...props }) => (
2727
fontSize: 12,
2828
letterSpacing: '0.1em',
2929
fill: 'currentcolor',
30-
color: 'inherit',
30+
color,
31+
pointerEvents: 'none',
3132
}}>
3233
<defs>
3334
<style dangerouslySetInnerHTML={css} type="text/css" />

0 commit comments

Comments
 (0)