Skip to content

Commit 9fed168

Browse files
committed
refactor: optimize icon bundle size, update icons
1 parent 8c0deee commit 9fed168

File tree

3 files changed

+251
-15
lines changed

3 files changed

+251
-15
lines changed

src/assets/icons/index.js

Lines changed: 246 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,252 @@ import { sygnet } from './sygnet'
22
import { logo } from './logo'
33
import { logoNegative } from './logo-negative'
44

5-
export {
5+
import {
6+
cibSkype,
7+
cibFacebook,
8+
cibTwitter,
9+
cibLinkedin,
10+
cibFlickr,
11+
cibTumblr,
12+
cibXing,
13+
cibGithub,
14+
cibStackOverflow,
15+
cibYoutube,
16+
cibDribbble,
17+
cibInstagram,
18+
cibPinterest,
19+
cibVk,
20+
cibYahoo,
21+
cibBehance,
22+
cibReddit,
23+
cibVimeo,
24+
cibCcMastercard,
25+
cibCcVisa,
26+
cibStripe,
27+
cibPaypal,
28+
cibGooglePay,
29+
cibCcAmex
30+
} from '@coreui/icons'
31+
import {
32+
cifUs,
33+
cifBr,
34+
cifIn,
35+
cifFr,
36+
cifEs,
37+
cifPl
38+
} from '@coreui/icons'
39+
import {
40+
cilAlignCenter,
41+
cilAlignLeft,
42+
cilAlignRight,
43+
cilApplicationsSettings,
44+
cilArrowRight,
45+
cilBan,
46+
cilBasket,
47+
cilBell,
48+
cilBold,
49+
cilBookmark,
50+
cilCalculator,
51+
cilCalendar,
52+
cilCloudDownload,
53+
cilChartPie,
54+
cilCheck,
55+
cilChevronBottom,
56+
cilChevronLeft,
57+
cilChevronRight,
58+
cilChevronTop,
59+
cilCircle,
60+
cilCheckCircle,
61+
cilCode,
62+
cilCommentSquare,
63+
cilCreditCard,
64+
cilCursor,
65+
cilCursorMove,
66+
cilDrop,
67+
cilDollar,
68+
cilEnvelopeClosed,
69+
cilEnvelopeLetter,
70+
cilEnvelopeOpen,
71+
cilEuro,
72+
cilGlobeAlt,
73+
cilGrid,
74+
cilFile,
75+
cilFullscreen,
76+
cilFullscreenExit,
77+
cilGraph,
78+
cilHome,
79+
cilInbox,
80+
cilIndentDecrease,
81+
cilIndentIncrease,
82+
cilInputPower,
83+
cilItalic,
84+
cilJustifyCenter,
85+
cilJustifyLeft,
86+
cilLaptop,
87+
cilLayers,
88+
cilLightbulb,
89+
cilList,
90+
cilListNumbered,
91+
cilListRich,
92+
cilLocationPin,
93+
cilLockLocked,
94+
cilMagnifyingGlass,
95+
cilMap,
96+
cilMoon,
97+
cilNotes,
98+
cilOptions,
99+
cilPaperclip,
100+
cilPaperPlane,
101+
cilPencil,
102+
cilPeople,
103+
cilPhone,
104+
cilPrint,
105+
cilPuzzle,
106+
cilSave,
107+
cilSettings,
108+
cilShare,
109+
cilShareAll,
110+
cilShareBoxed,
111+
cilShieldAlt,
112+
cilSpeech,
113+
cilSpeedometer,
114+
cilSpreadsheet,
115+
cilStar,
116+
cilSun,
117+
cilTags,
118+
cilTask,
119+
cilTrash,
120+
cilUnderline,
121+
cilUser,
122+
cilUserFemale,
123+
cilUserFollow,
124+
cilUserUnfollow,
125+
cilXCircle,
126+
cilWarning
127+
} from '@coreui/icons'
128+
129+
export const icons = Object.assign({}, {
6130
sygnet,
7131
logo,
8132
logoNegative
9-
}
133+
}, {
134+
cilAlignCenter,
135+
cilAlignLeft,
136+
cilAlignRight,
137+
cilApplicationsSettings,
138+
cilArrowRight,
139+
cilBan,
140+
cilBasket,
141+
cilBell,
142+
cilBold,
143+
cilBookmark,
144+
cilCalculator,
145+
cilCalendar,
146+
cilCloudDownload,
147+
cilChartPie,
148+
cilCheck,
149+
cilChevronBottom,
150+
cilChevronLeft,
151+
cilChevronRight,
152+
cilChevronTop,
153+
cilCircle,
154+
cilCheckCircle,
155+
cilCode,
156+
cilCommentSquare,
157+
cilCreditCard,
158+
cilCursor,
159+
cilCursorMove,
160+
cilDrop,
161+
cilDollar,
162+
cilEnvelopeClosed,
163+
cilEnvelopeLetter,
164+
cilEnvelopeOpen,
165+
cilEuro,
166+
cilGraph,
167+
cilGlobeAlt,
168+
cilGrid,
169+
cilFile,
170+
cilFullscreen,
171+
cilFullscreenExit,
172+
cilHome,
173+
cilInbox,
174+
cilIndentDecrease,
175+
cilIndentIncrease,
176+
cilInputPower,
177+
cilItalic,
178+
cilJustifyCenter,
179+
cilJustifyLeft,
180+
cilLaptop,
181+
cilLayers,
182+
cilLightbulb,
183+
cilList,
184+
cilListNumbered,
185+
cilListRich,
186+
cilLocationPin,
187+
cilLockLocked,
188+
cilMagnifyingGlass,
189+
cilMap,
190+
cilMoon,
191+
cilNotes,
192+
cilOptions,
193+
cilPaperclip,
194+
cilPaperPlane,
195+
cilPencil,
196+
cilPeople,
197+
cilPhone,
198+
cilPrint,
199+
cilPuzzle,
200+
cilSave,
201+
cilSettings,
202+
cilShare,
203+
cilShareAll,
204+
cilShareBoxed,
205+
cilShieldAlt,
206+
cilSpeech,
207+
cilSpeedometer,
208+
cilSpreadsheet,
209+
cilStar,
210+
cilSun,
211+
cilTags,
212+
cilTask,
213+
cilTrash,
214+
cilUnderline,
215+
cilUser,
216+
cilUserFemale,
217+
cilUserFollow,
218+
cilUserUnfollow,
219+
cilXCircle,
220+
cilWarning
221+
}, {
222+
cifUs,
223+
cifBr,
224+
cifIn,
225+
cifFr,
226+
cifEs,
227+
cifPl
228+
}, {
229+
cibSkype,
230+
cibFacebook,
231+
cibTwitter,
232+
cibLinkedin,
233+
cibFlickr,
234+
cibTumblr,
235+
cibXing,
236+
cibGithub,
237+
cibStackOverflow,
238+
cibYoutube,
239+
cibDribbble,
240+
cibInstagram,
241+
cibPinterest,
242+
cibVk,
243+
cibYahoo,
244+
cibBehance,
245+
cibReddit,
246+
cibVimeo,
247+
cibCcMastercard,
248+
cibCcVisa,
249+
cibStripe,
250+
cibPaypal,
251+
cibGooglePay,
252+
cibCcAmex
253+
})

src/index.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,12 @@ import ReactDOM from 'react-dom';
66
import App from './App';
77
import * as serviceWorker from './serviceWorker';
88

9-
import { freeSet, flagSet, brandSet } from '@coreui/icons';
10-
import { logo, logoNegative, sygnet } from './assets/icons'
9+
import { icons } from './assets/icons'
1110

1211
import { Provider } from 'react-redux'
1312
import store from './store'
1413

15-
React.icons = {
16-
...freeSet,
17-
...flagSet,
18-
...brandSet,
19-
logo,
20-
logoNegative,
21-
sygnet
22-
}
14+
React.icons = icons
2315

2416
ReactDOM.render(
2517
<Provider store={store}>

src/views/dashboard/Dashboard.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ const Dashboard = () => {
360360
<CProgress className="progress-xs" color="success" value="50" />
361361
</td>
362362
<td className="text-center">
363-
<CIcon height={25} name="cib-mastercard" />
363+
<CIcon height={25} name="cib-cc-mastercard" />
364364
</td>
365365
<td>
366366
<div className="small text-muted">Last login</div>
@@ -396,7 +396,7 @@ const Dashboard = () => {
396396
<CProgress className="progress-xs" color="info" value="10" />
397397
</td>
398398
<td className="text-center">
399-
<CIcon height={25} name="cib-visa" />
399+
<CIcon height={25} name="cib-cc-visa" />
400400
</td>
401401
<td>
402402
<div className="small text-muted">Last login</div>
@@ -501,7 +501,7 @@ const Dashboard = () => {
501501
<CProgress className="progress-xs" color="info" value="22" />
502502
</td>
503503
<td className="text-center">
504-
<CIcon height={25} name="cil-wallet"/>
504+
<CIcon height={25} name="cib-google-pay"/>
505505
</td>
506506
<td>
507507
<div className="small text-muted">Last login</div>

0 commit comments

Comments
 (0)