Skip to content

Commit 1ff27ac

Browse files
authored
feat(mobile): 시간 선택 뷰 input을 구현합니다. (#72)
1 parent d703458 commit 1ff27ac

5 files changed

Lines changed: 66 additions & 30 deletions

File tree

.vscode/settings.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
}
66
],
77
"editor.codeActionsOnSave": {
8+
"quickfix.biome": "explicit",
89
"source.fixAll": "never",
910
// stylelint 자동 수정
1011
"source.fixAll.stylelint": "explicit",
@@ -15,5 +16,11 @@
1516
"source.organizeImports": "explicit"
1617
},
1718

18-
"stylelint.validate": ["css", "scss", "postcss", "typescript", "typescriptreact"]
19+
"stylelint.validate": [
20+
"css",
21+
"scss",
22+
"postcss",
23+
"typescript",
24+
"typescriptreact"
25+
]
1926
}

apps/mobile/app/select-date/layout.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ export default function layout({
66
children: React.ReactNode;
77
}>) {
88
return (
9-
<>
9+
<section>
1010
<SelectDateHeader />
11-
<div className="p-[2rem]">{children}</div>
12-
</>
11+
<div className="px-[2rem] py-[3rem]">{children}</div>
12+
</section>
1313
);
1414
}
Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
"use client";
2+
3+
import { TextField } from "@setaday/ui";
4+
import { useState } from "react";
5+
16
export default function page() {
2-
return <div>hi</div>;
7+
const PLACE_HOLDER = "약속 이름을 작성해주세요";
8+
const MAX_LENGTH = 16;
9+
10+
const [planName, setPlanName] = useState("");
11+
const [isInputError, setIsInputError] = useState(false);
12+
13+
const handleChangeInput = (e: React.ChangeEvent<HTMLInputElement>) => {
14+
const { value } = e.currentTarget;
15+
setPlanName(value);
16+
17+
value.length > MAX_LENGTH ? setIsInputError(true) : setIsInputError(false);
18+
};
19+
20+
return (
21+
<>
22+
<TextField
23+
inputSize="mobile"
24+
placeholder={PLACE_HOLDER}
25+
value={planName}
26+
isError={isInputError}
27+
maxLength={MAX_LENGTH}
28+
onChange={handleChangeInput}
29+
/>
30+
</>
31+
);
332
}

apps/mobile/components/select-date/SelectDateHeader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ function SelectDateHeader() {
1010
};
1111
return (
1212
<header className="border-gray-1 flex h-[5.2rem] w-[100dvw] items-center justify-between border-b-[1px] px-[0.9rem]">
13-
<button onClick={clickArrowBtn}>
13+
<button type="button" onClick={clickArrowBtn}>
1414
<MobileIconArrowLeftBlack />
1515
</button>
1616

1717
<h2 className="font-body3_m_16 text-gray-6">날짜 선택</h2>
1818

19-
<div className="h-[3.2rem] w-[3.2rem]"></div>
19+
<span className="h-[3.2rem] w-[3.2rem]" />
2020
</header>
2121
);
2222
}

pnpm-lock.yaml

Lines changed: 23 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)