Skip to content

Commit 36dd5f0

Browse files
authored
update icons package (codesandbox#2647)
1 parent d15f9e7 commit 36dd5f0

File tree

8 files changed

+270
-11
lines changed

8 files changed

+270
-11
lines changed

packages/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"@cerebral/http": "^4.0.0",
7171
"@cerebral/mobx-state-tree": "^3.0.0",
7272
"@codesandbox/executors": "^0.1.0",
73-
"@codesandbox/template-icons": "^0.7.1",
73+
"@codesandbox/template-icons": "^1.0.1",
7474
"@emmetio/codemirror-plugin": "^0.3.5",
7575
"@sentry/webpack-plugin": "^1.8.0",
7676
"@svgr/core": "^2.4.1",

packages/app/src/app/pages/Sandbox/Editor/Workspace/Project/SandboxConfig/Icon/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as templates from '@codesandbox/common/lib/templates';
22
import getIcon from '@codesandbox/common/lib/templates/icons';
3-
import * as Icons from '@codesandbox/template-icons';
3+
import { ColorIcons as Icons } from '@codesandbox/template-icons';
44
import React, { FunctionComponent, useState } from 'react';
55
import { usePopoverState } from 'reakit/Popover';
66

packages/common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"@babel/plugin-transform-flow-strip-types": "^7.0.0",
4343
"@babel/polyfill": "^7.4.4",
4444
"@codesandbox/notifications": "^1.0.6",
45-
"@codesandbox/template-icons": "^0.7.1",
45+
"@codesandbox/template-icons": "^1.0.1",
4646
"@sentry/browser": "^5.6.2",
4747
"@tippy.js/react": "^2.1.1",
4848
"babel-plugin-preval": "^3.0.1",

packages/common/src/components/Template/UserTemplate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import * as Icons from '@codesandbox/template-icons';
2+
import { ColorIcons as Icons } from '@codesandbox/template-icons';
33
import color from 'color';
44
import { Template } from '../../types/index';
55
import getIcon from '../../templates/icons';
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
import {
2+
AdonisIconDark,
3+
AngularIconDark,
4+
ApolloIconDark,
5+
ReactIconDark,
6+
ReasonIconDark,
7+
EmberIconDark,
8+
PreactIconDark,
9+
VueIconDark,
10+
SvelteIconDark,
11+
DojoIconDark,
12+
CxJSIconDark,
13+
GatsbyIconDark,
14+
MarkoIconDark,
15+
NextIconDark,
16+
NuxtIconDark,
17+
NodeIconDark,
18+
NestIconDark,
19+
HTML5IconDark,
20+
StyleguidistIconDark,
21+
MDXDeckIconDark,
22+
GridsomeIconDark,
23+
QuasarIconDark,
24+
SapperIconDark,
25+
ParcelIconDark,
26+
VuePressIconDark,
27+
UnibitIconDark,
28+
} from '@codesandbox/template-icons';
29+
30+
import {
31+
adonis,
32+
react,
33+
ember,
34+
vue,
35+
preact,
36+
reactTs,
37+
svelte,
38+
angular,
39+
parcel,
40+
dojo,
41+
cxjs,
42+
reason,
43+
gatsby,
44+
marko,
45+
next,
46+
nuxt,
47+
node,
48+
apollo,
49+
nest,
50+
sapper,
51+
staticTemplate,
52+
styleguidist,
53+
gridsome,
54+
vuepress,
55+
mdxDeck,
56+
quasar,
57+
unibit,
58+
TemplateType,
59+
} from '.';
60+
61+
export type ReturnedIcon = React.SFC<{
62+
width?: number;
63+
height?: number;
64+
className?: string;
65+
style?: React.CSSProperties;
66+
}>;
67+
68+
export default function getIcon(theme: TemplateType): ReturnedIcon {
69+
switch (theme) {
70+
case adonis.name:
71+
return AdonisIconDark;
72+
case react.name:
73+
return ReactIconDark;
74+
case vue.name:
75+
return VueIconDark;
76+
case preact.name:
77+
return PreactIconDark;
78+
case reactTs.name:
79+
return ReactIconDark;
80+
case svelte.name:
81+
return SvelteIconDark;
82+
case angular.name:
83+
return AngularIconDark;
84+
case parcel.name:
85+
return ParcelIconDark;
86+
case dojo.name:
87+
return DojoIconDark;
88+
case ember.name:
89+
return EmberIconDark;
90+
case sapper.name:
91+
return SapperIconDark;
92+
case cxjs.name:
93+
return CxJSIconDark;
94+
case reason.name:
95+
return ReasonIconDark;
96+
case gatsby.name:
97+
return GatsbyIconDark;
98+
case marko.name:
99+
return MarkoIconDark;
100+
case next.name:
101+
return NextIconDark;
102+
case nuxt.name:
103+
return NuxtIconDark;
104+
case node.name:
105+
return NodeIconDark;
106+
case apollo.name:
107+
return ApolloIconDark;
108+
case nest.name:
109+
return NestIconDark;
110+
case staticTemplate.name:
111+
return HTML5IconDark;
112+
case styleguidist.name:
113+
return StyleguidistIconDark;
114+
case gridsome.name:
115+
return GridsomeIconDark;
116+
case vuepress.name:
117+
return VuePressIconDark;
118+
case mdxDeck.name:
119+
return MDXDeckIconDark;
120+
case quasar.name:
121+
return QuasarIconDark;
122+
case unibit.name:
123+
return UnibitIconDark;
124+
default:
125+
return ReactIconDark;
126+
}
127+
}
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
import {
2+
AdonisIconLight,
3+
AngularIconLight,
4+
ApolloIconLight,
5+
ReactIconLight,
6+
ReasonIconLight,
7+
EmberIconLight,
8+
PreactIconLight,
9+
VueIconLight,
10+
SvelteIconLight,
11+
DojoIconLight,
12+
CxJSIconLight,
13+
GatsbyIconLight,
14+
MarkoIconLight,
15+
NextIconLight,
16+
NuxtIconLight,
17+
NodeIconLight,
18+
NestIconLight,
19+
HTML5IconLight,
20+
StyleguidistIconLight,
21+
MDXDeckIconLight,
22+
GridsomeIconLight,
23+
QuasarIconLight,
24+
SapperIconLight,
25+
ParcelIconLight,
26+
VuePressIconLight,
27+
UnibitIconLight,
28+
} from '@codesandbox/template-icons';
29+
30+
import {
31+
adonis,
32+
react,
33+
ember,
34+
vue,
35+
preact,
36+
reactTs,
37+
svelte,
38+
angular,
39+
parcel,
40+
dojo,
41+
cxjs,
42+
reason,
43+
gatsby,
44+
marko,
45+
next,
46+
nuxt,
47+
node,
48+
apollo,
49+
nest,
50+
sapper,
51+
staticTemplate,
52+
styleguidist,
53+
gridsome,
54+
vuepress,
55+
mdxDeck,
56+
quasar,
57+
unibit,
58+
TemplateType,
59+
} from '.';
60+
61+
export type ReturnedIcon = React.SFC<{
62+
width?: number;
63+
height?: number;
64+
className?: string;
65+
style?: React.CSSProperties;
66+
}>;
67+
68+
export default function getIcon(theme: TemplateType): ReturnedIcon {
69+
switch (theme) {
70+
case adonis.name:
71+
return AdonisIconLight;
72+
case react.name:
73+
return ReactIconLight;
74+
case vue.name:
75+
return VueIconLight;
76+
case preact.name:
77+
return PreactIconLight;
78+
case reactTs.name:
79+
return ReactIconLight;
80+
case svelte.name:
81+
return SvelteIconLight;
82+
case angular.name:
83+
return AngularIconLight;
84+
case parcel.name:
85+
return ParcelIconLight;
86+
case dojo.name:
87+
return DojoIconLight;
88+
case ember.name:
89+
return EmberIconLight;
90+
case sapper.name:
91+
return SapperIconLight;
92+
case cxjs.name:
93+
return CxJSIconLight;
94+
case reason.name:
95+
return ReasonIconLight;
96+
case gatsby.name:
97+
return GatsbyIconLight;
98+
case marko.name:
99+
return MarkoIconLight;
100+
case next.name:
101+
return NextIconLight;
102+
case nuxt.name:
103+
return NuxtIconLight;
104+
case node.name:
105+
return NodeIconLight;
106+
case apollo.name:
107+
return ApolloIconLight;
108+
case nest.name:
109+
return NestIconLight;
110+
case staticTemplate.name:
111+
return HTML5IconLight;
112+
case styleguidist.name:
113+
return StyleguidistIconLight;
114+
case gridsome.name:
115+
return GridsomeIconLight;
116+
case vuepress.name:
117+
return VuePressIconLight;
118+
case mdxDeck.name:
119+
return MDXDeckIconLight;
120+
case quasar.name:
121+
return QuasarIconLight;
122+
case unibit.name:
123+
return UnibitIconLight;
124+
default:
125+
return ReactIconLight;
126+
}
127+
}

standalone-packages/vscode-textmate/package-lock.json

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,10 +1144,10 @@
11441144
exec-sh "^0.3.2"
11451145
minimist "^1.2.0"
11461146

1147-
"@codesandbox/template-icons@^0.7.1":
1148-
version "0.7.1"
1149-
resolved "https://registry.yarnpkg.com/@codesandbox/template-icons/-/template-icons-0.7.1.tgz#18090393b4ff2c614d5fe5b2fdf9f8c6b024de32"
1150-
integrity sha512-EcFDVIyQY7aaahy63Cpt8seK0I34EsL5GcLRd0YktaIVeIoxMC5/GjG6foI5RLg4zw9XwbTHQaRNM+UG0KlHdQ==
1147+
"@codesandbox/template-icons@^1.0.1", "@codesandbox/template-icons@^1.01":
1148+
version "1.0.1"
1149+
resolved "https://registry.yarnpkg.com/@codesandbox/template-icons/-/template-icons-1.0.1.tgz#c29068ce93d7d1db8dfbf0c82d618ee7192d9fb8"
1150+
integrity sha512-o7Zgw88GoV/xogZ56rwXFohIYoYsB2UiKERC49Y1yuwV6SFAshPLdUBx9GX6HAHLUQg5R0pOoRrSeEsan+dHEw==
11511151

11521152
"@csstools/convert-colors@^1.4.0":
11531153
version "1.4.0"

0 commit comments

Comments
 (0)