Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/pages/photoFeed/FindPhotoLabPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export default function FindPhotoLabPage() {
</p>
</div>
{/* 하단 버튼 영역 */}
<div className="fixed right-0 bottom-0 left-0 flex justify-center gap-3 px-5 py-5">
<div className="fixed right-0 bottom-0 left-0 flex justify-center gap-3 px-5 py-5 pb-[calc(1.25rem+env(safe-area-inset-bottom,2.125rem))]">
<CTA_Button
text="아니요 달라요"
size="medium"
Expand Down
13 changes: 11 additions & 2 deletions src/pages/photoFeed/PhotoFeedSearchPage.tsx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SHOULD: 슬슬 이쪽에 의존성이 너무 많아지는 거 같아서.. 몇몇 기능은 분리해도 좋을 거 같습니당

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useLayoutEffect, useMemo, useRef, useState } from "react";
import { useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
import { useNavigate, useLocation } from "react-router";
import { CTA_Button, SearchBar } from "@/components/common";
import PhotoCard from "@/components/photoFeed/mainFeed/PhotoCard";
Expand Down Expand Up @@ -57,6 +57,8 @@ export default function PhotoFeedSearchPage() {
const [filter, setFilter] = useState<Filter>(
initialLabName ? "LAB_NAME" : "TITLE",
);
const [tempFilter, setTempFilter] = useState(filter);

const [isCreateModalOpen, setIsCreateModalOpen] = useState(false);
const [bottomSheetOpen, setBottomSheetOpen] = useState(false);

Expand All @@ -67,6 +69,12 @@ export default function PhotoFeedSearchPage() {
const inputTrimmed = inputText.trim();
const searchTrimmed = searchText.trim();

useEffect(() => {
if (bottomSheetOpen) {
setTempFilter(filter);
}
}, [bottomSheetOpen, filter]);

// 최근 검색어 조회 API
const {
data: recentSearches = [],
Expand Down Expand Up @@ -386,7 +394,7 @@ export default function PhotoFeedSearchPage() {
>
<div className="flex w-full flex-col items-center">
<div className="flex w-full">
<SelectFilter value={filter} onChange={setFilter} />
<SelectFilter value={tempFilter} onChange={setTempFilter} />
</div>
<div className="fixed right-0 bottom-0 left-0 flex justify-center gap-3 px-5 py-5">
<CTA_Button
Expand All @@ -402,6 +410,7 @@ export default function PhotoFeedSearchPage() {
size="medium"
color="orange"
onClick={() => {
setFilter(tempFilter);
setBottomSheetOpen(false);
}}
/>
Expand Down
37 changes: 20 additions & 17 deletions src/pages/photoFeed/PostPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,22 @@ export default function PostPage() {
<Header title="" showBack onBack={handleGoBack} />
<section className="flex flex-col gap-[0.625rem] pb-10">
{/** 상단 */}
<div className="flex flex-col gap-[0.625rem]">
<Profile
type="post"
userName={postDetail.nickname}
avatarUrl={postDetail.profileImageUrl}
date={postDetail.createdAt}
isOwner={postDetail.isMine}
objectId={postDetail.postId}
/>
<PhotoCarousel
images={postDetail.images}
altPrefix={postDetail.title}
/>
<div className="flex flex-col gap-4">
<div className="flex flex-col gap-[0.625rem]">
<Profile
type="post"
userName={postDetail.nickname}
avatarUrl={postDetail.profileImageUrl}
date={postDetail.createdAt}
isOwner={postDetail.isMine}
objectId={postDetail.postId}
/>
<PhotoCarousel
images={postDetail.images}
altPrefix={postDetail.title}
/>
</div>

<div className="flex h-5 w-full justify-start gap-3 pl-1">
<div className="flex items-center gap-1">
<button
Expand Down Expand Up @@ -168,7 +171,7 @@ export default function PostPage() {
{/** 하단 */}
<div className="flex flex-col gap-4">
{/** 게시글 제목 및 내용 */}
<div className="flex flex-col gap-2">
<div className="flex flex-col gap-1">
<p className="text-semi-bold text-[1.0625rem] text-neutral-100">
{postDetail.title}
</p>
Expand All @@ -194,10 +197,10 @@ export default function PostPage() {
}
className="bg-neutral-875 border-neutral-850 flex flex-col gap-1 rounded-2xl border px-5 py-4 text-left text-neutral-500"
>
<div className="gap-2">
<div className="flex flex-col gap-1.5">
<div className="flex items-center gap-2">
<HomeIcon className="h-4 w-4 font-semibold" />
<p className="text-[1rem] font-semibold text-neutral-200">
<p className="text-[1rem] font-medium text-neutral-200">
{postDetail.labReview?.labName} 이용
</p>
</div>
Expand All @@ -214,7 +217,7 @@ export default function PostPage() {
};

return (
<div className="mx-auto min-h-dvh w-full max-w-[23.4375rem] pt-[1rem]">
<div className="mx-auto min-h-dvh w-full max-w-[23.4375rem]">
{renderPostDetail()}

{/** 게시글 업로드 toast 메세지 */}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/photoFeed/ReviewPhotoLabPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export default function ReviewPhotoLabPage() {
</p>
</div>

<div className="fixed right-0 bottom-0 left-0 flex justify-center px-5 py-5">
<div className="fixed right-0 bottom-0 left-0 flex justify-center px-5 py-5 pb-[calc(1.25rem+env(safe-area-inset-bottom,2.125rem))]">
<CTA_Button
text="작성 완료"
size="xlarge"
Expand Down