-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from ISTTP/develop
자체 회원가입 및 로그인 / 디자인
- Loading branch information
Showing
168 changed files
with
4,479 additions
and
554 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
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,14 +1,74 @@ | ||
@import './Normalize.css'; | ||
|
||
:root { | ||
--white-color: #FFFFFF; | ||
--black-color: #000000; | ||
--orange-color: #FFA83C; | ||
--light-orange-color: #FFF1DF; | ||
--yellow-color: #FEE500; | ||
--light-gray-color: #E9E9E9; | ||
--dark-gray-color: #AAAAAA; | ||
--strawberry-color: #F3A7A7; | ||
--banana-color: #F1F3A7; | ||
--mint-color: #BBF0A8; | ||
--blueberry-color: #C4A7F3; | ||
--chocolate-color: #7B4B23; | ||
--orange-500: #FFA83C; | ||
--orange-400: #FFC57C; | ||
--orange-200: #FFF2E1; | ||
--orange-100: #FFF7ED; | ||
--black: #000000; | ||
--gray-500: #8D8D8D; | ||
--gray-400: #AEAEAE; | ||
--gray-300: #ECECEC; | ||
--gray-200: #DEDEDE; | ||
--white: #FFFFFF; | ||
--magenta: #FF6C6C; | ||
--yellow: #FEE500; | ||
--strawberry-200: #f08787; | ||
--strawberry-100: #F3A7A7; | ||
--banana-200: #e2e673; | ||
--banana-100: #F1F3A7; | ||
--mint-200: #82d664; | ||
--mint-100: #BBF0A8; | ||
--blueberry-200: #9d72e2; | ||
--blueberry-100: #C4A7F3; | ||
--chocolate-200: #5f320d; | ||
--chocolate-100: #7B4B23; | ||
} | ||
|
||
@font-face { | ||
font-family: "OneMobilePop"; | ||
font-weight: normal; | ||
src: url("./assets/fonts/OneMobilePop.TTF") format("truetype"); | ||
} | ||
|
||
@font-face { | ||
font-family: "Pretendard"; | ||
font-weight: 500; | ||
src: url("./assets/fonts/Pretendard-1.3.9/web/static/woff/Pretendard-Medium.woff") format("woff"), | ||
url("./assets/fonts/Pretendard-1.3.9/web/static/woff2/Pretendard-Medium.woff2") format("woff2"), | ||
url("./assets/fonts/Pretendard-1.3.9/public/static/alternative/Pretendard-Medium.ttf") format("truetype"); | ||
} | ||
|
||
@font-face { | ||
font-family: "Pretendard"; | ||
font-weight: 700; | ||
src: url("./assets/fonts/Pretendard-1.3.9/web/static/woff/Pretendard-Bold.woff") format("woff"), | ||
url("./assets/fonts/Pretendard-1.3.9/web/static/woff2/Pretendard-Bold.woff2") format("woff2"), | ||
url("./assets/fonts/Pretendard-1.3.9/public/static/alternative/Pretendard-Bold.ttf") format("truetype"); | ||
} | ||
|
||
body { | ||
font-family: "Pretendard", sans-serif; | ||
background-color: var(--orange-100); | ||
} | ||
|
||
h1 { | ||
font-family: "OneMobilePop", sans-serif; | ||
font-size: 1.5rem; | ||
font-weight: 400; | ||
} | ||
|
||
h2 { | ||
font-size: 1.06rem; | ||
font-weight: 500; | ||
} | ||
|
||
@media (min-width: 801px) { | ||
h1 { | ||
font-size: 2rem; | ||
} | ||
|
||
h2 { | ||
font-size: 1.5rem; | ||
} | ||
} |
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,14 @@ | ||
import React, { ReactNode } from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
|
||
interface ModalPortalProps { | ||
children: ReactNode; | ||
} | ||
|
||
export const ModalPortal: React.FC<ModalPortalProps> = ({ children }) => { | ||
const el = document.getElementById('modal'); | ||
if (!el) { | ||
return null; | ||
} | ||
return ReactDOM.createPortal(children, el); | ||
}; |
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,32 @@ | ||
*, | ||
*::before, | ||
*::after { | ||
box-sizing: border-box; | ||
} | ||
|
||
html, body, | ||
h1, h2, h3, h4, h5, | ||
p, div, form, label, | ||
caption, article, aside, canvas, | ||
header, nav, section, summary, button | ||
ul, li, i, u, | ||
table, tbody, thead, tfoot, tr, th, td | ||
{ | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
ul[role='list'], | ||
ol[role='list'], | ||
li { | ||
list-style: none; | ||
} | ||
|
||
input, | ||
button, | ||
textarea, | ||
select { | ||
font: inherit; | ||
} | ||
|
||
|
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,8 +1,39 @@ | ||
import axios from 'axios'; | ||
import axios, { AxiosError } from 'axios'; | ||
|
||
const axiosInstance = axios.create({ | ||
baseURL: process.env.SERVER_URL, | ||
withCredentials: true, | ||
}); | ||
|
||
axiosInstance.interceptors.response.use( | ||
response => { | ||
return response; | ||
}, | ||
async error => { | ||
const customError = error as AxiosError; | ||
const axiosError = customError.response?.status as number; | ||
|
||
|
||
// 401 에러 응답 | ||
if (axiosError === 401) { | ||
return Promise.reject(error); | ||
} | ||
|
||
// 500 에러 응답 | ||
if (axiosError === 500) { | ||
console.log('서버 오류'); | ||
return Promise.reject(error); | ||
} | ||
|
||
// 400, 404 에러 응답 | ||
if (axiosError === 404 || 400) { | ||
return Promise.reject(error); | ||
} | ||
|
||
|
||
return Promise.reject(error); | ||
}, | ||
); | ||
|
||
|
||
export default axiosInstance; |
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,17 @@ | ||
import { useSuspenseQuery } from '@tanstack/react-query'; | ||
import axiosInstance from '#apis/axios.ts'; | ||
import { getCakeLettersRes } from '@isttp/schemas/all'; | ||
|
||
async function fetchCakeLetters(ownerId: string, year: string, page: number) { | ||
const res = await axiosInstance.get<getCakeLettersRes>( | ||
`/cake/letters/${ownerId}/${year}?keyword=false&page=${page}` | ||
); | ||
return res.data; | ||
} | ||
|
||
export const useGetCakeLetters = (ownerId: string, year: string, page: number) => { | ||
return useSuspenseQuery({ | ||
queryKey: ['cake-letters', ownerId, year, page], | ||
queryFn: () => fetchCakeLetters(ownerId, year, page), | ||
}); | ||
} |
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,16 @@ | ||
import { useQuery } from '@tanstack/react-query'; | ||
import axiosInstance from '#apis/axios.ts'; | ||
|
||
async function fetchLetters(ownerId: string, year: string, page: number) { | ||
const res = await axiosInstance.get(`/cake/letters/${ownerId}/${year}?keyword=true&page=${page}`); | ||
return res.data; | ||
}; | ||
|
||
export const useGetLetters = (ownerId: string, year: string, page: number) => { | ||
return useQuery({ | ||
queryKey: ['grid-letters', ownerId, year, page], | ||
queryFn: () => fetchLetters(ownerId, year, page), | ||
placeholderData: (previousData) => previousData, | ||
}); | ||
}; | ||
|
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,15 @@ | ||
import axiosInstance from "#apis/axios.ts" | ||
import { getUserYearRes } from "@isttp/schemas/all" | ||
import { useSuspenseQuery } from "@tanstack/react-query"; | ||
|
||
async function fetchYear() { | ||
const res = await axiosInstance.get<getUserYearRes>('user/year'); | ||
return res.data; | ||
} | ||
|
||
export const useGetYear = () => { | ||
return useSuspenseQuery({ | ||
queryKey: ['get-year'], | ||
queryFn: () => fetchYear() | ||
}) | ||
} |
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,30 @@ | ||
import { useQuery } from '@tanstack/react-query'; | ||
import axiosInstance from '#apis/axios.ts'; | ||
|
||
async function fetchLetter(letterId: number) { | ||
const res = await axiosInstance.get(`/letter/${letterId}?requirement=true`); | ||
return res.data; | ||
}; | ||
|
||
export const useGetLetter = (letterId: number) => { | ||
return useQuery({ | ||
queryKey: ['letter', letterId], | ||
queryFn: () => fetchLetter(letterId), | ||
enabled: !!letterId, | ||
staleTime: 0, | ||
}); | ||
} | ||
|
||
async function fetchAllLetter(letterId: number) { | ||
const res = await axiosInstance.get(`/letter/${letterId}?requirement=false`); | ||
return res.data; | ||
}; | ||
|
||
export const useGetAllLetter = (letterId: number) => { | ||
return useQuery({ | ||
queryKey: ['letter', letterId], | ||
queryFn: () => fetchAllLetter(letterId), | ||
enabled: !!letterId | ||
}); | ||
} | ||
|
Oops, something went wrong.