-
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.
Browse files
Browse the repository at this point in the history
[feat/#33] 체크박스 컴포넌트 구현
- Loading branch information
Showing
33 changed files
with
646 additions
and
18 deletions.
There are no files selected for viewing
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,20 @@ | ||
import * as React from 'react'; | ||
import type { SVGProps } from 'react'; | ||
const SvgIcCheckbox = (props: SVGProps<SVGSVGElement>) => ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width={16} | ||
height={16} | ||
fill="none" | ||
{...props} | ||
> | ||
<path | ||
stroke="#fff" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth={2} | ||
d="m3 8 3.5 3.5L13 5" | ||
/> | ||
</svg> | ||
); | ||
export default SvgIcCheckbox; |
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,20 @@ | ||
import * as React from 'react'; | ||
import type { SVGProps } from 'react'; | ||
const SvgIcRightarrowMediumTextgray40 = (props: SVGProps<SVGSVGElement>) => ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width={20} | ||
height={20} | ||
fill="none" | ||
{...props} | ||
> | ||
<path | ||
stroke="#333" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth={1.5} | ||
d="m8 4 6 6-6 6" | ||
/> | ||
</svg> | ||
); | ||
export default SvgIcRightarrowMediumTextgray40; |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,3 +1,14 @@ | ||
export { default as BtnFFloating } from "./BtnFFloating"; | ||
export { default as BtnFloating } from "./BtnFloating"; | ||
export { default as Hihi } from "./Hihi"; | ||
export { default as IcRightarrowMediumTextgray40 } from './IcRightarrowMediumTextgray40'; | ||
export { default as Img61 } from './Img61'; | ||
export { default as Img62 } from './Img62'; | ||
export { default as Img63 } from './Img63'; | ||
export { default as Img64 } from './Img64'; | ||
export { default as Img65 } from './Img65'; | ||
export { default as Img66 } from './Img66'; | ||
export { default as Img67 } from './Img67'; | ||
export { default as Img68 } from './Img68'; | ||
export { default as Img69 } from './Img69'; | ||
export { default as BtnFFloating } from './BtnFFloating'; | ||
export { default as BtnFloating } from './BtnFloating'; | ||
export { default as Hihi } from './Hihi'; | ||
export { default as IcCheckbox } from './IcCheckbox'; |
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,20 @@ | ||
import styled from "@emotion/styled"; | ||
import theme from "@styles/theme"; | ||
|
||
interface StyledBtnProps { | ||
isChecked: boolean; | ||
} | ||
|
||
export const StyledBtn = styled.button<StyledBtnProps>` | ||
border-radius: 3px; | ||
border: ${({ isChecked }) => | ||
isChecked ? "none" : `1px solid ${theme.colors.stroke_gray50}`}; | ||
background-color: ${({ isChecked }) => | ||
isChecked ? theme.colors.purple50 : "none"}; | ||
width: 1.8rem; | ||
height: 1.8rem; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
transition: all 0.2s ease; | ||
`; |
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,19 @@ | ||
import { useState } from "react"; | ||
import SvgIcCheckbox from "@assets/svgs/IcCheckbox"; | ||
import * as S from "./Checkbox.styled"; | ||
|
||
const CheckboxBtn = () => { | ||
const [isChecked, setIsChecked] = useState(false); | ||
|
||
const handleClick = () => { | ||
setIsChecked((prev) => !prev); | ||
}; | ||
|
||
return ( | ||
<S.StyledBtn isChecked={isChecked} onClick={handleClick}> | ||
<SvgIcCheckbox /> | ||
</S.StyledBtn> | ||
); | ||
}; | ||
|
||
export default CheckboxBtn; |
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,52 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
export const Section6CardWrapper = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 3.5rem; | ||
padding: 7rem 0 10.5rem 16.8rem; | ||
`; | ||
|
||
export const Section6TitleLayout = styled.div` | ||
display: flex; | ||
align-items: center; | ||
gap: 0.8rem; | ||
`; | ||
|
||
export const Title = styled.h3` | ||
${({ theme }) => theme.fonts.head_b_24}; | ||
color: ${({ theme }) => theme.colors.text_gray40}; | ||
`; | ||
|
||
export const Section6CardLayout = styled.div` | ||
display: flex; | ||
align-items: center; | ||
gap: 1.1rem; | ||
overflow-x: scroll; | ||
scrollbar-width: none; | ||
& > div:last-child { | ||
padding-right: 16.8rem; | ||
} | ||
`; | ||
|
||
export const Section6CardContainer = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
position: relative; | ||
`; | ||
|
||
export const CardLabel = styled.p` | ||
${({ theme }) => theme.fonts.body1_b_15}; | ||
color: ${({ theme }) => theme.colors.text_gray40}; | ||
background-color: ${({ theme }) => theme.colors.tp_white50}; | ||
display: flex; | ||
align-items: center; | ||
width: 100%; | ||
height: 3.8rem; | ||
padding: 1rem 1.2rem; | ||
position: absolute; | ||
bottom: 0; | ||
border-bottom-left-radius: 1rem; | ||
border-bottom-right-radius: 1rem; | ||
`; |
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,95 @@ | ||
import { useRef } from 'react'; | ||
import * as S from './Section6Card.styled'; | ||
import { | ||
IcRightarrowMediumTextgray40, | ||
Img61, | ||
Img62, | ||
Img63, | ||
Img64, | ||
Img65, | ||
Img66, | ||
Img67, | ||
Img68, | ||
Img69, | ||
} from '@assets/svgs'; | ||
|
||
const Section6Card = () => { | ||
//무언가 수정 ~ | ||
const section6Scroll = useRef<HTMLDivElement>(null); | ||
|
||
const handleWheel = (e: React.WheelEvent) => { | ||
if (section6Scroll.current) { | ||
section6Scroll.current.scrollLeft += e.deltaY; | ||
} | ||
}; | ||
|
||
const cardData = [ | ||
{ | ||
id: 1, | ||
img: <Img61 style={{ flexShrink: 0, borderRadius: '1rem' }} />, | ||
label: '15pt 중고매장 FAQ', | ||
}, | ||
{ | ||
id: 2, | ||
img: <Img62 style={{ flexShrink: 0, borderRadius: '1rem' }} />, | ||
label: '책모양 오르골', | ||
}, | ||
{ | ||
id: 3, | ||
img: <Img63 style={{ flexShrink: 0, borderRadius: '1rem' }} />, | ||
label: '북슬리브', | ||
}, | ||
{ | ||
id: 4, | ||
img: <Img64 style={{ flexShrink: 0, borderRadius: '1rem' }} />, | ||
label: '퀄팅 북슬리브', | ||
}, | ||
{ | ||
id: 5, | ||
img: <Img65 style={{ flexShrink: 0, borderRadius: '1rem' }} />, | ||
label: '미니 토트백', | ||
}, | ||
{ | ||
id: 6, | ||
img: <Img66 style={{ flexShrink: 0, borderRadius: '1rem' }} />, | ||
label: '아크릴 스탠드', | ||
}, | ||
{ | ||
id: 7, | ||
img: <Img67 style={{ flexShrink: 0, borderRadius: '1rem' }} />, | ||
label: '데스크 매트', | ||
}, | ||
{ | ||
id: 8, | ||
img: <Img68 style={{ flexShrink: 0, borderRadius: '1rem' }} />, | ||
label: '아크릴 램프', | ||
}, | ||
{ | ||
id: 9, | ||
img: <Img69 style={{ flexShrink: 0, borderRadius: '1rem' }} />, | ||
label: '스틸 북엔드', | ||
}, | ||
]; | ||
|
||
return ( | ||
<> | ||
<S.Section6CardWrapper> | ||
<S.Section6TitleLayout> | ||
<S.Title>알라딘이 만든 사은품</S.Title> | ||
<IcRightarrowMediumTextgray40 /> | ||
<IcRightarrowMediumTextgray40 /> | ||
</S.Section6TitleLayout> | ||
<S.Section6CardLayout ref={section6Scroll} onWheel={handleWheel}> | ||
{cardData.map((card, id) => ( | ||
<S.Section6CardContainer key={id}> | ||
{card.img} | ||
<S.CardLabel>{card.label}</S.CardLabel> | ||
</S.Section6CardContainer> | ||
))} | ||
</S.Section6CardLayout> | ||
</S.Section6CardWrapper> | ||
</> | ||
); | ||
}; | ||
|
||
export default Section6Card; |
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