-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[공통컴포넌트] Button 10가지 구현 #57
Changes from 19 commits
310dce4
1f9d153
3dc7014
8e8ff4c
4280495
137c13d
f254514
6ca22ce
0d04492
80d0a66
660dd83
0d306b8
4228828
fd01198
2772568
58b2566
81f1445
9f4c679
1f71a82
7d3660c
fb91acb
52aede1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import * as React from 'react'; | ||
import type { SVGProps } from 'react'; | ||
const SvgIcCircle = (props: SVGProps<SVGSVGElement>) => ( | ||
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' {...props}> | ||
<rect width={23} height={23} x={0.5} y={0.5} stroke='#EBE9EA' rx={11.5} /> | ||
</svg> | ||
); | ||
export default SvgIcCircle; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import * as React from 'react'; | ||
import type { SVGProps } from 'react'; | ||
const SvgIcCirclePink = (props: SVGProps<SVGSVGElement>) => ( | ||
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' {...props}> | ||
<rect width={24} height={24} fill='#E81E6B' rx={12} /> | ||
<rect width={12} height={12} x={6} y={6} fill='#fff' rx={6} /> | ||
</svg> | ||
); | ||
export default SvgIcCirclePink; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import * as React from 'react'; | ||
import type { SVGProps } from 'react'; | ||
const SvgIcKakaoSmall = (props: SVGProps<SVGSVGElement>) => ( | ||
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 186 44' {...props}> | ||
<rect width={186} height={44} fill='#FEE500' rx={22} /> | ||
<g clipPath='url(#ic_kakao_small_svg__a)'> | ||
<path | ||
fill='#000' | ||
fillRule='evenodd' | ||
d='M45 13.6c-4.97 0-9 3.113-9 6.952 0 2.388 1.558 4.493 3.932 5.745l-.999 3.648c-.088.322.28.579.563.392l4.377-2.889q.554.055 1.127.057c4.97 0 9-3.113 9-6.953 0-3.839-4.03-6.952-9-6.952' | ||
clipRule='evenodd' | ||
/> | ||
</g> | ||
<path | ||
fill='#000' | ||
fillOpacity={0.85} | ||
d='M69.888 16.464c0 4.288-1.184 7.984-6.4 10.608l-.912-1.312c2.448-1.232 3.92-2.672 4.736-4.384l-4.4.432-.224-1.488 5.136-.32c.192-.672.304-1.392.368-2.16h-4.784v-1.376zm1.984 12.8V15.04H73.6v5.584h2.112v1.424H73.6v7.216zm12-12.8c0 4.288-1.184 7.984-6.4 10.608l-.912-1.312c2.448-1.232 3.92-2.672 4.736-4.384l-4.4.432-.224-1.488 5.136-.32c.192-.672.304-1.392.368-2.16h-4.784v-1.376zm1.984 12.8V15.04h1.728v5.584h2.112v1.424h-2.112v7.216zm11.089-13.408c3.024 0 5.248 1.52 5.248 3.84 0 2.112-1.824 3.536-4.4 3.792v2.656h5.6v1.392h-12.88v-1.392h5.568v-2.656c-2.576-.256-4.384-1.68-4.384-3.792 0-2.32 2.224-3.84 5.248-3.84m-3.568 3.84c0 1.52 1.488 2.48 3.568 2.48s3.568-.96 3.568-2.48-1.488-2.48-3.568-2.48-3.568.96-3.568 2.48m14.808 6.528h5.568v-2.368h-4.032v-4.64h8.144v-1.824h-8.16v-1.376h9.856v4.56h-8.128v1.904h8.448v1.376h-4.416v2.368h5.6v1.392h-12.88zm15.344-9.792h9.872v1.584c0 1.904 0 3.888-.528 6.88l-1.728-.16c.544-2.8.544-4.864.544-6.72v-.208h-8.16zm-1.36 10.896V25.92h12.864v1.408zm24-12.256h1.728v10.272h-1.728zm-9.76 4.496c0-2.096 1.648-3.568 3.792-3.568 2.16 0 3.792 1.472 3.792 3.568 0 2.064-1.632 3.552-3.792 3.552-2.144 0-3.792-1.488-3.792-3.552m1.68 0c0 1.248.912 2.048 2.112 2.048s2.128-.8 2.128-2.048c0-1.28-.928-2.08-2.128-2.08s-2.112.8-2.112 2.08m.496 9.44V24.32h1.712v3.296h8v1.392z' | ||
/> | ||
<defs> | ||
<clipPath id='ic_kakao_small_svg__a'> | ||
<path fill='#fff' d='M36 13h18v18H36z' /> | ||
</clipPath> | ||
</defs> | ||
</svg> | ||
); | ||
export default SvgIcKakaoSmall; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import * as React from 'react'; | ||
import type { SVGProps } from 'react'; | ||
const SvgIcKakoLarge = (props: SVGProps<SVGSVGElement>) => ( | ||
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 335 52' {...props}> | ||
<rect width={335} height={52} fill='#FEE500' rx={26} /> | ||
<g clipPath='url(#ic_kako_large_svg__a)'> | ||
<path | ||
fill='#000' | ||
fillRule='evenodd' | ||
d='M119.5 17.6c-4.971 0-9 3.113-9 6.952 0 2.388 1.558 4.493 3.932 5.745l-.999 3.648c-.088.322.28.579.563.392l4.377-2.889q.555.055 1.127.057c4.97 0 9-3.113 9-6.953 0-3.839-4.03-6.952-9-6.952' | ||
clipRule='evenodd' | ||
/> | ||
</g> | ||
<path | ||
fill='#000' | ||
fillOpacity={0.85} | ||
d='M144.388 20.464c0 4.288-1.184 7.984-6.4 10.608l-.912-1.312c2.448-1.232 3.92-2.672 4.736-4.384l-4.4.432-.224-1.488 5.136-.32c.192-.672.304-1.392.368-2.16h-4.784v-1.376zm1.984 12.8V19.04h1.728v5.584h2.112v1.424H148.1v7.216zm12-12.8c0 4.288-1.184 7.984-6.4 10.608l-.912-1.312c2.448-1.232 3.92-2.672 4.736-4.384l-4.4.432-.224-1.488 5.136-.32c.192-.672.304-1.392.368-2.16h-4.784v-1.376zm1.984 12.8V19.04h1.728v5.584h2.112v1.424h-2.112v7.216zm11.089-13.408c3.024 0 5.248 1.52 5.248 3.84 0 2.112-1.824 3.536-4.4 3.792v2.656h5.6v1.392h-12.88v-1.392h5.568v-2.656c-2.576-.256-4.384-1.68-4.384-3.792 0-2.32 2.224-3.84 5.248-3.84m-3.568 3.84c0 1.52 1.488 2.48 3.568 2.48s3.568-.96 3.568-2.48-1.488-2.48-3.568-2.48-3.568.96-3.568 2.48m14.808 6.528h5.568v-2.368h-4.032v-4.64h8.144v-1.824h-8.16v-1.376h9.856v4.56h-8.128v1.904h8.448v1.376h-4.416v2.368h5.6v1.392h-12.88zm15.344-9.792h9.872v1.584c0 1.904 0 3.888-.528 6.88l-1.728-.16c.544-2.8.544-4.864.544-6.72v-.208h-8.16zm-1.36 10.896V29.92h12.864v1.408zm24-12.256h1.728v10.272h-1.728zm-9.76 4.496c0-2.096 1.648-3.568 3.792-3.568 2.16 0 3.792 1.472 3.792 3.568 0 2.064-1.632 3.552-3.792 3.552-2.144 0-3.792-1.488-3.792-3.552m1.68 0c0 1.248.912 2.048 2.112 2.048s2.128-.8 2.128-2.048c0-1.28-.928-2.08-2.128-2.08s-2.112.8-2.112 2.08m.496 9.44V28.32h1.712v3.296h8v1.392z' | ||
/> | ||
<defs> | ||
<clipPath id='ic_kako_large_svg__a'> | ||
<path fill='#fff' d='M110.5 17h18v18h-18z' /> | ||
</clipPath> | ||
</defs> | ||
</svg> | ||
); | ||
export default SvgIcKakoLarge; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const Wrapper = styled.button` | ||
${({ theme: { mixin } }) => mixin.inlineFlexBox({ align: 'center', justify: 'center' })} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 해당 코드 리뷰는 아마 뒤늦게 정해진 부분에 대해서 불필요한 리소스가 든다고 했던게 아닌가 싶어요 !!! (또 다시 분류 해야하는 리소스를 의미하는 것이라고 생각되었습니다 !) 좋은 리프레쉬 감사해요 !! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 저도 덕분에 mixin 사용 목적에 대해 다시 고민해보는 좋은 기회가 되었어요! 감사합니다~! |
||
|
||
padding: 0.8rem 1.2rem; | ||
gap: 0.4rem; | ||
border-radius: 2.4rem; | ||
|
||
border: none; | ||
background-color: ${({ theme: { colors } }) => colors.white}; | ||
color: ${({ theme: { colors } }) => colors.black}; | ||
`; | ||
|
||
export const Text = styled.p` | ||
display: flex; | ||
width: 100%; | ||
color: ${({ theme: { colors } }) => colors.black}; | ||
${({ theme: { fonts } }) => fonts.caption_02}; | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { ButtonHTMLAttributes } from 'react'; | ||
import { IcRefresh } from '../../../../assets/svg'; | ||
import * as S from './BtnChange.style'; | ||
|
||
type BtnChangeProps = ButtonHTMLAttributes<HTMLButtonElement> & { | ||
disabled?: boolean; | ||
children: React.ReactNode; | ||
onClick?: () => void; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 공통 섬세하게 만들어줘서 감사해요!!:) |
||
}; | ||
|
||
const BtnChange = ({ disabled, children, onClick }: BtnChangeProps) => { | ||
return ( | ||
<S.Wrapper disabled={disabled} onClick={onClick}> | ||
<IcRefresh style={{ width: '2rem' }} /> | ||
<S.Text>{children}</S.Text> | ||
</S.Wrapper> | ||
); | ||
}; | ||
export default BtnChange; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const Wrapper = styled.button` | ||
${({ theme: { mixin } }) => mixin.flexCenter({})} | ||
|
||
width: 33.5rem; | ||
padding: 1.5rem 8.1rem 1.6rem 8.1rem; | ||
gap: 1rem; | ||
border-radius: 5.5rem; | ||
|
||
background-color: ${({ theme: { colors } }) => colors.black}; | ||
color: ${({ theme: { colors } }) => colors.white}; | ||
${({ theme: { fonts } }) => fonts.body_09} | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { ButtonHTMLAttributes } from 'react'; | ||
import * as S from './BtnFill.style'; | ||
|
||
type BtnFillProps = ButtonHTMLAttributes<HTMLButtonElement> & { | ||
disabled?: boolean; | ||
children: React.ReactNode; | ||
onClick?: () => void; | ||
}; | ||
|
||
const BtnFill = ({ disabled, children, onClick }: BtnFillProps) => { | ||
return ( | ||
<S.Wrapper disabled={disabled} onClick={onClick}> | ||
{children} | ||
</S.Wrapper> | ||
); | ||
}; | ||
export default BtnFill; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const Wrapper = styled.button` | ||
${({ theme: { mixin } }) => mixin.flexCenter({})} | ||
|
||
width: 30.3rem; | ||
height: 5.2rem; | ||
padding: 1.5rem 0rem 1.6rem 0rem; | ||
border-radius: 2.6rem; | ||
|
||
background-color: ${({ theme: { colors } }) => colors.black}; | ||
color: ${({ theme: { colors } }) => colors.white}; | ||
${({ theme: { fonts } }) => fonts.body_09}; | ||
|
||
&:focus { | ||
background-color: ${({ theme: { colors } }) => colors.white}; | ||
color: ${({ theme: { colors } }) => colors.black}; | ||
} | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { ButtonHTMLAttributes } from 'react'; | ||
import * as S from './BtnMedium.style'; | ||
|
||
type BtnMediumProps = ButtonHTMLAttributes<HTMLButtonElement> & { | ||
disabled?: boolean; | ||
children: React.ReactNode; | ||
onClick?: () => void; | ||
}; | ||
|
||
const BtnMedium = ({ disabled, children, onClick }: BtnMediumProps) => { | ||
return ( | ||
<S.Wrapper disabled={disabled} onClick={onClick}> | ||
{children} | ||
</S.Wrapper> | ||
); | ||
}; | ||
|
||
export default BtnMedium; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const Wrapper = styled.button` | ||
${({ theme: { mixin } }) => mixin.flexCenter({})} | ||
|
||
padding: 1.1rem 2rem 1.2rem 2rem; | ||
gap: 1rem; | ||
border-radius: 9.9rem; | ||
|
||
background-color: ${({ theme: { colors } }) => colors.white}; | ||
border: 1px solid ${({ theme: { colors } }) => colors.P_06}; | ||
color: ${({ theme: { colors } }) => colors.P_06}; | ||
${({ theme: { fonts } }) => fonts.body_09} | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { ButtonHTMLAttributes } from 'react'; | ||
import * as S from './BtnSmallStroke.style'; | ||
|
||
type BtnSmallStrokeProps = ButtonHTMLAttributes<HTMLButtonElement> & { | ||
disabled?: boolean; | ||
children: React.ReactNode; | ||
onClick?: () => void; | ||
}; | ||
|
||
const BtnSmallStroke = ({ disabled, children, onClick }: BtnSmallStrokeProps) => { | ||
return ( | ||
<S.Wrapper disabled={disabled} onClick={onClick}> | ||
{children} | ||
</S.Wrapper> | ||
); | ||
}; | ||
|
||
export default BtnSmallStroke; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const Wrapper = styled.button` | ||
${({ theme: { mixin } }) => mixin.flexBox({ align: 'center', justify: 'center' })} | ||
|
||
height: 3.2rem; | ||
padding: 0.4rem 0.6rem; | ||
border-radius: 1rem; | ||
column-gap: 0.4rem; | ||
|
||
background-color: ${({ theme: { colors } }) => colors.black}; | ||
`; | ||
|
||
export const Text = styled.p` | ||
display: flex; | ||
width: 100%; | ||
color: ${({ theme: { colors } }) => colors.white}; | ||
${({ theme: { fonts } }) => fonts.body_10}; | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { ButtonHTMLAttributes } from 'react'; | ||
import * as S from './BtnEdit.style'; | ||
import { IcEdit2 } from '../../../../assets/svg'; | ||
type BtnEditProps = ButtonHTMLAttributes<HTMLButtonElement> & { | ||
disabled?: boolean; | ||
children: React.ReactNode; | ||
onClick?: () => void; | ||
}; | ||
const BtnEdit = ({ disabled, children, onClick }: BtnEditProps) => { | ||
return ( | ||
<S.Wrapper disabled={disabled} onClick={onClick}> | ||
<IcEdit2 style={{ width: '2.4rem', color: 'white' }} /> | ||
<S.Text>{children}</S.Text> | ||
</S.Wrapper> | ||
); | ||
}; | ||
|
||
export default BtnEdit; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const Wrapper = styled.button` | ||
${({ theme: { mixin } }) => mixin.flexCenter({})} | ||
|
||
padding: 0.4rem 1rem; | ||
gap: 1rem; | ||
border-radius: 1.6rem; | ||
|
||
background-color: ${({ theme: { colors } }) => colors.G_01}; | ||
border-color: ${({ theme: { colors } }) => colors.G_02}; | ||
color: ${({ theme: { colors } }) => colors.G_08}; | ||
${({ theme: { fonts } }) => fonts.caption_02} | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { ButtonHTMLAttributes } from 'react'; | ||
import * as S from './BtnLogout.style'; | ||
|
||
type BtnLogoutProps = ButtonHTMLAttributes<HTMLButtonElement> & { | ||
disabled?: boolean; | ||
children: React.ReactNode; | ||
onClick?: () => void; | ||
}; | ||
|
||
const BtnLogout = ({ disabled, children, onClick }: BtnLogoutProps) => { | ||
return ( | ||
<S.Wrapper disabled={disabled} onClick={onClick}> | ||
{children} | ||
</S.Wrapper> | ||
); | ||
}; | ||
|
||
export default BtnLogout; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const Wrapper = styled.button` | ||
${({ theme: { mixin } }) => mixin.inlineFlexBox({ align: 'center', justify: 'center' })} | ||
|
||
height: 4.4rem; | ||
padding: 1rem 1.1rem 1rem 2rem; | ||
border-radius: 9.9rem; | ||
|
||
background-color: ${({ theme: { colors } }) => colors.G_02}; | ||
color: ${({ theme: { colors } }) => colors.G_07}; | ||
border-color: ${({ theme: { colors } }) => colors.G_07}; | ||
|
||
${({ theme: { fonts } }) => fonts.body_09} | ||
|
||
&:focus { | ||
background-color: ${({ theme: { colors } }) => colors.P_06}; | ||
color: ${({ theme: { colors } }) => colors.white}; | ||
border: none; | ||
outline: none; | ||
} | ||
`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
트러블슈팅 공유 넘 감사했습니다!!