-
+
+ {member ? (
+
+ 리뷰 작성하기
+
+ ) : (
+
+ )}
diff --git a/src/pages/ProductDetailPage/productDetailPage.css.ts b/src/pages/ProductDetailPage/productDetailPage.css.ts
index 2291818f..02971751 100644
--- a/src/pages/ProductDetailPage/productDetailPage.css.ts
+++ b/src/pages/ProductDetailPage/productDetailPage.css.ts
@@ -1,5 +1,5 @@
import { vars } from '@/styles/theme.css';
-import { style, styleVariants } from '@vanilla-extract/css';
+import { style } from '@vanilla-extract/css';
export const main = style({
paddingBottom: 70,
@@ -16,7 +16,7 @@ export const sortWrapper = style({
right: 20,
});
-export const registerButtonWrapper = style({
+export const linkWrapper = style({
position: 'fixed',
left: '50%',
bottom: 0,
@@ -32,7 +32,10 @@ export const registerButtonWrapper = style({
transform: 'translateX(-50%)',
});
-const registerButtonBase = style({
+export const link = style({
+ display: 'flex',
+ justifyContent: 'center',
+ alignItems: 'center',
width: '100%',
height: 56,
backgroundColor: vars.colors.primary,
@@ -40,8 +43,3 @@ const registerButtonBase = style({
borderRadius: 6,
fontWeight: 700,
});
-
-export const registerButton = styleVariants({
- active: [registerButtonBase, { backgroundColor: vars.colors.primary }],
- disabled: [registerButtonBase, { backgroundColor: vars.colors.background.tag }],
-});
diff --git a/src/pages/ProductSearchListPage/ProductSearchListPage.tsx b/src/pages/ProductSearchListPage/ProductSearchListPage.tsx
index 828710b0..fa9f1b8b 100644
--- a/src/pages/ProductSearchListPage/ProductSearchListPage.tsx
+++ b/src/pages/ProductSearchListPage/ProductSearchListPage.tsx
@@ -3,7 +3,7 @@ import { useSearchParams } from 'react-router-dom';
import { container } from './productSearchListPage.css';
-import { PageHeader } from '@/components/Common';
+import { TopBar } from '@/components/Common';
import { ProductOverviewList } from '@/components/Product';
import { useIntersectionObserver } from '@/hooks/common';
import { useInfiniteProductSearchResultsQuery } from '@/hooks/queries/search';
@@ -24,7 +24,11 @@ export const ProductSearchListPage = () => {
return (
<>
-
+
+
+
+
+
diff --git a/src/components/Search/RecipeSearchResultList/RecipeSearchResultList.tsx b/src/pages/RecipeSearchListPage/RecipeSearchListPage.tsx
similarity index 50%
rename from src/components/Search/RecipeSearchResultList/RecipeSearchResultList.tsx
rename to src/pages/RecipeSearchListPage/RecipeSearchListPage.tsx
index bdc5134b..8c0b0e70 100644
--- a/src/components/Search/RecipeSearchResultList/RecipeSearchResultList.tsx
+++ b/src/pages/RecipeSearchListPage/RecipeSearchListPage.tsx
@@ -1,19 +1,18 @@
import { useRef } from 'react';
-import { Link } from 'react-router-dom';
-import { styled } from 'styled-components';
+import { useSearchParams } from 'react-router-dom';
-import SearchNotFound from '../SearchNotFound/SearchNotFound';
+import { listWrapper } from './recipeSearchListPage.css';
-import { RecipeItem } from '@/components/Recipe';
-import { PATH } from '@/constants/path';
+import { TopBar } from '@/components/Common';
+import { DefaultRecipeItem } from '@/components/Recipe';
+import SearchNotFound from '@/components/Search/SearchNotFound/SearchNotFound';
import { useIntersectionObserver } from '@/hooks/common';
import { useInfiniteRecipeSearchResultsQuery } from '@/hooks/queries/search';
-interface RecipeSearchResultListProps {
- searchQuery: string;
-}
+export const RecipeSearchListPage = () => {
+ const [searchParams, setSearchParams] = useSearchParams();
+ const searchQuery = searchParams.get('query') || '';
-const RecipeSearchResultList = ({ searchQuery }: RecipeSearchResultListProps) => {
const { data: searchResponse, fetchNextPage, hasNextPage } = useInfiniteRecipeSearchResultsQuery(searchQuery);
const scrollRef = useRef
(null);
useIntersectionObserver(fetchNextPage, scrollRef, hasNextPage);
@@ -26,24 +25,19 @@ const RecipeSearchResultList = ({ searchQuery }: RecipeSearchResultListProps) =>
return (
<>
-
+
+
+
+
+
+
{recipes.map((recipe) => (
-
-
-
-
+
))}
-
+
>
);
};
-
-export default RecipeSearchResultList;
-
-const RecipeSearchResultListContainer = styled.ul`
- & > li + li {
- margin-top: 40px;
- }
-`;
diff --git a/src/pages/RecipeSearchListPage/recipeSearchListPage.css.ts b/src/pages/RecipeSearchListPage/recipeSearchListPage.css.ts
new file mode 100644
index 00000000..5b47dfb5
--- /dev/null
+++ b/src/pages/RecipeSearchListPage/recipeSearchListPage.css.ts
@@ -0,0 +1,8 @@
+import { style } from '@vanilla-extract/css';
+
+export const listWrapper = style({
+ display: 'grid',
+ gridTemplateColumns: '1fr 1fr',
+ gap: '16px 10px',
+ padding: '0 20px',
+});
diff --git a/src/pages/ReviewRegisterPage/ReviewRegisterPage.tsx b/src/pages/ReviewRegisterPage/ReviewRegisterPage.tsx
index 06ca594d..b9251483 100644
--- a/src/pages/ReviewRegisterPage/ReviewRegisterPage.tsx
+++ b/src/pages/ReviewRegisterPage/ReviewRegisterPage.tsx
@@ -4,11 +4,13 @@ import { useParams } from 'react-router-dom';
import { section } from './reviewRegisterPage.css';
import NotFoundPage from '../NotFoundPage';
+import { TopBar } from '@/components/Common';
import { ReviewRegisterForm, ReviewTagSheet } from '@/components/Review';
-import ReviewFormProvider from '@/contexts/ReviewFormContext';
+import { useReviewFormValueContext } from '@/hooks/context';
export const ReviewRegisterPage = () => {
const { productId } = useParams<{ productId: string }>();
+ const { isValid } = useReviewFormValueContext();
const { isOpen, isClosing, handleOpenBottomSheet, handleCloseBottomSheet } = useBottomSheet();
if (!productId || isNaN(Number(productId))) {
@@ -16,7 +18,11 @@ export const ReviewRegisterPage = () => {
}
return (
-
+ <>
+
+
+
+
@@ -25,6 +31,6 @@ export const ReviewRegisterPage = () => {
-
+ >
);
};
diff --git a/src/pages/ReviewRegisterPage/reviewRegisterPage.css.ts b/src/pages/ReviewRegisterPage/reviewRegisterPage.css.ts
index 93a5f54f..408efe7b 100644
--- a/src/pages/ReviewRegisterPage/reviewRegisterPage.css.ts
+++ b/src/pages/ReviewRegisterPage/reviewRegisterPage.css.ts
@@ -2,5 +2,5 @@ import { style } from '@vanilla-extract/css';
export const section = style({
padding: '0 20px',
- marginBottom: 32,
+ margin: '16px 0 32px',
});
diff --git a/src/pages/SearchPage/SearchPage.tsx b/src/pages/SearchPage/SearchPage.tsx
index 9f8562f7..d3b3a001 100644
--- a/src/pages/SearchPage/SearchPage.tsx
+++ b/src/pages/SearchPage/SearchPage.tsx
@@ -6,7 +6,7 @@ import { badgeContainer, searchWrapper, searchResultTitle, searchSection, subTit
import { Text, Badge, ErrorBoundary, ErrorComponent, Loading, PageHeader } from '@/components/Common';
import {
ProductSearchResultPreviewList,
- RecipeSearchResultList,
+ RecipeSearchResultPreviewList,
RecommendList,
SearchInput,
} from '@/components/Search';
@@ -87,7 +87,7 @@ export const SearchPage = () => {
}>
-
+
diff --git a/src/router/index.tsx b/src/router/index.tsx
index 1ace78ba..acd76684 100644
--- a/src/router/index.tsx
+++ b/src/router/index.tsx
@@ -4,6 +4,7 @@ import App from './App';
import { AuthLayout } from '@/components/Layout';
import { PATH } from '@/constants/path';
+import ReviewFormProvider from '@/contexts/ReviewFormContext';
import NotFoundPage from '@/pages/NotFoundPage';
const router = createBrowserRouter([
@@ -146,15 +147,6 @@ const router = createBrowserRouter([
return { Component: ProductDetailPage };
},
},
- {
- path: `${PATH.PRODUCT_LIST}/detail/:productId/review-register`,
- async lazy() {
- const { ReviewRegisterPage } = await import(
- /* webpackChunkName: "ReviewRegisterPage" */ '@/pages/ReviewRegisterPage/ReviewRegisterPage'
- );
- return { Component: ReviewRegisterPage };
- },
- },
],
},
/** 검색 페이지 */
@@ -188,6 +180,36 @@ const router = createBrowserRouter([
return { Component: ProductSearchListPage };
},
},
+ {
+ path: `${PATH.SEARCH}/recipes`,
+ async lazy() {
+ const { RecipeSearchListPage } = await import(
+ /* webpackChunkName: "RecipeSearchListPage" */ '@/pages/RecipeSearchListPage/RecipeSearchListPage'
+ );
+ return { Component: RecipeSearchListPage };
+ },
+ },
+ ],
+ },
+ /** 상품 리뷰 페이지 */
+ {
+ path: '/',
+ element: (
+