Skip to content

Commit 4520017

Browse files
committed
Remove inline svg and update browserslist
1 parent f358d13 commit 4520017

File tree

8 files changed

+21
-49
lines changed

8 files changed

+21
-49
lines changed

.babelrc

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
{
2-
"presets": [
3-
"@babel/env",
4-
"@babel/preset-typescript",
5-
"@babel/preset-react"
6-
],
2+
"presets": ["@babel/env", "@babel/preset-typescript", "@babel/preset-react"],
73
"plugins": [
84
"@babel/proposal-class-properties",
95
"@babel/proposal-object-rest-spread",

.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports = {
2222
extensions: ['.js', '.ts', '.jsx', '.tsx', '.json'],
2323
},
2424
webpack: {
25-
extensions: ['.svg', '.svg?inline', '.graphql'],
25+
extensions: ['.svg', '.graphql'],
2626
},
2727
},
2828
},

package.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,11 @@
184184
"webpack-merge": "^4.2.1"
185185
},
186186
"browserslist": [
187-
"> 1% in US",
188-
"firefox ESR",
189-
"last 2 versions",
190-
"not IE > 10",
191-
"not dead"
187+
"last 2 chrome versions",
188+
"last 2 firefox versions",
189+
"last 2 safari versions",
190+
"last 2 edge versions",
191+
"last 2 ios versions",
192+
"last 2 chromeandroid versions"
192193
]
193194
}

src/client/components/Input/Checkbox.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import React from 'react';
22
import styled from 'styled-components';
33
import { Update } from 'use-immer';
44
import { AppField } from '../../routes/application/ApplicationConfig';
5-
import UncheckedSvg from '../../assets/img/unchecked_box.svg?inline';
6-
import CheckedSvg from '../../assets/img/checked_box.svg?inline';
5+
import UncheckedSvg from '../../assets/img/unchecked_box.svg';
6+
import CheckedSvg from '../../assets/img/checked_box.svg';
77

88
interface Props extends AppField {
99
options?: string[];
@@ -112,9 +112,9 @@ export class Checkbox extends React.PureComponent<Props, {}> {
112112
/>
113113
<label htmlFor={option}>
114114
{value.has(option) ? (
115-
<CheckedSvg width={24} height={24} />
115+
<img src={CheckedSvg} alt="checked" width={24} height={24} />
116116
) : (
117-
<UncheckedSvg width={24} height={24} />
117+
<img src={UncheckedSvg} alt="unchecked" width={24} height={24} />
118118
)}
119119
{option}
120120
</label>

src/client/components/Sidebar/Sidebar.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useContext } from 'react';
22
import styled from 'styled-components';
33
import { NavLink as UglyNavLink, withRouter } from 'react-router-dom';
4-
import SqLogo from '../../assets/img/square_hackathon_logo.svg?inline';
4+
import SqLogo from '../../assets/img/square_hackathon_logo.svg';
55
import STRINGS from '../../assets/strings.json';
66
import NavButton from '../Buttons/NavButton';
77
import { SpaceBetweenColumn, FlexEndColumn } from '../Containers/FlexContainers';
@@ -115,7 +115,7 @@ const Sidebar = withRouter(
115115
<Layout>
116116
<Background>
117117
<Logo>
118-
<SqLogo />
118+
<img src={SqLogo} alt="VH graphic" />
119119
</Logo>
120120
<HorizontalLine />
121121
<SpaceBetweenColumn height="calc(100% - calc(8rem + 160px))">

src/client/components/Text/ErrorMessage.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { FunctionComponent } from 'react';
22
import { Link } from 'react-router-dom';
33
import styled from 'styled-components';
44
import STRINGS from '../../assets/strings.json';
5-
import SadFace from '../../assets/img/sad_face.svg?inline';
5+
import SadFace from '../../assets/img/sad_face.svg';
66
import TextButton from '../Buttons/TextButton';
77

88
const Rectangle = styled.div`
@@ -32,7 +32,7 @@ export const ErrorMessage: FunctionComponent<ErrorMessageProps> = (
3232
const { children } = props;
3333
return (
3434
<Rectangle>
35-
<SadFace />
35+
<img src={SadFace} alt="Sad face" />
3636
{children}
3737
</Rectangle>
3838
);

tsconfig.json

+4-21
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"module": "commonjs",
3+
"module": "esnext",
44
"allowJs": true,
55
"allowSyntheticDefaultImports": true,
66
"emitDecoratorMetadata": true,
@@ -10,27 +10,10 @@
1010
"jsx": "react",
1111
"moduleResolution": "node",
1212
"resolveJsonModule": true,
13+
"sourceMap": true,
1314
"strict": true,
14-
"target": "es2017",
15-
"lib": [
16-
"es5",
17-
"es6",
18-
"dom",
19-
"es2015",
20-
"es2015.core",
21-
"es2015.collection",
22-
"es2015.generator",
23-
"es2015.iterable",
24-
"es2015.promise",
25-
"es2015.proxy",
26-
"es2015.reflect",
27-
"es2015.symbol",
28-
"es2015.symbol.wellknown",
29-
"esnext.asynciterable",
30-
"es2017.object",
31-
"es2017"
32-
],
33-
"outDir": "dist",
15+
"target": "esnext",
16+
"outDir": "./dist/",
3417
"baseUrl": ".",
3518
"paths": {
3619
"*": ["node_modules/*"]

webpack.common.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,7 @@ module.exports = {
2828
},
2929
{
3030
test: /\.svg$/,
31-
oneOf: [
32-
{
33-
resourceQuery: /inline/,
34-
use: ['@svgr/webpack'],
35-
},
36-
{
37-
use: ['@svgr/webpack', 'file-loader'],
38-
},
39-
],
31+
use: ['@svgr/webpack', 'file-loader'],
4032
},
4133
{
4234
include: /node_modules/,

0 commit comments

Comments
 (0)