This repository has been archived by the owner on Nov 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
App.tsx
318 lines (300 loc) · 13.7 KB
/
App.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
import React from 'react'
// For issues T-2244 and T-2234
import PieLineGraph from '@streamlinehq/streamlinehq/img/streamline-regular/interface-essential/dashboard/pie-line-graph.svg'
import AlertUser from '@streamlinehq/streamlinehq/img/streamline-regular/interface-essential/alerts/alert-user.svg'
import RadioactiveCircle from '@streamlinehq/streamlinehq/img/streamline-regular/interface-essential/alerts/radioactive-circle.svg'
import SatelliteSignal from '@streamlinehq/streamlinehq/img/streamline-regular/interface-essential/share/satellite-signal.svg'
import { ReactComponent as Server3 } from '@streamlinehq/streamlinehq/img/streamline-regular/internet-networks-servers/servers/server-3.svg'
import { ReactComponent as ZoomIn } from '@streamlinehq/streamlinehq/img/streamline-bold/interface-essential/zoom/zoom-in.svg'
import TravelHotel5Star from '@streamlinehq/streamlinehq/img/streamline-mini-bold/maps-travel/hotel/travel-hotel-5-star.svg'
// For issue T-2234
import { ReactComponent as InterfaceShareHandLock } from '@streamlinehq/streamlinehq/img/streamline-mini-bold/interface-essential/share/interface-share-hand-lock.svg'
// For issue T-2234
// import { ReactComponent as NoteWritingPen1 } from '@streamlinehq/streamlinehq/img/material-solid/interface-essential/content-edition/note-writing-pen-1.svg'
// import { ReactComponent as PencilPaper2 } from '@streamlinehq/streamlinehq/img/cyber-line/content-edition/content-edition/pencil-paper-2.svg'
// import Avatar2 from '@streamlinehq/streamlinehq/img/illustrations-line/users/users/avatar-2.svg'
// import { ReactComponent as AstronautRobot2 } from '@streamlinehq/streamlinehq/img/illustrations-line/robot/robots-explorer/astronaut-robot-2.svg'
// import AvatarNetwork from '@streamlinehq/streamlinehq/img/illustrations-multicolor/users/users/avatar-network.svg'
// import Avatar4 from '@streamlinehq/streamlinehq/img/illustrations-multicolor/users/users/avatar-4.svg'
// import { ReactComponent as ContactBook1 } from '@streamlinehq/streamlinehq/img/illustrations-multicolor/users/user-profile-data/contact-book-1.svg'
// import { ReactComponent as FingerprintHand3 } from '@streamlinehq/streamlinehq/img/illustrations-multicolor/users/fingerprint-identification/fingerprint-hand-3.svg'
import './App.css'
const App = () => (
<main>
<h1>streamlinehq example app</h1>
<p>
<code>.env</code> file in this app (not added to git but you can check{' '}
<code>.env.example</code>) has{' '}
<code>
"streamline-regular","streamline-bold","streamline-mini-bold","illustrations-line",
"illustrations-multicolor"
</code>{' '}
inside its <code>STREAMLINE_FAMILIES</code> key. This means that this app
has got access to images from these Streamline families.
</p>
<p>
SVG images can be added directly as React components in this example app
because <code>create-react-app</code>{' '}
<a href="https://create-react-app.dev/docs/adding-images-fonts-and-files/#adding-svgs">
supports it
</a>
. Your app might support importing svg files in a different way.
</p>
<p>
Code for each image is taken from{' '}
<a href="https://app.streamlinehq.com/">Streamline app</a>. Click on an
icon there and then click on NPM Package button in the sidebar to see how
to import it.
</p>
<h2>One-colored images</h2>
<section>
<h3>
<a href="https://app.streamlinehq.com/icons/streamline-regular">
Streamline-regular
</a>
</h3>
<figure>
<code>{`import PieLineGraph from '@streamlinehq/streamlinehq/img/streamline-regular/interface-essential/dashboard/pie-line-graph.svg'`}</code>
<code>{`
<div style={{ width: '200px' }}>
<img src={PieLineGraph} alt="Pie line graph" />
</div>
`}</code>
<div style={{ width: '200px' }}>
<img src={PieLineGraph} alt="Pie line graph" />
</div>
<figcaption>
Imported as an image, nothing is changed (note that it takes all
available space, which is 200px because of the parent div)
</figcaption>
</figure>
<figure>
<code>{`import SatelliteSignal from '@streamlinehq/streamlinehq/img/streamline-regular/interface-essential/share/satellite-signal.svg'`}</code>
<code>{`<img src={SatelliteSignal} alt="Satellite" width={150} />`}</code>
<img src={SatelliteSignal} alt="Satellite" width={150} />
<figcaption>Imported as an image, custom width is set</figcaption>
</figure>
<figure>
<code>{`import AlertUser from '@streamlinehq/streamlinehq/img/streamline-regular/interface-essential/alerts/alert-user.svg'`}</code>
<code>{`<img src={AlertUser} alt="Alert" style={{background: 'blue', padding: '10px'}} width={150} />`}</code>
<img
src={AlertUser}
alt="Alert"
style={{ background: 'blue', padding: '10px' }}
width={150}
/>
<figcaption>
Imported as an image, custom width and style for the img tag itself is
set
</figcaption>
</figure>
<figure>
<code>{`import RadioactiveCircle from '@streamlinehq/streamlinehq/img/streamline-regular/interface-essential/alerts/radioactive-circle.svg'`}</code>
<code>{`
<img
src={RadioactiveCircle}
alt="Radioactive"
style={{
filter: 'invert(.5) sepia(1) saturate(5) hue-rotate( 175deg )'
}}
width={150}
/>
`}</code>
<img
src={RadioactiveCircle}
alt="Radioactive"
style={{
filter: 'invert(.5) sepia(1) saturate(5) hue-rotate( 175deg )',
}}
width={150}
/>
<figcaption>
Imported as an image, custom width is set, color is changed with a{' '}
<a href="https://blog.union.io/code/2017/08/10/img-svg-fill/">
`filter` CSS rule
</a>
.
</figcaption>
</figure>
<figure>
<code>{`import { ReactComponent as Server3 } from '@streamlinehq/streamlinehq/img/streamline-regular/internet-networks-servers/servers/server-3.svg'`}</code>
<code>{`<Server3 width={100} stroke="green" />`}</code>
<Server3 width={100} stroke="green" />
<figcaption>
Imported as a React component, width and stroke are set directly as
props.
</figcaption>
</figure>
</section>
<section>
<h3>
<a href="https://app.streamlinehq.com/icons/streamline-bold">
Streamline-bold
</a>
</h3>
<figure>
<code>{`import { ReactComponent as ZoomIn } from '@streamlinehq/streamlinehq/img/streamline-bold/interface-essential/zoom/zoom-in.svg'`}</code>
<code>{`<ZoomIn width={100} className="green" />`}</code>
<ZoomIn width={100} className="green" />
<figcaption>
Imported as a React component, width is set as a prop, while fill is
set via CSS.
</figcaption>
</figure>
</section>
<section>
<h3>
<a href="https://app.streamlinehq.com/icons/streamline-mini-bold">
Streamline-mini-bold
</a>
</h3>
<figure>
<code>{`import { ReactComponent as InterfaceShareHandLock } from '@streamlinehq/streamlinehq/img/streamline-mini-bold/interface-essential/share/interface-share-hand-lock.svg'`}</code>
<code>{`
<InterfaceShareHandLock
width={100}
height={200}
preserveAspectRatio="none"
className="green"
/>
`}</code>
<InterfaceShareHandLock
width={100}
height={200}
preserveAspectRatio="none"
className="green"
/>
<figcaption>
Imported as a React component, width and height are set as props,
while fill is set via CSS and also aspect ratio is not preserved (set
via a prop).
</figcaption>
</figure>
<figure>
<code>{`import TravelHotel5Star from '@streamlinehq/streamlinehq/img/streamline-mini-bold/maps-travel/hotel/travel-hotel-5-star.svg'`}</code>
<code>{`
<img
src={TravelHotel5Star}
alt="5 star"
height={75}
style={{ background: 'red', borderRadius: 20, padding: 10 }}
/>
`}</code>
<img
src={TravelHotel5Star}
alt="5 star"
height={75}
style={{ background: 'red', borderRadius: 20, padding: 10 }}
/>
<figcaption>
Imported as an image, custom height and style for the img tag itself
is set
</figcaption>
</figure>
</section>
{/*<section>*/}
{/* <h3>*/}
{/* <a href="https://app.streamlinehq.com/icons/material-solid">*/}
{/* Material solid*/}
{/* </a>*/}
{/* </h3>*/}
{/* <figure>*/}
{/* <code>{`import { ReactComponent as NoteWritingPen1 } from '@streamlinehq/streamlinehq/img/material-solid/interface-essential/content-edition/note-writing-pen-1.svg'`}</code>*/}
{/* <code>{`<NoteWritingPen1 width={100} />`}</code>*/}
{/* <NoteWritingPen1 width={100} />*/}
{/* <figcaption>*/}
{/* Imported as a React component, width is set as a prop.*/}
{/* </figcaption>*/}
{/* </figure>*/}
{/*</section>*/}
{/*<section>*/}
{/* <h3>*/}
{/* <a href="https://app.streamlinehq.com/icons/cyber-line">Cyber Line</a>*/}
{/* </h3>*/}
{/* <figure>*/}
{/* <code>{`import { ReactComponent as PencilPaper2 } from '@streamlinehq/streamlinehq/img/cyber-line/content-edition/content-edition/pencil-paper-2.svg'`}</code>*/}
{/* <code>{`<PencilPaper2 width={100} />`}</code>*/}
{/* <PencilPaper2 width={100} />*/}
{/* <figcaption>*/}
{/* Imported as a React component, width is set as a prop.*/}
{/* </figcaption>*/}
{/* </figure>*/}
{/*</section>*/}
{/*<section>*/}
{/* <h3>*/}
{/* <a href="https://app.streamlinehq.com/illustrations/illustrations-line">*/}
{/* Streamline UX – Line*/}
{/* </a>*/}
{/* </h3>*/}
{/* <figure>*/}
{/* <code>{`import Avatar2 from '@streamlinehq/streamlinehq/img/illustrations-line/users/users/avatar-2.svg'`}</code>*/}
{/* <code>{`<img src={Avatar2} alt="Avatar" width={150} />`}</code>*/}
{/* <img src={Avatar2} alt="Avatar" width={150} />*/}
{/* <figcaption>Imported as an image, custom width is set</figcaption>*/}
{/* </figure>*/}
{/* <figure>*/}
{/* <code>{`import { ReactComponent as AstronautRobot2 } from '@streamlinehq/streamlinehq/img/illustrations-line/robot/robots-explorer/astronaut-robot-2.svg'`}</code>*/}
{/* <code>{`<AstronautRobot2 width={250} height={150} stroke="red"/>`}</code>*/}
{/* <AstronautRobot2 width={250} height={150} stroke="red" />*/}
{/* <figcaption>*/}
{/* Imported as a React component, stroke, width and height are set as*/}
{/* props.*/}
{/* </figcaption>*/}
{/* </figure>*/}
{/*</section>*/}
{/*<h2>Multi-colored images</h2>*/}
{/*<section>*/}
{/* <h3>*/}
{/* <a href="https://app.streamlinehq.com/illustrations/illustrations-multicolor">*/}
{/* Streamline UX – Multicolor*/}
{/* </a>*/}
{/* </h3>*/}
{/* <figure>*/}
{/* <code>{`import AvatarNetwork from '@streamlinehq/streamlinehq/img/illustrations-multicolor/users/users/avatar-network.svg'`}</code>*/}
{/* <code>{`<img src={AvatarNetwork} alt="AvatarNetwork" width={150} />`}</code>*/}
{/* <img src={AvatarNetwork} alt="AvatarNetwork" width={150} />*/}
{/* <figcaption>Imported as an image, custom width is set</figcaption>*/}
{/* </figure>*/}
{/* <figure>*/}
{/* <code>{`import Avatar4 from '@streamlinehq/streamlinehq/img/illustrations-multicolor/users/users/avatar-4.svg'`}</code>*/}
{/* <code>{`*/}
{/* <img*/}
{/* src={Avatar4}*/}
{/* alt="Avatar4"*/}
{/* width={150}*/}
{/* style={{ background: 'blue', padding: 10, borderRadius: 150 }}*/}
{/* />*/}
{/* `}</code>*/}
{/* <img*/}
{/* src={Avatar4}*/}
{/* alt="Avatar4"*/}
{/* width={150}*/}
{/* style={{ background: 'blue', padding: 10, borderRadius: 150 }}*/}
{/* />*/}
{/* <figcaption>*/}
{/* Imported as an image, custom width and style for the img tag itself is*/}
{/* set*/}
{/* </figcaption>*/}
{/* </figure>*/}
{/* <figure>*/}
{/* <code>{`import { ReactComponent as ContactBook1 } from '@streamlinehq/streamlinehq/img/illustrations-multicolor/users/user-profile-data/contact-book-1.svg'`}</code>*/}
{/* <code>{`<ContactBook1 width={100} className="red" />`}</code>*/}
{/* <ContactBook1 width={100} className="red" />*/}
{/* <figcaption>*/}
{/* Imported as a React component, width is set as a prop, stroke is set*/}
{/* via CSS to red while fill is original.*/}
{/* </figcaption>*/}
{/* </figure>*/}
{/* <figure>*/}
{/* <code>{`import { ReactComponent as FingerprintHand3 } from '@streamlinehq/streamlinehq/img/illustrations-multicolor/users/fingerprint-identification/fingerprint-hand-3.svg'`}</code>*/}
{/* <code>{`<FingerprintHand3 width={100} className="red green" />`}</code>*/}
{/* <FingerprintHand3 width={100} className="red green" />*/}
{/* <figcaption>*/}
{/* Imported as a React component, width is set as a prop, fill is set to*/}
{/* green via CSS while stroke is set via CSS to red.*/}
{/* </figcaption>*/}
{/* </figure>*/}
{/*</section>*/}
</main>
)
export default App