-
Notifications
You must be signed in to change notification settings - Fork 2
feat(ui): 시스템 컴포넌트 추가 및 매니저 로그인 구현 #408
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
Merged
Merged
Changes from 19 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
f9b5d3b
feat(ui): add Button component and update Badge variant to 'primary'
ohprettyhak e794811
feat(ui): update Badge and Button components with new size options an…
ohprettyhak 269b207
feat(ui): enhance Button component with font weight options and updat…
ohprettyhak 0473f14
feat(ui): change Button component display to inline-flex for better l…
ohprettyhak c2bb9f0
feat(ui): add height, font size, and font weight utilities for Button…
ohprettyhak a90789a
feat(ui): refactor color imports to use colors object in Badge and Bu…
ohprettyhak e7a4c11
feat(ui): add Input component with responsive font size and weight op…
ohprettyhak 99b6530
feat(ui): add Input component with responsive sizing and integrate in…
ohprettyhak bd32083
feat(ui): enhance Input component with label positioning and placehol…
ohprettyhak f235493
feat(ui): update Input component for improved label positioning and p…
ohprettyhak 8fda811
feat(ui): refine Input component styles and improve label positioning
ohprettyhak 224151b
feat(ui): add Select component with customizable styles and responsiv…
ohprettyhak abb313b
feat(ui): update package.json to streamline build process and adjust …
ohprettyhak e4af5f3
feat(ui): add useLogin hook for user authentication
ohprettyhak b8f2f2d
feat(ui): implement LoginForm component for user authentication
ohprettyhak c4482d8
feat(ui): standardize font size for Input and Select components
ohprettyhak be50e10
feat(ui): add name attributes to Input fields in LoginForm component
ohprettyhak dac3a74
feat(ui): refactor Badge, Button, Input, and Select components to use…
ohprettyhak b16f9b3
feat(ui): remove unused exports from index.ts
ohprettyhak 0a1cdc2
feat(ui): add Toast component with customizable styles and icons
ohprettyhak 2f529ba
feat(ui): enhance LoginForm to use router for navigation and improve …
ohprettyhak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export * from './mutations'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export * from './useLogin'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import { fetcher, useMutation } from '@hcc/api-base'; | ||
|
|
||
| type Request = { | ||
| email: string; | ||
| password: string; | ||
| }; | ||
|
|
||
| export const postLogin = (request: Request) => { | ||
| return fetcher.post<void>('manager/login', { json: request }); | ||
| }; | ||
|
|
||
| export const useLogin = () => useMutation({ mutationFn: postLogin }); |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| 'use client'; | ||
|
|
||
| import { Button, Input, toast } from '@hcc/ui'; | ||
| import type { FormEvent } from 'react'; | ||
| import { useLogin } from '~/api'; | ||
|
|
||
| export const LoginForm = () => { | ||
| const { mutate } = useLogin(); | ||
|
|
||
| const handleSubmit = (event: FormEvent<HTMLFormElement>) => { | ||
| event.preventDefault(); | ||
| const formData = new FormData(event.currentTarget); | ||
| const email = formData.get('email') as string; | ||
| const password = formData.get('password') as string; | ||
|
|
||
| mutate( | ||
| { email, password }, | ||
| { | ||
| onSuccess: () => { | ||
| window.location.href = '/'; | ||
ohprettyhak marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }, | ||
| onError: error => { | ||
| if (error instanceof Error) { | ||
| toast.error(error.message); | ||
| } else { | ||
| toast.error('로그인에 실패했습니다. 다시 시도해주세요.'); | ||
| } | ||
| }, | ||
| }, | ||
| ); | ||
| }; | ||
|
|
||
| return ( | ||
| <form className="column w-full" onSubmit={handleSubmit}> | ||
| <Input | ||
| id="email" | ||
| name="email" | ||
| size="xl" | ||
| type="email" | ||
| placeholder="이메일" | ||
| autoComplete="email" | ||
| /> | ||
| <Input | ||
| id="password" | ||
| name="password" | ||
| className="mt-4" | ||
| size="xl" | ||
| type="password" | ||
| placeholder="비밀번호" | ||
| autoComplete="current-password" | ||
| /> | ||
| <Button className="mt-6" size="xl" color="black" variant="solid" type="submit"> | ||
| 로그인 | ||
| </Button> | ||
| </form> | ||
| ); | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| .button { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| cursor: pointer; | ||
| transition: background-color 0.15s ease-in-out; | ||
|
|
||
| height: var(--hcc-button-height); | ||
| color: var(--hcc-button-font-color); | ||
| font-size: var(--hcc-button-font-size); | ||
| font-weight: var(--hcc-button-font-weight); | ||
| border: var(--hcc-button-border); | ||
| border-radius: var(--hcc-button-border-radius); | ||
| background-color: var(--hcc-button-bg-color); | ||
|
|
||
| --hcc-button-height: inherit; | ||
| --hcc-button-font-color: inherit; | ||
| --hcc-button-font-size: inherit; | ||
| --hcc-button-font-weight: inherit; | ||
| --hcc-button-border: inherit; | ||
| --hcc-button-border-radius: inherit; | ||
| --hcc-button-bg-color: inherit; | ||
| } | ||
|
|
||
| .button:focus-visible { | ||
| outline: 2px solid currentColor; | ||
| outline-offset: 2px; | ||
| } | ||
|
|
||
| .disabled { | ||
| opacity: 0.5; | ||
| cursor: not-allowed; | ||
| pointer-events: none; | ||
| } | ||
|
|
||
| .button:hover { | ||
| background-color: var(--hcc-button-bg-hover-color); | ||
|
|
||
| --hcc-button-bg-hover-color: inherit; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.