Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/signup #4

Merged
merged 23 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
237afb9
remove: css νŒŒμΌμ„ page.tsx와 같은 κ²½λ‘œμ— λ„£κΈ°
Jetom88 Oct 17, 2024
e988717
remove: css 파일 μœ„μΉ˜ 변경에 λ”°λ₯Έ 경둜 μˆ˜μ •
Jetom88 Oct 17, 2024
424aa5d
feat: pink80 색상 μΆ”κ°€
Jetom88 Oct 17, 2024
c128a02
feat: νšŒμ›κ°€μž… page μΆ”κ°€
Jetom88 Oct 17, 2024
62bc440
feat: λ‹‰λ„€μž„ ui μΆ”κ°€
Jetom88 Oct 17, 2024
81c5f15
feat: zod, react-hook-form 라이브러리 μΆ”κ°€, schema μΆ”κ°€
Jetom88 Oct 19, 2024
ea5b9da
feat: νšŒμ›κ°€μž… μœ νš¨μ„± 검사 둜직 μΆ”κ°€ 및 λ‘œμ»¬μŠ€ν† λ¦¬μ§€μ— μ €μž₯
Jetom88 Oct 20, 2024
c483e05
feat: 둜그인 νŽ˜μ΄μ§€ κ΅¬ν˜„
Jetom88 Oct 20, 2024
86bc210
feat: 둜그인 정보 둜컬 μŠ€ν† λ¦¬μ§€μ— μ €μž₯
Jetom88 Oct 20, 2024
7474f5d
feat: my νŽ˜μ΄μ§€ ν•œμ€„ λͺ©ν‘œ λ‘œμ»¬μŠ€ν† λ¦¬μ§€μ— μ €μž₯
Jetom88 Oct 20, 2024
673dcf4
fix: μ•„μ΄λ””λ‚˜ λΉ„λ°€λ²ˆν˜Έκ°€ μΌμΉ˜ν•˜μ§€ μ•Šμ„λ•Œ νŒμ—… 보이게 둜직 μˆ˜μ •
Jetom88 Oct 21, 2024
0d65aa4
review: sonarCloudμ—μ„œ λ‚˜νƒ€λ‚œ μ»΄ν¬λ„ŒνŠΈμ—μ„œ λŒ€λ¬Έμžλ‘œ μ‹œμž‘ν•΄μ•Όν•œλ‹€λŠ” κ·œμΉ™ μˆ˜μ • 및 span을 button으둜 μˆ˜μ •
Jetom88 Oct 22, 2024
5097967
review: λ‘œμ»¬μŠ€ν† λ¦¬μ§€ 관리λ₯Ό νƒ€μž…μœΌλ‘œ ν™œμš©
Jetom88 Oct 22, 2024
9d2e294
review: λ†“μΉœ localStorage 둜직 μΆ”κ°€
Jetom88 Oct 22, 2024
b57c4ac
review: login pageλ₯Ό κΈ°λŠ₯κ³Ό λ ˆμ΄μ•„μ›ƒμœΌλ‘œ μ½”λ“œ λΆ„ν• 
Jetom88 Oct 24, 2024
60783b4
review: zodλ₯Ό μ‚¬μš©ν•΄μ„œ text propsλ₯Ό nullable νƒ€μž…μœΌλ‘œ μˆ˜μ •
Jetom88 Oct 26, 2024
60cd215
review: immer 라이브러리λ₯Ό ν™œμš©ν•΄ λΆˆλ³€μ„± 관리 및 μƒνƒœ 볡사 μž‘μ—… μ€„μž„
Jetom88 Oct 26, 2024
ff71deb
feat: immer 라이브러리 μΆ”κ°€
Jetom88 Oct 26, 2024
686f08f
review: λΆˆν•„μš”ν•œ 주석 제거
Jetom88 Oct 26, 2024
e1951ee
fix: ν•„μš”ν•œ state만 μ‚¬μš©ν•΄ λ¦¬λ Œλ”λ§μ„ μ΅œμ†Œν™” ν•˜λŠ” 둜직 μΆ”κ°€
Jetom88 Oct 26, 2024
760df72
review: 보호ꡬ문으둜 λ¦¬νŒ©ν† λ§
Jetom88 Oct 26, 2024
18f1511
review: zustandλ₯Ό atomic νŒ¨ν„΄μœΌλ‘œ λ§Œλ“€κΈ° μœ„ν•΄ λ³€μˆ˜λͺ… μˆ˜μ •
Jetom88 Oct 26, 2024
128f8fb
review: localStorage의 get,set,removeλ₯Ό class ν˜•μ‹μœΌλ‘œ λ°”κΎΌ ν›„ 적용
Jetom88 Oct 26, 2024
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
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@
"lint": "next lint"
},
"dependencies": {
"@hookform/resolvers": "^3.9.0",
"@vanilla-extract/css": "^1.15.3",
"@vanilla-extract/sprinkles": "^1.6.3",
"classnames": "^2.5.1",
"next": "14.2.5",
"react": "^18",
"react-dom": "^18",
"react-hook-form": "^7.53.1",
"zod": "^3.23.8",
"zustand": "^4.5.5"
},
"devDependencies": {
Expand Down
33 changes: 33 additions & 0 deletions pnpm-lock.yaml

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

164 changes: 164 additions & 0 deletions src/app/auth/signup/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
"use client";

import { flexSprinklesFc } from "@/app/components/common/utils/flex";
import { signupContainer, signupWrapper } from "./signup.css";
import { inputStyle } from "@/app/styles/common/input.css";
import { caption, heading2, regular, semiBold } from "@/app/styles/font.css";
import { paddingSprinkles } from "@/app/styles/padding.css";
import { colors, pink80 } from "@/app/styles/colors.css";
import Image from "next/image";
import { pointer } from "@/app/styles/global.css";
import { useRouter } from "next/navigation";
import Button from "@/app/components/common/Button";
import { useForm } from "react-hook-form";
import { signupSchema } from "@/app/types/signupSchema";
import { z } from "zod";
import { zodResolver } from "@hookform/resolvers/zod";
import { useState } from "react";
import Popup from "@/app/components/common/Popup";
import { localStorageSetItem } from "@/app/types/localStorageSchema";

const Page = () => {
const router = useRouter();
const [submit, setSubmit] = useState(false);

const {
register,
handleSubmit,
formState: { errors, isValid },
} = useForm<z.infer<typeof signupSchema>>({
resolver: zodResolver(signupSchema),
mode: "onChange",
defaultValues: {
id: "",
password: "",
confirmPassword: "",
nickname: "",
},
});

const onSubmit = (data: z.infer<typeof signupSchema>) => {
if (data) {
setSubmit(true);
localStorageSetItem("signup", data);
}
};

return (
<>
{submit && (
<Popup text="νšŒμ›κ°€μž…μ΄ μ™„λ£Œλ˜μ—ˆμŠ΅λ‹ˆλ‹€.">
<Button
width="115px"
text="확인"
onClick={() => {
router.push("/");
}}
color={colors.white}
background={colors.primary}
/>
</Popup>
)}
<section className={signupWrapper}>
<article className={signupContainer}>
<div>
<div className={`${paddingSprinkles({ paddingBottom: "s32" })} ${pointer}`}>
<Image
src="/svgs/prev.svg"
alt="back"
width={17}
height={21}
onClick={() => {
router.push("/");
}}
/>
</div>

<div className={paddingSprinkles({ paddingBottom: "s32" })}>
<h3 className={`${semiBold} ${heading2}`}>
νšŒμ›κ°€μž…μ„
<br /> μ‹œμž‘ ν• κΉŒμš”?
</h3>
</div>
</div>

<form
onSubmit={handleSubmit(onSubmit)}
className={flexSprinklesFc({ flexDirection: "column", gap: "32px" })}
>
<div className={flexSprinklesFc({ flexDirection: "column", gap: "8px" })}>
<div>
<p className={`${caption} ${regular} ${paddingSprinkles({ paddingBottom: "s4" })}`}>
아이디<span className={`${pink80}`}>*</span>
</p>
<input placeholder="아이디" className={inputStyle} {...register("id")} maxLength={10} />

<p className={`${paddingSprinkles({ paddingTop: "s4" })} ${caption} ${pink80}`}>
{errors.id?.message}
</p>
</div>

<div>
<p className={`${caption} ${regular} ${paddingSprinkles({ paddingBottom: "s4" })}`}>
λΉ„λ°€λ²ˆν˜Έ<span className={`${pink80}`}>*</span>
</p>
<input
type="password"
placeholder="λΉ„λ°€λ²ˆν˜Έ"
className={inputStyle}
{...register("password")}
maxLength={12}
/>

<p className={`${paddingSprinkles({ paddingTop: "s4" })} ${caption} ${pink80}`}>
{errors.password?.message}
</p>
</div>

<div>
<p className={`${caption} ${regular} ${paddingSprinkles({ paddingBottom: "s4" })}`}>
λΉ„λ°€λ²ˆν˜Έ 확인<span className={`${pink80}`}>*</span>
</p>
<input
type="password"
placeholder="λΉ„λ°€λ²ˆν˜Έ 확인"
className={inputStyle}
{...register("confirmPassword")}
maxLength={12}
/>

<p className={`${paddingSprinkles({ paddingTop: "s4" })} ${caption} ${pink80}`}>
{errors.confirmPassword?.message}
</p>
</div>

<div>
<p className={`${caption} ${regular} ${paddingSprinkles({ paddingBottom: "s4" })}`}>
λ‹‰λ„€μž„<span className={`${pink80}`}>*</span>
</p>
<input placeholder="λ‹‰λ„€μž„" className={inputStyle} {...register("nickname")} />

<p className={`${paddingSprinkles({ paddingTop: "s4" })} ${caption} ${pink80}`}>
{errors.nickname?.message}
</p>
</div>
</div>

<div>
<Button
text="κ°€μž…ν•˜κΈ°"
width="100%"
background={isValid ? colors.point : colors.gray200}
color={colors.white}
fontSize="12px"
disabled={!isValid}
/>
</div>
</form>
</article>
</section>
</>
);
};

export default Page;
19 changes: 19 additions & 0 deletions src/app/auth/signup/signup.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { style } from "@vanilla-extract/css";

export const signupWrapper = style([
{
display: "flex",
flexDirection: "column",
alignItems: "flex-start",
justifyContent: "space-between",
height: "100vh",
padding: "85px 36px 104px 36px",
},
]);

export const signupContainer = style({
display: "flex",
flexDirection: "column",
width: "100%",
height: "100%",
});
12 changes: 9 additions & 3 deletions src/app/components/common/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { colors } from "@/app/styles/colors.css";
import { buttonSprinkles, ButtonSprinkles, buttonWrapper } from "@/app/styles/common/button.css";
import { pointer } from "@/app/styles/global.css";
import { buttonOutLine, pointer } from "@/app/styles/global.css";

interface ButtonProps extends ButtonSprinkles {
text: string;
onClick?: () => void;
disabled?: boolean;
}

const Button = ({
Expand All @@ -15,6 +16,7 @@ const Button = ({
fontSize = "16px",
background = colors.white30,
borderRadius = "5px",
disabled = false,
onClick,
}: ButtonProps) => {
const buttonClass = buttonSprinkles({
Expand All @@ -26,9 +28,13 @@ const Button = ({
borderRadius,
});
return (
<div className={`${buttonClass} ${buttonWrapper} ${pointer}`} onClick={onClick}>
<button
className={`${buttonClass} ${buttonWrapper} ${pointer} ${buttonOutLine}`}
onClick={onClick}
disabled={disabled}
>
{text}
</div>
</button>
);
};

Expand Down
2 changes: 1 addition & 1 deletion src/app/components/common/Popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { popupContents, popupWrapper } from "@/app/styles/common/popup.css";
import { paragraph2, semiBold } from "@/app/styles/font.css";
import { flexSprinklesFc } from "./utils/flex";

const Popup = ({ text, children }: { text: string; children: React.ReactNode }) => {
const Popup = ({ text, children }: { text: null | string; children: React.ReactNode }) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zodλ₯Ό μ‚¬μš©ν•˜λ©΄ nullish νƒ€μž…μœΌλ‘œ ν‘œν˜„ν• μˆ˜λ„ μžˆμ„κ²ƒ κ°™μ•„μš”

νƒ€μž…μ—λŠ” nullish(optional), nullable같은 ν˜•νƒœμ˜ νƒ€μž…λ„ μžˆμœΌλ‹ˆ ν™œμš©ν•΄λ³΄μ‹œλŠ”κ±΄ μ–΄λ–¨κΉŒμš”

return (
<section className={popupWrapper}>
<article className={`${popupContents} ${flexSprinklesFc({ flexDirection: "column", gap: "24px" })}`}>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/record/DateCircle.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { circle } from "@/app/styles/record/record.css";
import { circle } from "@/app/record/record.css";

const DateCircle = ({ date }: { date: string }) => {
return <div className={circle}>{date}</div>;
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions src/app/info/detail/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import Memo from "@/app/components/common/Memo";
import { flexSprinklesFc } from "@/app/components/common/utils/flex";
import { gray300, colors } from "@/app/styles/colors.css";
import { semiBold, heading2, caption } from "@/app/styles/font.css";
import { infoContainer } from "@/app/styles/info/common.css";
import { useRouter } from "next/navigation";
import { infoContainer } from "../common.css";

const page = () => {
const Page = () => {
const router = useRouter();
return (
<article className={infoContainer}>
Expand Down Expand Up @@ -39,4 +39,4 @@ const page = () => {
);
};

export default page;
export default Page;
2 changes: 1 addition & 1 deletion src/app/info/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"use client";

import { useRouter } from "next/navigation";
import { infoWrapper } from "../styles/info/common.css";
import Image from "next/image";
import { pointer } from "../styles/global.css";
import { paddingSprinkles } from "../styles/padding.css";
import { infoWrapper } from "./common.css";

export default function Layout({ children }: { children: React.ReactNode }) {
const router = useRouter();
Expand Down
Loading
Loading