-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #144 from team-offonoff/fix/login-flow
chore: add pr template
- Loading branch information
Showing
19 changed files
with
403 additions
and
168 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import styled from 'styled-components'; | ||
|
||
import { CheckIcon } from '@icons/index'; | ||
|
||
import { Row } from '../Flex/Flex'; | ||
import Text from '../Text/Text'; | ||
|
||
interface CheckboxProps { | ||
id: string; | ||
checked: boolean; | ||
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void; | ||
children: React.ReactNode; | ||
} | ||
|
||
function Checkbox({ id, checked, onChange, children }: CheckboxProps) { | ||
return ( | ||
<Row alignItems="center" gap={16}> | ||
<CheckBoxLabel checked={checked} htmlFor={id}> | ||
<HiddenCheckbox id={id} type="checkbox" onChange={onChange} checked={checked} /> | ||
{checked && <CheckIcon width="14px" height="14px" />} | ||
</CheckBoxLabel> | ||
<label htmlFor={id} style={{ userSelect: 'none' }}> | ||
{children} | ||
</label> | ||
</Row> | ||
); | ||
} | ||
|
||
export default Checkbox; | ||
|
||
const CheckBoxLabel = styled.label<{ checked: boolean }>` | ||
position: relative; | ||
display: inline-block; | ||
width: 22px; | ||
height: 22px; | ||
cursor: pointer; | ||
background: ${({ checked, theme }) => | ||
checked ? `${theme.colors.purple}` : 'rgb(77 59 124 / 20%)'}; | ||
border-radius: 3px; | ||
& > svg { | ||
position: absolute; | ||
top: 3px; | ||
left: 3.5px; | ||
} | ||
`; | ||
|
||
const HiddenCheckbox = styled.input` | ||
position: absolute; | ||
width: 1px; | ||
height: 1px; | ||
padding: 0; | ||
margin: 0; | ||
overflow: hidden; | ||
clip: rect(0 0 0 0); | ||
white-space: nowrap; | ||
border: 0; | ||
`; |
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,6 @@ | ||
export interface User { | ||
memberId: number; | ||
nickname?: string; | ||
accessToken?: string; | ||
refrehToken?: string; | ||
} |
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
File renamed without changes.
Oops, something went wrong.