Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit01206f7

Browse files
committed
remove inline-react-svg plugin && fix error/warning
1 parent6c41692 commit01206f7

File tree

15 files changed

+250
-124
lines changed

15 files changed

+250
-124
lines changed

‎containers/Body/index.js‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ import {
2121
Router,
2222
Admin,
2323
Search,
24-
SearchIcon,
2524
Notification,
26-
NotificationIcon,
25+
HeaderIcon,
2726
User,
28-
UserIcon,
2927
BannerLogo,
3028
}from'./styles'
3129

@@ -37,13 +35,13 @@ const AppHeader = () => {
3735
<Button>管理页</Button>
3836
</Admin>
3937
<SearchonClick={logic.openDoraemon}>
40-
<SearchIcon/>
38+
<HeaderIconpath={getSVGIconPath('header_search')}/>
4139
</Search>
4240
<NotificationonClick={logic.openPreview}>
43-
<NotificationIcon/>
41+
<HeaderIconpath={getSVGIconPath('notification')}/>
4442
</Notification>
4543
<UseronClick={logic.openPreview.bind(this,'user')}>
46-
<UserIcon/>
44+
<HeaderIconpath={getSVGIconPath('header_user')}/>
4745
</User>
4846
</Header>
4947
)

‎containers/Body/styles/index.js‎

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ import ReactSVG from 'react-svg'
33

44
import{theme}from'../../../utils/themes'
55

6-
importsearchIconfrom'../../../static/search.svg'
7-
importuserIconfrom'../../../static/user.svg'
8-
importnotificationIconfrom'../../../static/notification.svg'
9-
106
exportconstBody=styled.div`
117
padding-left: 56px;
128
position: relative;
@@ -38,18 +34,11 @@ export const Search = styled.div`
3834
margin-right: 10px;
3935
`
4036

41-
exportconstSearchIcon=styled(searchIcon)`
42-
fill: grey;
43-
width: 22px;
44-
height: 22px;
45-
cursor: pointer;
46-
`
47-
4837
exportconstNotification=styled.div`
4938
color: grey;
5039
margin-right: 10px;
5140
`
52-
exportconstNotificationIcon=styled(notificationIcon)`
41+
exportconstHeaderIcon=styled(ReactSVG)`
5342
fill: grey;
5443
width: 22px;
5544
height: 22px;
@@ -60,12 +49,6 @@ export const User = styled.div`
6049
margin-right: 20px;
6150
`
6251

63-
exportconstUserIcon=styled(userIcon)`
64-
fill: grey;
65-
width: 22px;
66-
height: 22px;
67-
cursor: pointer;
68-
`
6952
exportconstBanner=styled.div`
7053
padding: 5px;
7154
padding-left: 80px;

‎containers/Doraemon/InputEditor.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ export default class InputEditor extends React.Component {
6969
return(
7070
<EditorBar>
7171
<AddOn>
72-
{searching ?<LoadingIcon/> :<PrefixIconprefix={prefix}/>}
72+
{searching ?(
73+
<LoadingIconpath={getSVGIconPath('search_loading')}/>
74+
) :(
75+
<PrefixIconprefix={prefix}/>
76+
)}
7377
</AddOn>
7478
<InputBar
7579
id="doraemonInputbar"

‎containers/Doraemon/styles/index.js‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import ReactSVG from 'react-svg'
33

44
import{theme}from'../../../utils/themes'
55
import{Img}from'../../../components'
6-
importloadingIconfrom'../../../static/searchLoading.svg'
76

87
constrotate360=keyframes`
98
from {
@@ -15,7 +14,7 @@ const rotate360 = keyframes`
1514
}
1615
`
1716

18-
exportconstLoadingIcon=styled(loadingIcon)`
17+
exportconstLoadingIcon=styled(ReactSVG)`
1918
fill:${theme('shell.search_icon')};
2019
width: 30px;
2120
height: 30px;

‎containers/GithubSearchPanel/index.js‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ import { inject, observer } from 'mobx-react'
1111
// import styled from 'styled-components'
1212

1313
importAfrom'../../components/A'
14-
import{makeDebugger,storeSelector}from'../../utils/functions'
14+
import{
15+
makeDebugger,
16+
storeSelector,
17+
getSVGIconPath,
18+
}from'../../utils/functions'
1519
import*aslogicfrom'./logic'
1620

1721
import{
@@ -38,7 +42,13 @@ const debug = makeDebugger('C:UniversePanel')
3842

3943
constSearchEditor=({ value, searching})=>(
4044
<EditorBar>
41-
<AddOn>{searching ?<LoadingIcon/> :<SearchIcon/>}</AddOn>
45+
<AddOn>
46+
{searching ?(
47+
<LoadingIconpath={getSVGIconPath('search_loading')}/>
48+
) :(
49+
<SearchIconpath={getSVGIconPath('search')}/>
50+
)}
51+
</AddOn>
4252
<InputBar
4353
spellCheck={false}
4454
autoCapitalize="off"

‎containers/GithubSearchPanel/styles/index.js‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
importstyled,{keyframes}from'styled-components'
2+
importReactSVGfrom'react-svg'
23
import{placeholder}from'polished'
34

45
import{theme}from'../../../utils/themes'
56

67
import{Img}from'../../../components'
78

8-
importsearchIconfrom'../../../static/search.svg'
9-
importloadingIconfrom'../../../static/searchLoading.svg'
10-
119
constrotate360=keyframes`
1210
from {
1311
transform: rotate(0deg);
@@ -18,14 +16,14 @@ const rotate360 = keyframes`
1816
}
1917
`
2018

21-
exportconstSearchIcon=styled(searchIcon)`
19+
exportconstSearchIcon=styled(ReactSVG)`
2220
fill:${theme('shell.search_icon')};
2321
width: 30px;
2422
height: 30px;
2523
margin-top: 20px;
2624
`
2725

28-
exportconstLoadingIcon=styled(loadingIcon)`
26+
exportconstLoadingIcon=styled(ReactSVG)`
2927
fill:${theme('shell.search_icon')};
3028
width: 30px;
3129
height: 30px;

‎containers/IntroBody/I18n.js‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
importReactfrom'react'
22
importstyledfrom'styled-components'
3-
3+
importReactSVGfrom'react-svg'
44
import{FormattedMessageasI18n}from'react-intl'
55

66
importlangfrom'./lang'
7+
import{getSVGIconPath}from'../../utils/functions'
78

89
import{Button}from'./styles'
910
import{Center,HorizontalCenter,Title}from'../../components/BaseStyled'
1011

1112
import*aslogicfrom'./logic'
1213

13-
importEnIconfrom'../../static/en_guard.svg'
14-
importCnIconfrom'../../static/cn_panda.svg'
15-
16-
constEnglishFlag=styled(EnIcon)`
14+
constEnglishFlag=styled(ReactSVG)`
1715
width: 3vh;
1816
margin-right: 10px;
1917
position: relative;
2018
top: 2px;
2119
`
2220

23-
constChinaFlag=styled(CnIcon)`
21+
constChinaFlag=styled(ReactSVG)`
2422
width: 3vh;
2523
margin-right: 10px;
2624
position: relative;
@@ -35,11 +33,11 @@ const I18nPage = () => {
3533
<I18n{...lang.i18nTitle}/>
3634
</Title>
3735
<ButtononClick={logic.changeLocale.bind(this,'en')}>
38-
<EnglishFlag/>
36+
<EnglishFlagpath={getSVGIconPath('en_guard')}/>
3937
<I18n{...lang.i18nEn}/>
4038
</Button>
4139
<ButtononClick={logic.changeLocale.bind(this,'zh')}>
42-
<ChinaFlag/>
40+
<ChinaFlagpath={getSVGIconPath('cn_panda')}/>
4341
<I18n{...lang.i18nZh}/>
4442
</Button>
4543
</HorizontalCenter>

‎package.json‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,6 @@
5353
"libraryName":"antd"
5454
}
5555
],
56-
[
57-
"inline-react-svg",
58-
{
59-
"svgo": {
60-
"plugins": [
61-
{
62-
"removeAttrs": {
63-
"attrs":"(data-name)"
64-
}
65-
},
66-
{
67-
"cleanupIDs":true
68-
}
69-
]
70-
}
71-
}
72-
],
7356
"ramda"
7457
],
7558
"env": {
@@ -137,7 +120,6 @@
137120
"babel-eslint":"^8.0.0",
138121
"babel-jest":"^21.0.2",
139122
"babel-plugin-import":"^1.6.2",
140-
"babel-plugin-inline-react-svg":"^0.4.0",
141123
"babel-plugin-ramda":"^1.4.3",
142124
"babel-plugin-react-intl":"^2.3.1",
143125
"babel-plugin-styled-components":"1.3.0",

‎static/nodeIcons/cmd/cn_panda.svg‎

Lines changed: 64 additions & 0 deletions
Loading

‎static/nodeIcons/cmd/en_guard.svg‎

Lines changed: 50 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp