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.

Commitc9ab4da

Browse files
committed
add antd component && refactor the import in components
1 parentef098fd commitc9ab4da

File tree

14 files changed

+22
-142
lines changed

14 files changed

+22
-142
lines changed

‎components/AntUI/index.js‎

Lines changed: 0 additions & 9 deletions
This file was deleted.

‎components/AntUI/Button.js‎renamed to ‎components/Button/index.js‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
importReactfrom'react'
88
importPropTypesfrom'prop-types'
99

10-
import{Button}from'antd'
10+
importMButtonfrom'./styles'
1111

1212
// import styled from 'styled-components'
1313

1414
import{makeDebugger}from'../../utils/functions'
1515
/* eslint-disable no-unused-vars */
16-
constdebug=makeDebugger('c:MButton:index')
16+
constdebug=makeDebugger('c:Button:index')
1717
/* eslint-enable no-unused-vars */
1818

19-
constMButton=({ children})=>{
20-
return<Button>{children}</Button>
19+
constButton=({ children})=>{
20+
return<MButton>{children}</MButton>
2121
}
2222

2323
MButton.propTypes={
@@ -28,4 +28,4 @@ MButton.defaultProps = {
2828
children:'..?..',
2929
}
3030

31-
exportdefaultMButton
31+
exportdefaultButton

‎components/Button/styles/index.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
importstyledfrom'styled-components'
2+
3+
import{Button}from'antd'
4+
5+
constMButton=styled(Button)`color: tomato;`
6+
7+
exportdefaultMButton

‎components/AntUI/tests/index.test.js‎renamed to ‎components/Button/tests/index.test.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// import React from 'react'
22
// import { shallow } from 'enzyme'
33

4-
// importAntUi from '../index'
4+
// importButton from '../index'
55

6-
describe('<AntUi />',()=>{
6+
describe('<Button />',()=>{
77
it('Expect to have unit tests specified',()=>{
88
expect(true).toEqual(false)
99
})

‎components/Clock/index.js‎

Lines changed: 0 additions & 37 deletions
This file was deleted.

‎components/Page/index.js‎

Lines changed: 0 additions & 61 deletions
This file was deleted.

‎components/Page/lang.js‎

Lines changed: 0 additions & 14 deletions
This file was deleted.

‎components/index.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export{defaultasButton}from'./Button'
2+
export{defaultasA}from'./A'
3+
export{defaultasImg}from'./Img'

‎containers/Body/Home.js‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import styled from 'styled-components'
44
import{FormattedMessageasI18n}from'react-intl'
55
importlangfrom'./lang'
66
// import * as logic from './logic'
7-
importAfrom'../../components/A'
8-
importImgfrom'../../components/Img'
7+
import{A,Img}from'../../components/'
98

109
import{Center,HorizontalCenter,Title}from'../../components/BaseStyled'
1110

‎containers/Body/index.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import keydown from 'react-keydown'
1010
importRfrom'ramda'
1111

1212
// import Link from 'next/link'
13-
import{Button}from'../../components/AntUI'
13+
import{Button}from'../../components'
1414

1515
import{makeDebugger}from'../../utils/functions'
1616

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp