File tree 2 files changed +19
-8
lines changed
packages/styled-components/src/components
2 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import React from 'react'
2
2
import styled from 'styled-components'
3
3
import { color } from '../styles'
4
4
import { Header } from './Header'
5
+ import { Button } from './Button'
5
6
6
7
const CustomButton : React . FC = ( { children } ) => < button onClick = { ( ) => alert ( 'CustomButton' ) } > { children } </ button >
7
8
@@ -24,13 +25,6 @@ const Container = styled.div({
24
25
justifyContent : 'center' ,
25
26
} )
26
27
27
- const Button = styled . button `
28
- border: solid 1px ${ color . primary } ;
29
- width: 100px;
30
- height: 30px;
31
- margin: 0 20px;
32
- `
33
-
34
28
type StyleMap = {
35
29
[ key : string ] : ( ) => string
36
30
}
@@ -60,4 +54,3 @@ const StyleObjectsStyledButton = styled(Button)<StyleButtonProps>(
60
54
} ,
61
55
( props ) => ( props . styleType ? styleMap [ props . styleType ] ( ) : styleMap . default ( ) )
62
56
)
63
-
Original file line number Diff line number Diff line change
1
+ import styled from 'styled-components'
2
+ import { color } from '../styles'
3
+
4
+ export const Button = styled . button `
5
+ border: solid 1px ${ color . primary } ;
6
+ width: 100px;
7
+ height: 30px;
8
+ margin: 0 20px;
9
+ `
10
+
11
+ // Style Objects
12
+ const StyleObjectsButton = styled . button ( {
13
+ border : `solid 1px ${ color . primary } ` ,
14
+ width : 100 ,
15
+ height : 30 ,
16
+ margin : '0 20px' ,
17
+ } )
18
+
You can’t perform that action at this time.
0 commit comments