Skip to content

Commit

Permalink
fix : 토글 버튼 반대로 작동하는 현상 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Yujin-Baek committed Nov 26, 2023
1 parent 7f14769 commit 441fa31
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions frontend/src/components/recruitment/main/ToggleButton.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
import { useEffect, useState } from 'react'
import { useRecoilState } from 'recoil'
import { recruitfilterState } from '../../../utils/atoms'
import '../../../../public/css/toggle-button.css'

export default function ToggleButton() {
const [recruitFilter, setRecruitFilter] = useRecoilState(recruitfilterState)
const [recruiting, setRecruiting] = useState<boolean>(false)

const handleToggle = () => {
setRecruiting(!recruiting)
setRecruitFilter(!recruitFilter)
}

useEffect(() => {
// if (recruitFilter === true) {
// handleToggle()
// }
}, [])

return (
<label className="switch">
<input type="checkbox" checked={recruiting} onChange={handleToggle} />
<input type="checkbox" checked={recruitFilter} onChange={handleToggle} />
<span className="slider round"> </span>
</label>
)
Expand Down

0 comments on commit 441fa31

Please sign in to comment.