Skip to content

Commit

Permalink
fix: 개인정보 동의 토글이 제대로 동작하지 않는 문제(#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
loopy-lim authored Mar 3, 2024
2 parents d03376c + ce07cef commit 6cb8350
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import type {
ApplicationQuestion,
ApplicationRadioForCheck,
} from "@/src/constants/application/type";
import { useLocalStorage } from "@/src/hooks/useLocalstorage.hook";
import { cn } from "@/src/utils/cn";
import Link from "next/link";
import { ChangeEvent } from "react";
import { useLocalStorage } from "@uidotdev/usehooks";

interface RadioCellProps {
applicationQuestion: ApplicationQuestion;
Expand All @@ -20,6 +21,11 @@ const RadioCell = ({
radioForCheckData.name,
"동의하지 않습니다."
);

const onSelectRadio = (e: ChangeEvent<HTMLInputElement>) => {
setRadio(e.target.value);
};

return (
<div className="flex-1">
<Link
Expand All @@ -46,9 +52,7 @@ const RadioCell = ({
id={radioForCheckData.name + radioForCheckData.value[0]}
checked={radio === radioForCheckData.value[0]}
value={radioForCheckData.value[0]}
onChange={(e) => {
setRadio(e.target.value);
}}
onChange={onSelectRadio}
/>
<label
className="mr-4"
Expand All @@ -63,9 +67,7 @@ const RadioCell = ({
id={radioForCheckData.name + radioForCheckData.value[1]}
checked={radio === radioForCheckData.value[1]}
value={radioForCheckData.value[1]}
onChange={(e) => {
setRadio(e.target.value);
}}
onChange={onSelectRadio}
/>
<label
className="mr-4"
Expand Down
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@types/react-modal": "^3.16.0",
"@typescript-eslint/eslint-plugin": "^6.3.0",
"@typescript-eslint/parser": "^6.3.0",
"@uidotdev/usehooks": "^2.4.1",
"autoprefixer": "10.4.14",
"axios": "^1.4.0",
"clsx": "^2.1.0",
Expand Down
15 changes: 15 additions & 0 deletions frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6cb8350

Please sign in to comment.