Skip to content
This repository was archived by the owner on Jul 21, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/app/organisms/identityVerification/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
import React, { useState } from 'react';
import { Provider } from 'jotai'
import Box from "../../atoms/Box";
import UserInformation from './userInformation';
import Verification from './verification';
import UserInformation from './userInformation/userInformation';
import Verification from './verification/verification';

import { flexColumnCentering } from "@/app/styles/flex";

export default function IdentityVerification(){
const [state, setState] = useState<string>("profileEdit")
const [state, setState] = useState<string>("auth")
const handleComponent = () => {
switch (state) {
case 'profileEdit':
return <UserInformation/>;
return <Verification/>;
case 'auth':
return <Verification/>;
return <UserInformation/>;

}
}
return(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { atom } from "jotai";


export const userNameAtom = atom("");
export const genderAtom = atom("");
export const nickNameAtom = atom("");
export const birthAtom = atom("");

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

144 changes: 0 additions & 144 deletions src/app/organisms/identityVerification/userInformation/index.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
// userInformation/useUserInformation.ts

import { useAtom } from "jotai";
import { userNameAtom, nickNameAtom, birthAtom } from './JAtoms';
import { nickNameAtom, genderAtom, birthAtom } from './JAtoms';

export default function useUserInformation() {
const [userName, setUserName] = useAtom(userNameAtom);
const handleNameChange = (event: React.ChangeEvent<HTMLInputElement>) => {
setUserName(event.target.value);
};

const [nickName, setNickName] = useAtom(nickNameAtom);
const handleNickNameChange = (event: React.ChangeEvent<HTMLInputElement>) => {
Expand All @@ -24,10 +20,28 @@ export default function useUserInformation() {
}
}
};

const [, setGender] = useAtom(genderAtom);
const handleGenderChange = (newGender: 'male' | 'female') => {
setGender(newGender);
};
const adjectives = ["심심한", "열심히하는", "유능한", "창조적인", "재미있는"];
const nouns = ["사과", "사자", "컴퓨터", "공학자", "음악가"];
function generateRandomNickname() {
const randomAdjective = adjectives[Math.floor(Math.random() * adjectives.length)];
const randomNoun = nouns[Math.floor(Math.random() * nouns.length)];
const randomNumber = Math.floor(Math.random() * 100) + 1; // 1 ~ 100 사이의 랜덤 정수

return `${randomAdjective} ${randomNoun}${randomNumber}`;
}
function handleRandomNickNameChange(){
setNickName(generateRandomNickname());
}
return{
handleNameChange,

handleNickNameChange,
handleBirthChange,
handleGenderChange,
generateRandomNickname,
handleRandomNickNameChange,
}
}
Loading