-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: TextButton 컴포넌트 추가 * feat: hover, acitve diabled일때 적용 안되도록 설정 * refac: theme, props를 비구조화해서 쓰도록 수정 * fix: svg 경고 수정
- Loading branch information
Showing
5 changed files
with
102 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
const Container = styled.button` | ||
cursor: pointer; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
border-radius: 4px; | ||
height: 44px; | ||
padding: 11px 18px; | ||
border: none; | ||
background-color: transparent; | ||
transition: | ||
background-color 0.2s ease-in-out, | ||
color 0.2s ease-in-out; | ||
color: ${({ theme }) => theme.palette.grey.g90}; | ||
${({ theme }) => theme.typo.sh1}; | ||
&:disabled { | ||
cursor: unset; | ||
} | ||
&:hover:not(:disabled) { | ||
background-color: ${({ theme }) => theme.palette.grey.g20}; | ||
} | ||
&:disabled { | ||
color: ${({ theme }) => theme.palette.grey.g60}; | ||
} | ||
`; | ||
|
||
const Icon = styled.div` | ||
width: 20px; | ||
height: 20px; | ||
margin-right: 8px; | ||
`; | ||
|
||
export default { | ||
Container, | ||
Icon, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import Styled from './TextButton.style'; | ||
|
||
interface Props extends React.HTMLAttributes<HTMLButtonElement> { | ||
icon?: React.ReactNode; | ||
disabled?: boolean; | ||
} | ||
|
||
const Button = ({ children, icon, ...rest }: Props) => { | ||
return ( | ||
<Styled.Container {...rest}> | ||
{icon && <Styled.Icon>{icon}</Styled.Icon>} | ||
{children} | ||
</Styled.Container> | ||
); | ||
}; | ||
|
||
export default Button; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import ThemeProvider from './ThemeProvider'; | ||
import Button from './Button'; | ||
import TextButton from './TextButton'; | ||
|
||
export { ThemeProvider, Button }; | ||
export { ThemeProvider, Button, TextButton }; |