-
Notifications
You must be signed in to change notification settings - Fork 2
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 #44 from Goorm-Lucky7/develop/apis
[PR] ๋ํ ์ผ ๋ฐ ๊ธ ์์ฑ ํ์ด์ง API ๋ง๋ค๊ธฐ
- Loading branch information
Showing
39 changed files
with
298 additions
and
243 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Empty file.
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,24 @@ | ||
import { PostForm } from '@/types/post'; | ||
import { getAuthAxios } from './authAxios'; | ||
|
||
export const postProblem = async (formData: PostForm) => { | ||
const access = localStorage.getItem('access'); | ||
if (!access) { | ||
console.error('Access token is missing or invalid'); | ||
throw new Error('Access token is missing or invalid'); | ||
} | ||
const authAxios = getAuthAxios(access); | ||
const response = await authAxios.post('/api/post', formData); | ||
return response.data; | ||
}; | ||
|
||
export const getProblem = async (postId: string) => { | ||
const access = localStorage.getItem('access'); | ||
if (!access) { | ||
console.error('Access token is missing or invalid'); | ||
throw new Error('Access token is missing or invalid'); | ||
} | ||
const authAxios = getAuthAxios(access); | ||
const response = await authAxios.get(`/api/posts/${postId}`); | ||
return response.data as PostForm; | ||
}; |
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,28 @@ | ||
import { Comment } from '@/types/comment'; | ||
import { CommentItem } from '..'; | ||
|
||
import * as S from './styles'; | ||
|
||
const defaultComment = { | ||
commentId: 1, | ||
createdAt: new Date('2024-05-02'), | ||
content: | ||
'asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf', | ||
user: { | ||
nickname: '์๋ธ๋ผ์นดํ๋ธ๋ผ๋ง์ด๋ง์ด๋ง์ด', | ||
profileImage: null, | ||
}, | ||
} as Comment; | ||
|
||
const CommentList = () => { | ||
const mock = [1, 2, 3, 4, 5, 6, 7, 8, 9]; | ||
return ( | ||
<S.Container> | ||
{mock.map(() => ( | ||
<CommentItem {...defaultComment} /> | ||
))} | ||
</S.Container> | ||
); | ||
}; | ||
|
||
export default CommentList; |
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,10 @@ | ||
import { layoutMap } from '@/styles/layout'; | ||
import styled from '@emotion/styled'; | ||
|
||
export const Container = styled.div` | ||
display: flex; | ||
flex-direction: column-reverse; | ||
gap: 10px; | ||
padding: 10px; | ||
${layoutMap.scrollbarsNone} | ||
`; |
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,2 +1,3 @@ | ||
// comment | ||
export { default as CommentItem } from './commentItem'; | ||
export { default as CommentList } from './commentList'; |
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 { animationMap } from '@/styles/framerMotion'; | ||
import { motion } from 'framer-motion'; | ||
|
||
import * as S from './styles'; | ||
|
||
const CircleLoader = () => { | ||
return ( | ||
<motion.span | ||
css={S.circleStyle} | ||
animate={{ rotate: 360 }} | ||
transition={animationMap.spinTransition} | ||
/> | ||
); | ||
}; | ||
|
||
export default CircleLoader; |
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 { css } from '@emotion/react'; | ||
|
||
export const circleStyle = css` | ||
display: block; | ||
width: 3rem; | ||
height: 3rem; | ||
border: 0.5rem solid #e9e9e9; | ||
border-top: 0.5rem solid #3498db; | ||
border-radius: 50%; | ||
position: absolute; | ||
box-sizing: border-box; | ||
left: 50%; | ||
top: 50%; | ||
`; |
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
Oops, something went wrong.