Skip to content

Commit 0ffe483

Browse files
authoredJul 3, 2020
import layer icons directly (#25488)
1 parent d0b6a83 commit 0ffe483

File tree

5 files changed

+28
-30
lines changed

5 files changed

+28
-30
lines changed
 

‎www/src/assets/icons/layer-icon.js

-19
This file was deleted.

‎www/src/assets/icons/layer-icons.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export { default as AbstractSymbol } from "./abstract-symbol.svg"
2+
export { default as AtomicSymbol } from "./atomic-symbol.svg"
3+
export { default as GraphqlLogo } from "./graphql-logo.svg"
4+
export { default as ReactLogo } from "./react-logo.svg"
5+
export { default as AppWindow } from "./app-window.svg"

‎www/src/components/layer-model/component-model/index.js

+12-5
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,42 @@ import {
88
ViewLayerContent,
99
AppLayerContent,
1010
} from "./component-content-sections"
11+
import {
12+
AbstractSymbol,
13+
AtomicSymbol,
14+
GraphqlLogo,
15+
ReactLogo,
16+
AppWindow,
17+
} from "../../../assets/icons/layer-icons"
1118

1219
const layers = [
1320
{
1421
title: `Content`,
15-
icon: `AbstractSymbol`,
22+
icon: <AbstractSymbol />,
1623
baseColor: `orange`,
1724
component: ContentLayerContent,
1825
},
1926
{
2027
title: `Build`,
21-
icon: `AtomicSymbol`,
28+
icon: <AtomicSymbol />,
2229
baseColor: `green`,
2330
component: BuildLayerContent,
2431
},
2532
{
2633
title: `Data`,
27-
icon: `GraphqlLogo`,
34+
icon: <GraphqlLogo />,
2835
baseColor: `magenta`,
2936
component: DataLayerContent,
3037
},
3138
{
3239
title: `View`,
33-
icon: `ReactLogo`,
40+
icon: <ReactLogo />,
3441
baseColor: `blue`,
3542
component: ViewLayerContent,
3643
},
3744
{
3845
title: `App`,
39-
icon: `AppWindow`,
46+
icon: <AppWindow />,
4047
baseColor: `yellow`,
4148
component: AppLayerContent,
4249
},

‎www/src/components/layer-model/image-model/index.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,35 @@ import {
77
QueryLayerContent,
88
DisplayLayerContent,
99
} from "./image-content-sections"
10+
import {
11+
AbstractSymbol,
12+
AtomicSymbol,
13+
GraphqlLogo,
14+
ReactLogo,
15+
} from "../../../assets/icons/layer-icons"
1016

1117
const layers = [
1218
{
1319
title: `Install`,
14-
icon: `AbstractSymbol`,
20+
icon: <AbstractSymbol />,
1521
baseColor: `orange`,
1622
component: InstallLayerContent,
1723
},
1824
{
1925
title: `Config`,
20-
icon: `AtomicSymbol`,
26+
icon: <AtomicSymbol />,
2127
baseColor: `green`,
2228
component: ConfigLayerContent,
2329
},
2430
{
2531
title: `Query`,
26-
icon: `GraphqlLogo`,
32+
icon: <GraphqlLogo />,
2733
baseColor: `magenta`,
2834
component: QueryLayerContent,
2935
},
3036
{
3137
title: `Display`,
32-
icon: `ReactLogo`,
38+
icon: <ReactLogo />,
3339
baseColor: `blue`,
3440
component: DisplayLayerContent,
3541
},

‎www/src/components/layer-model/layer-model.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import React, { useState, useEffect, useRef } from "react"
44
import hex2rgba from "hex2rgba"
55

66
import { colors } from "gatsby-design-tokens/dist/theme-gatsbyjs-org"
7-
import LayerIcon from "../../assets/icons/layer-icon"
87

98
const Layer = ({ buttonRef, layer, onClick, selected, index }) => {
109
const { baseColor, title, icon } = layer
@@ -51,7 +50,7 @@ const Layer = ({ buttonRef, layer, onClick, selected, index }) => {
5150
color: selected ? colors[baseColor][70] : colors.grey[50],
5251
}}
5352
>
54-
<LayerIcon name={icon} />
53+
{icon}
5554
</span>
5655
<span>{title}</span>
5756
</span>

0 commit comments

Comments
 (0)
Please sign in to comment.