-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
186 additions
and
139 deletions.
There are no files selected for viewing
This file contains 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 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,4 @@ | ||
export * from './schema'; | ||
export * from './useGetUserInfo'; | ||
export * from './useGetUserStock'; | ||
export * from './usePostUserNickname'; |
This file contains 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,41 @@ | ||
import { z } from 'zod'; | ||
|
||
export const GetUserInfoSchema = z.object({ | ||
nickname: z.string(), | ||
subName: z.string(), | ||
createdAt: z.string().datetime(), | ||
email: z.string(), | ||
type: z.string(), | ||
}); | ||
|
||
export type GetUserInfo = z.infer<typeof GetUserInfoSchema>; | ||
|
||
export const GetUserStockSchema = z.object({ | ||
id: z.number(), | ||
stockId: z.string(), | ||
name: z.string(), | ||
isTrading: z.boolean(), | ||
groupCode: z.string(), | ||
createdAt: z.string().datetime(), | ||
}); | ||
|
||
export type GetUserStock = z.infer<typeof GetUserStockSchema>; | ||
|
||
export const GetUserStockResponseSchema = z.object({ | ||
userStocks: z.array(GetUserStockSchema), | ||
}); | ||
|
||
export type GetUserStockResponse = z.infer<typeof GetUserStockResponseSchema>; | ||
|
||
export const PostUserNicknameSchema = z.object({ | ||
message: z.string(), | ||
date: z.string().datetime(), | ||
}); | ||
|
||
export type PostUserNickname = z.infer<typeof PostUserNicknameSchema>; | ||
|
||
export const GetUserThemeSchema = z.object({ | ||
theme: z.enum(['light', 'dark']), | ||
}); | ||
|
||
export type GetUserTheme = z.infer<typeof GetUserThemeSchema>; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 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 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 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 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 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 |
---|---|---|
@@ -1,49 +1,37 @@ | ||
import { Link, useNavigate } from 'react-router-dom'; | ||
import { Link } from 'react-router-dom'; | ||
import { useGetTestLogin } from '@/apis/queries/auth/useGetTestLogin'; | ||
import google from '@/assets/google.png'; | ||
import Google from '@/assets/google.svg?react'; | ||
import { Button } from '@/components/ui/button'; | ||
|
||
interface LoginButtonProps { | ||
to: string; | ||
src: string; | ||
alt: string; | ||
onClick?: () => void; | ||
} | ||
|
||
export const Login = () => { | ||
const navigate = useNavigate(); | ||
const googleLoginUrl = '/api/auth/google/login'; | ||
const { refetch } = useGetTestLogin({ password: 'test', username: 'test' }); | ||
|
||
return ( | ||
<div className="flex h-[calc(100vh-8rem)] flex-col items-center justify-center"> | ||
<main className="relative flex flex-col gap-36 rounded-lg bg-gradient-to-br from-[#ffe259] to-[#ffa751] p-16 py-24 shadow-sm"> | ||
<main className="relative flex flex-col gap-36 rounded-lg bg-gradient-to-br from-[#ffe259] to-[#ffa751] p-16 py-24 shadow-sm dark:from-[#e35f5f] dark:to-[#ead16b]"> | ||
<div className="absolute inset-0 rounded-md bg-white/40 backdrop-blur-sm" /> | ||
<section className="relative z-10"> | ||
<h2 className="display-bold24">스마트한 투자의 첫걸음,</h2> | ||
<p className="display-medium20">주춤주춤과 함께해요!</p> | ||
</section> | ||
<section className="relative z-10 flex flex-col gap-4"> | ||
<LoginButton to={googleLoginUrl} src={google} alt="구글 로그인" /> | ||
<Button | ||
onClick={() => { | ||
refetch(); | ||
navigate('/'); | ||
}} | ||
className="h-10 w-full" | ||
> | ||
게스트로 로그인 | ||
</Button> | ||
<Link to={googleLoginUrl} className="w-72" reloadDocument> | ||
<Button className="flex h-10 w-full items-center justify-center gap-4 px-10 dark:bg-black"> | ||
<Google /> | ||
<span>구글 로그인</span> | ||
</Button> | ||
</Link> | ||
<Link to="/"> | ||
<Button | ||
onClick={() => refetch()} | ||
className="h-10 w-full dark:bg-black" | ||
> | ||
게스트로 로그인 | ||
</Button> | ||
</Link> | ||
</section> | ||
</main> | ||
</div> | ||
); | ||
}; | ||
|
||
export const LoginButton = ({ to, src, alt, onClick }: LoginButtonProps) => { | ||
return ( | ||
<Link to={to} className="w-72" onClick={onClick} reloadDocument> | ||
<img src={src} alt={alt} /> | ||
</Link> | ||
); | ||
}; |
This file contains 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 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
Oops, something went wrong.