Skip to content

Commit

Permalink
feat : 제출 함수 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
guesung committed Jul 11, 2023
1 parent 6cf9349 commit 0025a24
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion app/join/step5/InputForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useState } from 'react';
import Button from '@/components/common/Button';
import PersonalityItem from '@/components/join/PersonalityItem';
import { personalityList } from '@/constants/personalityList';
import useJoin from '@/store/useJoin';

export default function InputForm() {
const [selectedPersonalityList, setSelectedPersonalityList] = useState<number[]>([]);
Expand All @@ -16,6 +17,12 @@ export default function InputForm() {
setSelectedPersonalityList([...selectedPersonalityList, id]);
};

const { phoneNumber, school, email, name, birth, gender } = useJoin();

const handleSubmit = () => {
console.log(phoneNumber, school, email, name, birth, gender, selectedPersonalityList);
};

return (
<div>
<section className="flex flex-wrap gap-12">
Expand All @@ -32,7 +39,11 @@ export default function InputForm() {
</section>

<section className="absolute bottom-0 w-full">
<Button text="완료" disabled={selectedPersonalityList.length === 0} href="/login" />
<Button
text="완료"
disabled={selectedPersonalityList.length === 0}
onClick={handleSubmit}
/>
</section>
</div>
);
Expand Down

0 comments on commit 0025a24

Please sign in to comment.