Skip to content

Commit

Permalink
[#23] 적극적 투자지표 추가버튼
Browse files Browse the repository at this point in the history
  • Loading branch information
03hoho03 committed Apr 7, 2024
1 parent 8996a2a commit da7c629
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
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 app/(route)/verification/ibulsin/_components/ItemAddBtn/index.tsx
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

0 comments on commit da7c629

Please sign in to comment.