-
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.
- Loading branch information
Showing
29 changed files
with
456 additions
and
18 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
.Box { | ||
width: 100%; | ||
padding: 2rem; | ||
@include flexSort(null, space-between, center, null); | ||
border: 1px solid #9d9d9d; | ||
border-radius: 2rem; | ||
box-shadow: 0 0.4rem 0.4rem 0 rgba(0, 0, 0, 0.25); | ||
|
||
&:hover { | ||
background-color: $gray-3; | ||
} | ||
} | ||
|
||
.leftBox { | ||
@include flexSort(column, null, null, 1rem); | ||
} | ||
|
||
.titleBox { | ||
@include flexSort(null, null, center, 2rem); | ||
} | ||
|
||
.title { | ||
@include font(2rem, 600, normal); | ||
} | ||
|
||
.dateBox { | ||
@include flexSort(null, null, center, 1rem); | ||
@include font(1.3rem, 300, normal); | ||
} | ||
|
||
.rightBox { | ||
@include flexSort(column, null, flex-end, 1rem); | ||
} | ||
|
||
.detailBtn { | ||
padding: 0.7rem 1rem; | ||
border-radius: 1rem; | ||
background: #8b8282; | ||
color: white; | ||
@include font(1.3rem, 600, normal); | ||
@include flexSort(null, center, center, null); | ||
} |
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,42 @@ | ||
import classNames from "classnames/bind"; | ||
|
||
import Link from "next/link"; | ||
|
||
import { ROUTE } from "@/constants/route"; | ||
import RedHeart from "@/icons/red_heart.svg"; | ||
import { formatDateString } from "@/utils"; | ||
|
||
import styles from "./LikesPost.module.scss"; | ||
import PostStatusLabel from "../PostStatusLabel/PostStatusLabel"; | ||
|
||
const cn = classNames.bind(styles); | ||
|
||
interface LikesPostProps { | ||
id: number; | ||
title: string; | ||
postStatus: "RECRUITING" | "FINISHED"; | ||
modifiedAt: string; | ||
endTime: string; | ||
postType: "TAKER" | "GIVER"; | ||
} | ||
|
||
export default function LikesPost({ endTime, id, modifiedAt, postStatus, title, postType }: LikesPostProps) { | ||
return ( | ||
<Link href={postType === "TAKER" ? `${ROUTE.HELP_ME}/${id}` : `${ROUTE.HELP_YOU}/${id}`} className={cn("Box")}> | ||
<div className={cn("leftBox")}> | ||
<div className={cn("titleBox")}> | ||
<p className={cn("title")}>{`#${id} ${title}`}</p> | ||
<PostStatusLabel postStatus={postStatus} /> | ||
</div> | ||
<div className={cn("dateBox")}> | ||
<p>일시 | </p> | ||
<p>{`${formatDateString(modifiedAt)} ~ ${formatDateString(endTime)}`}</p> | ||
</div> | ||
</div> | ||
<div className={cn("rightBox")}> | ||
<RedHeart width={32} height={32} /> | ||
<button className={cn("detailBtn")}>자세히 보기</button> | ||
</div> | ||
</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
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,12 @@ | ||
import axiosInstance from "@/apis/axiosInstance"; | ||
|
||
export default async function postLikes(postId: number) { | ||
const { data } = await axiosInstance.post( | ||
`posts/likes/${postId}`, | ||
{}, | ||
{ | ||
withCredentials: true, | ||
}, | ||
); | ||
return data; | ||
} |
23 changes: 23 additions & 0 deletions
23
src/components/common/PostStatusLabel/PostStatusLabel.module.scss
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,23 @@ | ||
.box { | ||
@include flexSort(null, center, center, null); | ||
border-radius: 1rem; | ||
padding: 0.5rem 1rem; | ||
border: 0.1rem solid #ff6767; | ||
@include font(1.2rem, 500, normal); | ||
|
||
&.RECRUITING { | ||
background-color: white; | ||
|
||
.statusText { | ||
color: #ff6767; | ||
} | ||
} | ||
|
||
&.FINISHED { | ||
background-color: #ff6767; | ||
|
||
.statusText { | ||
color: white; | ||
} | ||
} | ||
} |
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,19 @@ | ||
import classNames from "classnames/bind"; | ||
|
||
import styles from "./PostStatusLabel.module.scss"; | ||
|
||
const cn = classNames.bind(styles); | ||
|
||
interface PostStatusLabelProps { | ||
postStatus: "RECRUITING" | "FINISHED"; | ||
} | ||
|
||
export default function PostStatusLabel({ postStatus }: PostStatusLabelProps) { | ||
const statusText = postStatus === "RECRUITING" ? "매칭중" : "매칭완료"; | ||
|
||
return ( | ||
<div className={cn("box", postStatus)}> | ||
<p className={cn("statusText")}>{statusText}</p> | ||
</div> | ||
); | ||
} |
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
39 changes: 39 additions & 0 deletions
39
src/components/page-layout/myPageLikesLayout/apis/getMyLikes.ts
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,39 @@ | ||
import axiosInstance from "@/apis/axiosInstance"; | ||
|
||
export interface MyLikesRes { | ||
content: { | ||
assistanceType: "생활" | "교육"; | ||
author: { | ||
age: number; | ||
disabilityType: string; | ||
email: string; | ||
gender: string; | ||
memberId: number; | ||
name: string; | ||
nickname: string; | ||
profileImageUrl: string; | ||
}; | ||
content: string; | ||
createdAt: string; | ||
disabilityType: string | null; | ||
district: string; | ||
endTime: string; | ||
id: number; | ||
modifiedAt: string; | ||
postStatus: "RECRUITING" | "FINISHED"; | ||
postType: "TAKER" | "GIVER"; | ||
scheduleDetails: string; | ||
scheduleType: string; | ||
startTime: string; | ||
title: string; | ||
}[]; | ||
last: boolean; | ||
totalElements: number; | ||
} | ||
|
||
export default async function getMyLikes(pageId: string, postType: string): Promise<MyLikesRes> { | ||
const { data } = await axiosInstance.get(`posts/likes/my-page?post-type=${postType}&page=${pageId}&size=4`, { | ||
withCredentials: true, | ||
}); | ||
return data.data; | ||
} |
4 changes: 4 additions & 0 deletions
4
src/components/page-layout/myPageLikesLayout/components/MyLikesList/MyLikesList.module.scss
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 @@ | ||
.container { | ||
padding: 3rem; | ||
@include flexSort(column, null, null, 1rem); | ||
} |
30 changes: 30 additions & 0 deletions
30
src/components/page-layout/myPageLikesLayout/components/MyLikesList/MyLikesList.tsx
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 classNames from "classnames/bind"; | ||
|
||
import LikesPost from "@/components/common/LikesPost/LikesPost"; | ||
|
||
import styles from "./MyLikesList.module.scss"; | ||
import { MyLikesRes } from "../../apis/getMyLikes"; | ||
|
||
const cn = classNames.bind(styles); | ||
|
||
interface MyLikesListProps { | ||
likesList: MyLikesRes["content"] | undefined; | ||
} | ||
|
||
export default function MyLikesList({ likesList }: MyLikesListProps) { | ||
return ( | ||
<div className={cn("container")}> | ||
{likesList?.map((post) => ( | ||
<LikesPost | ||
key={post.id} | ||
endTime={post.endTime} | ||
id={post.id} | ||
modifiedAt={post.modifiedAt} | ||
postStatus={post.postStatus} | ||
title={post.title} | ||
postType={post.postType} | ||
/> | ||
))} | ||
</div> | ||
); | ||
} |
8 changes: 8 additions & 0 deletions
8
...onents/page-layout/myPageLikesLayout/components/MyLikesListBox/MyLikesListBox.module.scss
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,8 @@ | ||
.myLikesListBox { | ||
@include flexSort(column, null, null, null); | ||
} | ||
|
||
.paginationBox { | ||
@include flexSort(null, center, center, null); | ||
margin-bottom: 3rem; | ||
} |
Oops, something went wrong.