Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions packages/styled-components/src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react'
import styled from 'styled-components'
import { color } from '../styles'
import { Header } from './Header'
import { Button } from './Button'

const CustomButton: React.FC = ({ children }) => <button onClick={() => alert('CustomButton')}>{children}</button>

Expand All @@ -24,13 +25,6 @@ const Container = styled.div({
justifyContent: 'center',
})

const Button = styled.button`
border: solid 1px ${color.primary};
width: 100px;
height: 30px;
margin: 0 20px;
`

type StyleMap = {
[key: string]: () => string
}
Expand Down Expand Up @@ -60,4 +54,3 @@ const StyleObjectsStyledButton = styled(Button)<StyleButtonProps>(
},
(props) => (props.styleType ? styleMap[props.styleType]() : styleMap.default())
)

18 changes: 18 additions & 0 deletions packages/styled-components/src/components/Button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import styled from 'styled-components'
import { color } from '../styles'

export const Button = styled.button`
border: solid 1px ${color.primary};
width: 100px;
height: 30px;
margin: 0 20px;
`

// Style Objects
const StyleObjectsButton = styled.button({
border: `solid 1px ${color.primary}`,
width: 100,
height: 30,
margin: '0 20px',
})