Skip to content

Commit 589f0e2

Browse files
author
Marek Rozmus
committed
Move svg content into js
1 parent 32f048b commit 589f0e2

File tree

7 files changed

+46
-188
lines changed

7 files changed

+46
-188
lines changed

examples/images/delete.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/images/icons.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import React from 'react';
2+
3+
export const DeleteIcon = () => {
4+
return (
5+
<svg
6+
xmlns="http://www.w3.org/2000/svg"
7+
width="100%"
8+
height="100%"
9+
viewBox="0 0 24 24"
10+
>
11+
<path fill="none" d="M0 0h24v24H0V0z" />
12+
<path d="M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z" />
13+
</svg>
14+
);
15+
};
16+
17+
export const MailIcon = () => {
18+
return (
19+
<svg
20+
xmlns="http://www.w3.org/2000/svg"
21+
width="100%"
22+
height="100%"
23+
viewBox="0 0 24 24"
24+
>
25+
<path fill="none" d="M0 0h24v24H0V0z" />
26+
<path d="M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6zm-2 0l-8 4.99L4 6h16zm0 12H4V8l8 5 8-5v10z" />
27+
</svg>
28+
);
29+
};
30+
31+
export const ReplyIcon = () => {
32+
return (
33+
<svg
34+
xmlns="http://www.w3.org/2000/svg"
35+
width="100%"
36+
height="100%"
37+
viewBox="0 0 24 24"
38+
>
39+
<path fill="none" d="M0 0h24v24H0V0z" />
40+
<path d="M10 9V5l-7 7 7 7v-4.1c5 0 8.5 1.6 11 5.1-1-5-4-10-11-11z" />
41+
</svg>
42+
);
43+
};

examples/images/mail.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/images/reply.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/package-lock.json

Lines changed: 1 addition & 180 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
"@babel/preset-react": "^7.0.0",
3535
"babel-eslint": "^10.0.3",
3636
"babel-loader": "^8.0.6",
37-
"classnames": "^2.2.6",
3837
"css-loader": "^3.2.0",
3938
"eslint": "^6.3.0",
4039
"eslint-config-prettier": "^6.2.0",
@@ -44,7 +43,6 @@
4443
"gh-pages": "^2.1.1",
4544
"html-webpack-plugin": "^3.2.0",
4645
"prettier": "^1.18.2",
47-
"react-svg-loader": "^3.0.3",
4846
"style-loader": "^1.0.0",
4947
"stylelint": "^11.0.0",
5048
"stylelint-config-standard": "^19.0.0",
@@ -55,6 +53,7 @@
5553
},
5654
"dependencies": {
5755
"@sandstreamdev/react-swipeable-list": "^0.2.1",
56+
"classnames": "^2.2.6",
5857
"react": "^16.9.0",
5958
"react-dom": "^16.9.0"
6059
}

examples/src/App.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import '@sandstreamdev/react-swipeable-list/dist/styles.css';
77

88
import ListItem from './ComplexListItem';
99
import ComplexItemContent from './ComplexItemContent';
10-
import MailIcon from '../images/mail.svg';
11-
import ReplyIcon from '../images/reply.svg';
12-
import DeleteIcon from '../images/delete.svg';
10+
import { MailIcon, ReplyIcon, DeleteIcon } from '../images/icons';
1311
import styles from './app.css';
1412

1513
function App() {

0 commit comments

Comments
 (0)