-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop/fe' into feature/fe/#538
- Loading branch information
Showing
41 changed files
with
836 additions
and
103 deletions.
There are no files selected for viewing
8 changes: 5 additions & 3 deletions
8
frontend/src/components/common/CharacterCount/CharacterCount.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
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
45 changes: 45 additions & 0 deletions
45
frontend/src/components/pages/my/MyLikes/MyLikes.styled.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,45 @@ | ||
import styled from "@emotion/styled"; | ||
|
||
export const Layout = styled.div` | ||
display: flex; | ||
width: 100%; | ||
height: 100%; | ||
gap: ${(props) => props.theme.spacing.m}; | ||
`; | ||
|
||
export const List = styled.ul` | ||
display: flex; | ||
flex-direction: column; | ||
gap: ${(props) => props.theme.spacing.m}; | ||
width: 100%; | ||
padding: 0 ${(props) => props.theme.spacing.l}; | ||
`; | ||
|
||
export const Container = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: flex-start; | ||
gap: ${(props) => props.theme.spacing.s}; | ||
`; | ||
|
||
export const DetailContainer = styled.div` | ||
display: flex; | ||
align-items: center; | ||
gap: ${(props) => props.theme.spacing.m}; | ||
width: 100%; | ||
`; | ||
|
||
export const BoxButton = styled.button` | ||
display: flex; | ||
gap: ${(props) => props.theme.spacing.m}; | ||
justify-content: flex-start; | ||
align-items: center; | ||
width: 100%; | ||
padding: ${(props) => props.theme.spacing.m}; | ||
border: 1px solid ${(props) => props.theme.colors.border}; | ||
border-radius: 10px; | ||
`; |
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,102 @@ | ||
import { useEffect } from "react"; | ||
import { useNavigate } from "react-router-dom"; | ||
|
||
import { css } from "@emotion/react"; | ||
|
||
import type { UserResponse } from "@type/domain/user"; | ||
|
||
import useInfiniteMyLikes from "@queries/useInfiniteMyLikes"; | ||
|
||
import { AvatarCircle, Text } from "@components/common"; | ||
import MyPageTabContentSkeleton from "@components/pages/my/MyPageTabContentSkeleton/MyPageTabContentSkeleton"; | ||
|
||
import useIntersectionObserver from "@hooks/useIntersectionObserver"; | ||
|
||
import { ERROR_MESSAGE_MAP } from "@constants/errorMessage"; | ||
import { ROUTE_PATHS_MAP } from "@constants/route"; | ||
|
||
import theme from "@styles/theme"; | ||
|
||
import MyPageTabContent from "../MyPageTabContent/MyPageTabContent"; | ||
import * as S from "./MyLikes.styled"; | ||
|
||
interface MyLikesProps { | ||
userData: UserResponse; | ||
} | ||
|
||
const MyLikes = ({ userData }: MyLikesProps) => { | ||
const { myLikes, fetchNextPage, status, isPaused, error } = useInfiniteMyLikes(userData); | ||
const { lastElementRef } = useIntersectionObserver(fetchNextPage); | ||
|
||
const navigate = useNavigate(); | ||
|
||
const handleClickTravelogue = (id: string) => { | ||
navigate(ROUTE_PATHS_MAP.travelogue(Number(id))); | ||
}; | ||
|
||
const handleClickIconButton = () => { | ||
navigate(ROUTE_PATHS_MAP.root); | ||
}; | ||
|
||
useEffect(() => { | ||
if (isPaused) alert(ERROR_MESSAGE_MAP.network); | ||
}, [isPaused]); | ||
|
||
if (status === "pending") return <MyPageTabContentSkeleton />; | ||
|
||
if (error) alert(error.message); | ||
|
||
return ( | ||
<> | ||
<MyPageTabContent | ||
iconButtonType="search-icon" | ||
iconButtonLabel="다른 여행기 구경하기" | ||
onClickIconButton={handleClickIconButton} | ||
contentDetail={myLikes} | ||
renderItem={({ id, title, createdAt, thumbnailUrl, authorName }) => ( | ||
<S.Layout onClick={() => handleClickTravelogue(id)}> | ||
<AvatarCircle size="medium" profileImageUrl={thumbnailUrl} /> | ||
|
||
<S.Container> | ||
<Text | ||
textType="body" | ||
css={css` | ||
font-weight: 500; | ||
`} | ||
> | ||
{title} | ||
</Text> | ||
<S.DetailContainer> | ||
<Text | ||
textType="detail" | ||
css={css` | ||
color: ${theme.colors.text.secondary}; | ||
`} | ||
> | ||
{authorName} | ||
</Text> | ||
<Text | ||
textType="detail" | ||
css={css` | ||
color: ${theme.colors.text.secondary}; | ||
`} | ||
> | ||
{createdAt} | ||
</Text> | ||
</S.DetailContainer> | ||
</S.Container> | ||
</S.Layout> | ||
)} | ||
/> | ||
|
||
<div | ||
ref={lastElementRef} | ||
css={css` | ||
height: 1px; | ||
`} | ||
/> | ||
</> | ||
); | ||
}; | ||
|
||
export default MyLikes; |
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,11 +1,13 @@ | ||
import { ERROR_MESSAGE_MAP } from "@constants/errorMessage"; | ||
|
||
import MyLikes from "./MyLikes/MyLikes"; | ||
import MyTravelPlans from "./MyTravelPlans/MyTravelPlans"; | ||
import MyTravelogues from "./MyTravelogues/MyTravelogues"; | ||
|
||
export const TAB_CONTENT = [ | ||
{ label: "✈️ 내 여행 계획", component: MyTravelPlans }, | ||
{ label: "📝 내 여행기", component: MyTravelogues }, | ||
{ label: "❤️ 좋아요", component: MyLikes }, | ||
] as const; | ||
|
||
export const IGNORED_ERROR_MESSAGES = [ERROR_MESSAGE_MAP.api.login, "Network Error"]; |
22 changes: 22 additions & 0 deletions
22
frontend/src/components/pages/search/TravelogueList/EmptySearchResult.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,22 @@ | ||
import { SearchFallback, Text } from "@components/common"; | ||
|
||
import * as S from "./TravelogueList.styled"; | ||
|
||
interface EmptySearchResultProps { | ||
keyword: string | undefined; | ||
} | ||
|
||
const EmptySearchResult = ({ keyword }: EmptySearchResultProps) => { | ||
return ( | ||
<S.Layout> | ||
{keyword && ( | ||
<Text css={S.searchResultTextStyle} textType="title">{`"${keyword}" 검색 결과`}</Text> | ||
)} | ||
<S.SearchFallbackWrapper> | ||
<SearchFallback title="휑" text="검색 결과가 없어요." /> | ||
</S.SearchFallbackWrapper> | ||
</S.Layout> | ||
); | ||
}; | ||
|
||
export default EmptySearchResult; |
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,4 +1,5 @@ | ||
export const TAB_CONTENT = [ | ||
{ label: "제목", searchType: "TITLE" }, | ||
{ label: "작성자", searchType: "AUTHOR" }, | ||
{ label: "나라", searchType: "COUNTRY" }, | ||
] as const; |
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.