Skip to content

Commit 0494edd

Browse files
committed
feat: 랜덤 닉네임 생성 #46
1 parent 561c10a commit 0494edd

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

frontend/src/pages/NicknamePage/NicknamePage.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
import { profile, nickname, nicknameInputWrapper, nicknameInput } from './NicknamePage.styled';
22

33
import Content from '@/components/layout/Content/Content';
4+
import { createRandomNickname } from '@/utils/nickname';
45

56
const NicknamePage = () => {
7+
const randomNickname = createRandomNickname();
8+
69
return (
710
<Content>
811
<div css={profile}></div>
912
<div css={nickname}>닉네임</div>
1013
<div css={nicknameInputWrapper}>
11-
<input css={nicknameInput} type="text" placeholder="닉네임을 입력해 주세요" />
14+
<input css={nicknameInput} type="text" placeholder={randomNickname} />
1215
</div>
1316
</Content>
1417
);

frontend/src/utils/.gitkeep

Whitespace-only changes.

frontend/src/utils/nickname.ts

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export const createRandomNickname = () => {
2+
const adjectives = ['배고픈', '성실한', '욕망의', '섹시한', '멋있는', '타락한'];
3+
const nouns = ['마루', '썬데이', '프린', '이든', '포메', '타칸', '커찬'];
4+
5+
const randomAdjective = adjectives[Math.floor(Math.random() * adjectives.length)];
6+
const randomNoun = nouns[Math.floor(Math.random() * nouns.length)];
7+
8+
return `${randomAdjective} ${randomNoun}`;
9+
};

0 commit comments

Comments
 (0)