-
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
[#7][#23] step3 ํ์ด์ง ui ๋ฐ ์ถ๊ฐ์ค๋ช ํ ๊ธ์ฐฝ ๊ตฌํ / ์ ๊ทน์ ํฌ์์งํ ์ปดํฌ๋ํธ ๊ตฌํ
- Loading branch information
Showing
12 changed files
with
415 additions
and
28 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
app/(route)/verification/ibulsin/_components/ActiveInvestmentItem/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,44 @@ | ||
.item_container { | ||
display: flex; | ||
/* justify-content: space-between; */ | ||
justify-content: center; | ||
margin-bottom: 8px; | ||
} | ||
.item_input_wrapper { | ||
display: flex; | ||
} | ||
.input { | ||
all: unset; | ||
font-size: 12px; | ||
padding: 8px; | ||
border: 1px solid #CDCDCD; | ||
border-radius: 4px; | ||
} | ||
.item_name_input { | ||
width: 100px; | ||
margin-right: 16px; | ||
} | ||
.score_container { | ||
margin-right: 16px; | ||
} | ||
.score_container > span { | ||
font-size: 14px; | ||
font-weight: bold; | ||
} | ||
.item_score_input { | ||
width: 40px; | ||
margin-right: 4px; | ||
} | ||
.delete_btn { | ||
padding: 4px 8px; | ||
background-color: rgb(248, 64, 64); | ||
color: #ffffff; | ||
font-size: 12px; | ||
border-radius: 8px; | ||
} | ||
|
||
.input::-webkit-outer-spin-button, | ||
.input::-webkit-inner-spin-button { | ||
-webkit-appearance: none; | ||
margin: 0; | ||
} |
86 changes: 86 additions & 0 deletions
86
app/(route)/verification/ibulsin/_components/ActiveInvestmentItem/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,86 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
'use client' | ||
|
||
import React, { useState } from 'react' | ||
import S from './index.module.css' | ||
import cn from 'classnames' | ||
import { useRecoilState } from 'recoil' | ||
import investmentItemAtom, { ActiveInvestmentItemType } from '@/app/_store/atom' | ||
|
||
interface ActiveInvestmentItemProps { | ||
item: ActiveInvestmentItemType | ||
} | ||
|
||
function ActiveInvestmentItem({ item }: ActiveInvestmentItemProps) { | ||
const [investmentItem, setInvestmentItem] = useRecoilState(investmentItemAtom) | ||
const [itemName, setItemName] = useState(item?.name ?? '') | ||
const [itemScore, setItemScore] = useState(item?.score ?? 0) | ||
|
||
const handleDeleteItem = () => { | ||
if (investmentItem.length <= 1) { | ||
return | ||
} | ||
|
||
setInvestmentItem((prev) => { | ||
const next = prev.filter( | ||
(investmentItem) => investmentItem.id !== item.id, | ||
) | ||
console.log(next) | ||
|
||
return next | ||
}) | ||
} | ||
|
||
const handleChangeNameInput = (e: any) => { | ||
const { value } = e.target | ||
setItemName(value) | ||
|
||
setInvestmentItem((prev) => | ||
prev.map((investmentItem) => | ||
investmentItem.id === item.id | ||
? { ...item, name: value } | ||
: investmentItem, | ||
), | ||
) | ||
} | ||
const handleChangeScoreInput = (e: any) => { | ||
const { value } = e.target | ||
setItemScore(value) | ||
|
||
setInvestmentItem((prev) => | ||
prev.map((investmentItem) => | ||
investmentItem.id === item.id | ||
? { ...item, name: value } | ||
: investmentItem, | ||
), | ||
) | ||
} | ||
|
||
return ( | ||
<div className={S.item_container}> | ||
<div className={S.item_input_wrapper}> | ||
<input | ||
className={cn(S.item_name_input, S.input)} | ||
placeholder="์์ดํ 1" | ||
value={itemName} | ||
onChange={(e) => handleChangeNameInput(e)} | ||
/> | ||
<div className={S.score_container}> | ||
<input | ||
className={cn(S.item_score_input, S.input)} | ||
type="number" | ||
placeholder="2" | ||
value={itemScore} | ||
onChange={(e) => handleChangeScoreInput(e)} | ||
/> | ||
<span>์ </span> | ||
</div> | ||
</div> | ||
<button className={S.delete_btn} onClick={handleDeleteItem}> | ||
์ญ์ | ||
</button> | ||
</div> | ||
) | ||
} | ||
|
||
export default ActiveInvestmentItem |
Empty file.
21 changes: 21 additions & 0 deletions
21
app/(route)/verification/ibulsin/_components/ActiveInvestmentList/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,21 @@ | ||
'use client' | ||
|
||
import React from 'react' | ||
import S from './index.module.css' | ||
import ActiveInvestmentItem from '../ActiveInvestmentItem' | ||
import { useRecoilValue } from 'recoil' | ||
import investmentItemAtom from '@/app/_store/atom' | ||
|
||
function ActiveInvestmentList() { | ||
const investmentItem = useRecoilValue(investmentItemAtom) | ||
|
||
return ( | ||
<div className={S.main}> | ||
{investmentItem.map((item) => { | ||
return <ActiveInvestmentItem key={item.id} item={item} /> | ||
})} | ||
</div> | ||
) | ||
} | ||
|
||
export default ActiveInvestmentList |
8 changes: 8 additions & 0 deletions
8
app/(route)/verification/ibulsin/_components/ItemAddBtn/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,8 @@ | ||
.btn { | ||
font-size: 12px; | ||
background-color: var(--purple-700); | ||
color: #FFFFFF; | ||
border-radius: 4px; | ||
padding: 4px 8px; | ||
height: 20px; | ||
} |
27 changes: 27 additions & 0 deletions
27
app/(route)/verification/ibulsin/_components/ItemAddBtn/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,27 @@ | ||
'use client' | ||
|
||
import React from 'react' | ||
import S from './index.module.css' | ||
import { useSetRecoilState } from 'recoil' | ||
import investmentItemAtom, { ActiveInvestmentItemType } from '@/app/_store/atom' | ||
|
||
function ItemAddBtn() { | ||
const setInvestmentItem = useSetRecoilState(investmentItemAtom) | ||
|
||
const handleAddItem = () => { | ||
const newItem: ActiveInvestmentItemType = { | ||
id: new Date().toISOString(), | ||
name: '', | ||
score: 0, | ||
} | ||
setInvestmentItem((prev) => [...prev, newItem]) | ||
} | ||
|
||
return ( | ||
<button type="button" className={S.btn} onClick={handleAddItem}> | ||
์ถ๊ฐ | ||
</button> | ||
) | ||
} | ||
|
||
export default ItemAddBtn |
33 changes: 8 additions & 25 deletions
33
app/(route)/verification/ibulsin/_components/MoreExplainToggle/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
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,73 @@ | ||
.main_container { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
} | ||
.flex_between_wrapper { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
} | ||
.flex_wrapper { | ||
display: flex; | ||
align-items: center; | ||
} | ||
.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_title_container { | ||
display: flex; | ||
align-items: center; | ||
} | ||
.input_title { | ||
font-size: 16px; | ||
padding:12px 0; | ||
margin-right: 8px; | ||
} | ||
.input_explain { | ||
font-size: 12px; | ||
margin-bottom: 8px; | ||
} | ||
.direction_btns { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
.direction_btns > a { | ||
margin: 0 8px; | ||
} | ||
.prev_btn { | ||
background-color: #FFFFFF; | ||
padding: 12px 20px; | ||
font-size: 14px; | ||
font-weight: bold; | ||
border: 1px solid #DCDCDC; | ||
border-radius: 8px; | ||
} | ||
.next_btn { | ||
background-color: var(--purple-700); | ||
color: #FFFFFF; | ||
padding: 12px 20px; | ||
font-size: 14px; | ||
font-weight: bold; | ||
border-radius: 8px; | ||
} |
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
Oops, something went wrong.