-
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.
Browse files
Browse the repository at this point in the history
[#3] step1 νμ΄μ§ ui λ° νμ΄μ§κ° μ΄λ ꡬν
- Loading branch information
Showing
21 changed files
with
398 additions
and
6 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
app/(route)/verification/ibulsin/_components/CancelBtn/index.module.css
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,7 @@ | ||
.cancel_btn { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 24px; | ||
height: 24px; | ||
} |
32 changes: 32 additions & 0 deletions
32
app/(route)/verification/ibulsin/_components/CancelBtn/index.tsx
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,32 @@ | ||
'use client' | ||
|
||
import React from 'react' | ||
import S from './index.module.css' | ||
import { MdChevronLeft } from 'react-icons/md' | ||
import { useRouter } from 'next/navigation' | ||
|
||
function CancelBtn() { | ||
const router = useRouter() | ||
|
||
const handleClickCancelBtn = () => { | ||
const verify = confirm( | ||
'μ λ§λ‘ μμ±μ κ·Έλ§νμκ² μ΅λκΉ? μμ±ν λ¬Ένλ€μ΄ μ¬λΌμ§λλ€.', | ||
) | ||
|
||
if (verify) { | ||
router.push('/') | ||
} | ||
} | ||
|
||
return ( | ||
<button | ||
className={S.cancel_btn} | ||
onClick={handleClickCancelBtn} | ||
type="button" | ||
> | ||
<MdChevronLeft size={20} /> | ||
</button> | ||
) | ||
} | ||
|
||
export default CancelBtn |
14 changes: 14 additions & 0 deletions
14
app/(route)/verification/ibulsin/_components/PaginationBtn/index.module.css
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,14 @@ | ||
.btn { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
border-radius: 999px; | ||
background-color: #B9CCFF; | ||
color:#939BFF; | ||
width:30px; | ||
height:30px | ||
} | ||
.darken { | ||
color: #6C76F4; | ||
background-color: #FFFFFF; | ||
} |
24 changes: 24 additions & 0 deletions
24
app/(route)/verification/ibulsin/_components/PaginationBtn/index.tsx
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,24 @@ | ||
import React from 'react' | ||
import S from './index.module.css' | ||
import cn from 'classnames' | ||
import { useSearchParams } from 'next/navigation' | ||
import Link from 'next/link' | ||
|
||
function PaginationBtn({ step }: { step: number }) { | ||
const params = useSearchParams() | ||
|
||
const stepParam = params.get('step') | ||
|
||
return ( | ||
<Link | ||
className={cn(S.btn, { | ||
[S.darken]: stepParam && parseInt(stepParam) === step, | ||
})} | ||
href={`/verification/ibulsin?step=${step}`} | ||
> | ||
{step} | ||
</Link> | ||
) | ||
} | ||
|
||
export default PaginationBtn |
18 changes: 18 additions & 0 deletions
18
app/(route)/verification/ibulsin/_components/Step/index.module.css
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,18 @@ | ||
.main_container { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
background-color: var(--purple-700); | ||
min-height: 100vh; | ||
} | ||
.main_container > .survey_header { | ||
display: flex; | ||
width: 100%; | ||
padding: 12px; | ||
align-items: center; | ||
justify-content: space-between; | ||
} | ||
.main_container > .survey_header > .fake { | ||
width: 24px; | ||
height: 24px; | ||
} |
31 changes: 31 additions & 0 deletions
31
app/(route)/verification/ibulsin/_components/Step/index.tsx
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,31 @@ | ||
'use client' | ||
|
||
import React from 'react' | ||
import S from './index.module.css' | ||
import { useSearchParams } from 'next/navigation' | ||
import Step1 from '../Step1' | ||
import Step2 from '../Step2' | ||
import Step3 from '../Step3' | ||
import StepPagination from '../StepPagination' | ||
import CancelBtn from '../CancelBtn' | ||
|
||
function Step() { | ||
const params = useSearchParams() | ||
|
||
const stepParam = params.get('step') | ||
|
||
return ( | ||
<div className={S.main_container}> | ||
<div className={S.survey_header}> | ||
<CancelBtn /> | ||
<StepPagination /> | ||
<div className={S.fake}></div> | ||
</div> | ||
{stepParam === '1' && <Step1 />} | ||
{stepParam === '2' && <Step2 />} | ||
{stepParam === '3' && <Step3 />} | ||
</div> | ||
) | ||
} | ||
|
||
export default Step |
56 changes: 56 additions & 0 deletions
56
app/(route)/verification/ibulsin/_components/Step1/index.module.css
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,56 @@ | ||
.main_container { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
} | ||
.step_info { | ||
color: #FFFFFF; | ||
margin: 24px; | ||
margin-bottom: 32px; | ||
} | ||
.step_info > h3 { | ||
padding: 12px 0; | ||
font-weight: 500; | ||
font-size: 24px; | ||
} | ||
.step_info > p { | ||
font-size: 24px; | ||
} | ||
.survey_container { | ||
background-color: #FFFFFF; | ||
border-top-left-radius: 8px; | ||
border-top-right-radius: 8px; | ||
padding: 12px; | ||
} | ||
.input_container { | ||
margin-bottom: 8px; | ||
} | ||
.input_container > .input_title { | ||
font-size: 16px; | ||
padding:12px 0; | ||
} | ||
.input_container > .input_explain { | ||
font-size: 12px; | ||
margin-bottom: 8px; | ||
} | ||
.input_container > .input_textarea { | ||
font-size: 14px; | ||
width: 100%; | ||
height: 100px; | ||
resize: none; | ||
border: 1px solid #9d9d9d; | ||
border-radius: 4px; | ||
} | ||
.direction_btns { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
.next_btn { | ||
background-color: var(--purple-700); | ||
color: #FFFFFF; | ||
padding: 12px 20px; | ||
font-size: 14px; | ||
font-weight: bold; | ||
border-radius: 8px; | ||
} |
48 changes: 48 additions & 0 deletions
48
app/(route)/verification/ibulsin/_components/Step1/index.tsx
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,48 @@ | ||
'use client' | ||
|
||
import React from 'react' | ||
import style from './index.module.css' | ||
import Link from 'next/link' | ||
import Textarea from '../Textarea' | ||
|
||
function Step1() { | ||
return ( | ||
<div className={style.main_container}> | ||
<div className={style.step_info}> | ||
<h3 className={style.step}>STEP 1</h3> | ||
<p className={style.step_explain}> | ||
μκ°ν μμ΄λμ΄λ₯Ό | ||
<br /> | ||
μμ±ν΄μ£ΌμΈμ | ||
</p> | ||
</div> | ||
<div className={style.survey_container}> | ||
<div className={style.input_container}> | ||
<h3 className={style.input_title}>μμ΄λμ΄ κ°μ</h3> | ||
<p className={style.input_explain}> | ||
μκ°ν μμ΄λμ΄λ₯Ό μμ λ‘κ² μμ±ν΄λ΄μ! μ΄κ³³μμλ μ€λ‘μ§ | ||
μμ΄λμ΄μλ§ μ§μ€ν΄μ. | ||
</p> | ||
<Textarea fieldKey={'outline'} /> | ||
</div> | ||
<div className={style.input_container}> | ||
<h3 className={style.input_title}>μκ°νκ² λ λ°°κ²½</h3> | ||
<p className={style.input_explain}> | ||
ν΄λΉ μμ΄λμ΄λ₯Ό μ΄λ»κ² μκ°νκ² λμλμ? | ||
</p> | ||
<Textarea fieldKey={'why'} /> | ||
</div> | ||
<div className={style.direction_btns}> | ||
<Link | ||
className={style.next_btn} | ||
href={'/verification/ibulsin?step=2'} | ||
> | ||
λ€μ λ¨κ³ | ||
</Link> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default Step1 |
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
app/(route)/verification/ibulsin/_components/Step2/index.tsx
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,10 @@ | ||
'use client' | ||
|
||
import React from 'react' | ||
import S from './index.module.css' | ||
|
||
function Step2() { | ||
return <div className={S.main}>hello</div> | ||
} | ||
|
||
export default Step2 |
Empty file.
10 changes: 10 additions & 0 deletions
10
app/(route)/verification/ibulsin/_components/Step3/index.tsx
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,10 @@ | ||
'use client' | ||
|
||
import React from 'react' | ||
import S from './index.module.css' | ||
|
||
function Step3() { | ||
return <div className={S.main}>hello</div> | ||
} | ||
|
||
export default Step3 |
6 changes: 6 additions & 0 deletions
6
app/(route)/verification/ibulsin/_components/StepPagination/index.module.css
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 @@ | ||
.step_pagination_container { | ||
display: flex; | ||
} | ||
.step_pagination_container > * { | ||
margin: 0 12px; | ||
} |
15 changes: 15 additions & 0 deletions
15
app/(route)/verification/ibulsin/_components/StepPagination/index.tsx
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,15 @@ | ||
import React from 'react' | ||
import S from './index.module.css' | ||
import PaginationBtn from '../PaginationBtn' | ||
|
||
function StepPagination() { | ||
return ( | ||
<div className={S.step_pagination_container}> | ||
{Array.from({ length: 3 }, (_, idx) => ( | ||
<PaginationBtn key={idx} step={idx + 1} /> | ||
))} | ||
</div> | ||
) | ||
} | ||
|
||
export default StepPagination |
26 changes: 26 additions & 0 deletions
26
app/(route)/verification/ibulsin/_components/Textarea/index.module.css
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,26 @@ | ||
.textarea_container { | ||
position: relative; | ||
padding: 12px; | ||
padding-bottom: 28px; | ||
border: 1px solid #ccc; | ||
border-radius: 8px; | ||
} | ||
.textarea_container:focus-within { | ||
border: 1px solid #000000; | ||
} | ||
.textarea_container > textarea { | ||
width: 100%; | ||
height: 80px; | ||
border:none; | ||
outline: none; | ||
resize: none; | ||
} | ||
.letter_count_container { | ||
position: absolute; | ||
font-size: 12px; | ||
bottom: 8px; | ||
right: 8px; | ||
} | ||
.letter_max { | ||
color: rgba(255, 0, 0, 0.8); | ||
} |
62 changes: 62 additions & 0 deletions
62
app/(route)/verification/ibulsin/_components/Textarea/index.tsx
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,62 @@ | ||
'use client' | ||
|
||
import React from 'react' | ||
import S from './index.module.css' | ||
import cn from 'classnames' | ||
import { useForm } from 'react-hook-form' | ||
|
||
interface TextAreaProps { | ||
fieldKey: 'outline' | 'why' | ||
} | ||
|
||
function Textarea({ fieldKey }: TextAreaProps) { | ||
const { register, watch } = useForm() | ||
|
||
const outlineField = register('outline', { | ||
required: '', | ||
maxLength: { value: 500, message: 'μ΅λ 500μκΉμ§ μμ±κ°λ₯ν©λλ€.' }, | ||
}) | ||
const whyField = register('whyField', { | ||
required: '', | ||
maxLength: { value: 500, message: 'μ΅λ 500μκΉμ§ μμ±κ°λ₯ν©λλ€.' }, | ||
}) | ||
const fields = { | ||
outline: { | ||
register: outlineField, | ||
MaxLength: 500, | ||
}, | ||
why: { | ||
register: whyField, | ||
MaxLength: 500, | ||
}, | ||
} | ||
|
||
const countCharacters = () => { | ||
const content = watch(fieldKey) | ||
if (!content) { | ||
return 0 | ||
} | ||
return content.length | ||
} | ||
|
||
return ( | ||
<div className={S.textarea_container}> | ||
<textarea | ||
{...fields[fieldKey].register} | ||
maxLength={fields[fieldKey].MaxLength - 1} | ||
/> | ||
<div className={S.letter_count_container}> | ||
<span | ||
className={cn({ | ||
[S.letter_max]: countCharacters() >= fields[fieldKey].MaxLength, | ||
})} | ||
> | ||
{countCharacters()} | ||
</span> | ||
<span>{`/${fields[fieldKey].MaxLength}`}</span> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default Textarea |
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,14 @@ | ||
import React, { Suspense } from 'react' | ||
import Step from './_components/Step' | ||
|
||
function page() { | ||
return ( | ||
<div> | ||
<Suspense fallback={<div>loading...</div>}> | ||
<Step /> | ||
</Suspense> | ||
</div> | ||
) | ||
} | ||
|
||
export default page |
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,3 @@ | ||
declare module '*.css' | ||
|
||
declare module '*.sass' | ||
declare module '*.sass' |
Oops, something went wrong.