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(community): 로그인/회원가입 페이지 추가 #27

Merged
merged 19 commits into from
Nov 21, 2024

Conversation

m2na7
Copy link
Member

@m2na7 m2na7 commented Nov 18, 2024

Summary

#24

로그인&회원가입(auth) 페이지(/signin , /singup) 구현

Tasks

  • auth 페이지에서 사용하는 AuthInput, AuthButton 컴포넌트를 추가했습니다.
    • 해당 컴포넌트는 추후 DS로 변경 가능
  • 로그인, 회원가입 폼을 추가했습니다.
  • 로그인, 회원가입 폼 관련 스키마를 추가했습니다. (schemas폴더 생성)

To Reviewer

로그인/회원가입 폼 컴포넌트를 각각 구현했어요.

Form컴포넌트, useFormHandler커스텀 훅으로 관련 로직을 분리해서 구현하는 방법도 있고, 실제로 구현해보았는데 구조가 지나치게 복잡해진다고 생각했어요.

인증 관련 폼은 로그인/회원가입에만 사용되고, 공통 로직을 분리하는 과정에서 오버엔지니어링이 된다고 판단했고, 각각의 컴포넌트 (SignInForm, SignUpForm)로 구현했어요.
관련해서 의견주시면 반영해보도록 하겠습니다 😃

Screenshot

login signup signup in message
스크린샷 2024-11-18 오후 7 02 29 스크린샷 2024-11-18 오후 7 02 58 스크린샷 2024-11-18 오후 7 03 43

@m2na7 m2na7 added the enhancement New feature or request label Nov 18, 2024
@m2na7 m2na7 requested a review from SunwooJaeho November 18, 2024 10:05
@m2na7 m2na7 self-assigned this Nov 18, 2024
@m2na7 m2na7 linked an issue Nov 18, 2024 that may be closed by this pull request
Copy link
Contributor

coderabbitai bot commented Nov 18, 2024

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

apps/community/src/app/(auth)/signin/page.tsx Outdated Show resolved Hide resolved
apps/community/src/components/auth-input.css.ts Outdated Show resolved Hide resolved
apps/community/src/app/(auth)/signup/page.tsx Outdated Show resolved Hide resolved
console.log(data);
};

const [studentId, password, confirmPassword, name, email, phone] = useWatch({
Copy link
Contributor

@SunwooJaeho SunwooJaeho Nov 18, 2024

Choose a reason for hiding this comment

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

useWatch 대신 formState의 isValid를 이용하는 건 어떨까요?

@gwansikk gwansikk requested a review from Copilot November 18, 2024 12:20

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 20 changed files in this pull request and generated no suggestions.

Files not reviewed (15)
  • apps/community/package.json: Language not supported
  • apps/community/src/app/(auth)/signin/page.css.ts: Evaluated as low risk
  • pnpm-lock.yaml: Evaluated as low risk
  • apps/community/src/schemas/sign-up-form-schema.ts: Evaluated as low risk
  • apps/community/src/components/auth-button.tsx: Evaluated as low risk
  • apps/community/src/components/auth-input.tsx: Evaluated as low risk
  • apps/community/src/components/auth-footer.tsx: Evaluated as low risk
  • apps/community/src/app/(auth)/signin/page.tsx: Evaluated as low risk
  • apps/community/src/components/auth-header.tsx: Evaluated as low risk
  • apps/community/src/components/sign-up-form.tsx: Evaluated as low risk
  • apps/community/src/components/auth-button.css.ts: Evaluated as low risk
  • apps/community/src/app/(auth)/signup/page.tsx: Evaluated as low risk
  • apps/community/src/components/sign-in-form.tsx: Evaluated as low risk
  • apps/community/src/components/auth-input.css.ts: Evaluated as low risk
  • apps/community/src/components/auth-footer.css.ts: Evaluated as low risk
@gwansikk
Copy link
Member

auth 페이지에서 사용하는 AuthInput, AuthButton 컴포넌트를 추가했습니다.
해당 컴포넌트는 추후 DS로 변경 가능

AuthInput은 직접 DS에 컴포넌트로 추가하여 해당 PR에 포함해도 좋을 거 같습니다. 어때요?

Copy link
Member

@gwansikk gwansikk left a comment

Choose a reason for hiding this comment

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

빠르게 작업하셨네요 👍👍 몇 가지 제안합니다.

  • app/(auth)/components

해당 폴더에서 auth에 관련된 '공용' 컴포넌트가 선언되어 있는데요. 여기서 sign-in-form이나 sign-upform 등 signin, signup에서 사용되는 전용 컴포넌트가 해당 폴더에 포함하신 이유가 궁금해요.

저는 각각 페이지 폴더에 components에 선언되어야 한다고 생각합니다.

apps/community/src/app/(auth)/signin/page.css.ts Outdated Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

👍👍 참고하여 DS에 반영하도록 할게요

apps/community/src/components/auth-input.tsx Outdated Show resolved Hide resolved
apps/community/src/components/sign-in-form.tsx Outdated Show resolved Hide resolved
apps/community/src/components/sign-up-form.tsx Outdated Show resolved Hide resolved
Comment on lines +3 to +12
const signInFormSchema = z.object({
studentId: z.string().min(1, { message: '학번을 입력해주세요.' }),
password: z
.string()
.min(1, { message: '비밀번호를 입력해주세요.' })
.regex(
/^(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[~!@#$%^&*])[a-zA-Z0-9~!@#$%^&*]{8,15}$/,
{ message: '올바른 비밀번호 형식이 아닙니다.' },
),
});
Copy link
Member

Choose a reason for hiding this comment

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

스키마의 규모가 작거나 다양하게 나타나지 않는다면 저는 같은 파일(모듈 스코프)에 넣는 것을 지향해요. 같은 파일에 선언되어 있으면 여러 파일을 살펴보지 않고도 빠르게 수정하고 확인할 수 있는 응집도가 생기기 때문인데요. 어떤가요

Copy link
Member Author

Choose a reason for hiding this comment

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

저도 동의합니다 😃

@gwansikk
Copy link
Member

@m2na7 브랜치 최신으로 업데이트 했습니다 pull 당겨주시고, 리뷰한거 피드백 해주세요

@m2na7
Copy link
Member Author

m2na7 commented Nov 21, 2024

input컴포넌트는 DS에 반영했고, 전체 파일 폴더구조(src/component) 변경했습니다 !
@gwansikk @SunwooJaeho


interface Props extends React.InputHTMLAttributes<HTMLInputElement> {
label?: string;
value?: string;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
value?: string;

{label}
</label>
)}
<input value={value} className={styles.input()} {...props} />
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<input value={value} className={styles.input()} {...props} />
<input className={styles.input()} {...props} />

Copy link
Member

Choose a reason for hiding this comment

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

Layout은 nesting-layouts를 사용하여 children으로 내려주는 방법으로 사용해주세요

ref: https://nextjs.org/docs/app/building-your-application/routing/layouts-and-templates#nesting-layouts

label?: string;
value?: string;
message?: string;
className?: string;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
className?: string;

Copy link
Member

@gwansikk gwansikk left a comment

Choose a reason for hiding this comment

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

LGTM

@gwansikk gwansikk merged commit c722872 into develop Nov 21, 2024
3 checks passed
@gwansikk gwansikk deleted the feature/layout-auth-page branch November 21, 2024 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: 로그인/회원가입 페이지
3 participants