Skip to content

Commit

Permalink
Merge branch 'feat/v2' into feat/issue-90
Browse files Browse the repository at this point in the history
  • Loading branch information
Leejin-Yang committed Apr 20, 2024
2 parents b218571 + c0a87ba commit 8febefa
Show file tree
Hide file tree
Showing 30 changed files with 154 additions and 257 deletions.
Binary file modified public/assets/apple-icon-180x180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/assets/favicon.ico
Binary file not shown.
110 changes: 11 additions & 99 deletions src/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/components/Common/CategoryFoodList/CategoryFoodList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ const categoryType = CATEGORY_TYPE.FOOD;

const imgSize = {
home: {
width: 51,
height: 51,
width: 52,
height: 52,
},
products: {
width: 68,
height: 68,
width: 56,
height: 56,
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { style } from '@vanilla-extract/css';

export const categoryFoodListWrapper = style({
display: 'flex',
justifyContent: 'space-between',
gap: 10,
padding: '0 20px',
overflowX: 'auto',
Expand Down
9 changes: 7 additions & 2 deletions src/components/Common/CategoryItem/CategoryItem.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import cx from 'classnames';
import { Link } from 'react-router-dom';

import { imageWrapper, categoryImage, categoryName, circle, bordered, link } from './categoryItem.css';
import { imageWrapper, categoryImage, circle, bordered, link } from './categoryItem.css';
import Text from '../Text/Text';

import { PATH } from '@/constants/path';
import { useGA } from '@/hooks/common';
Expand Down Expand Up @@ -54,7 +55,11 @@ const CategoryItem = ({
alt={name}
/>
</div>
{hasName && <span className={categoryName}>{name}</span>}
{hasName && (
<Text as="span" color="info" size="caption4" weight="semiBold">
{name}
</Text>
)}
</Link>
);
};
Expand Down
8 changes: 2 additions & 6 deletions src/components/Common/CategoryItem/categoryItem.css.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { vars } from '@/styles/theme.css';
import { style } from '@vanilla-extract/css';

export const link = style({
Expand All @@ -23,10 +24,5 @@ export const circle = style({
});

export const bordered = style({
border: '1px solid #e6e6e6',
});

export const categoryName = style({
fontSize: '1.2rem',
lineHeight: 1.4,
border: `1px solid ${vars.colors.border.default}`,
});
23 changes: 3 additions & 20 deletions src/components/Common/CategoryStoreList/CategoryStoreList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,11 @@ interface CategoryStoreListProps {
hasName?: boolean;
isCircular?: boolean;
isBordered?: boolean;
location?: 'home' | 'products';
}

const categoryType = CATEGORY_TYPE.STORE;

const imgSize = {
home: {
width: 78,
height: 58,
},
products: {
width: 76,
height: 58,
},
};

const CategoryStoreList = ({
hasName = false,
isCircular = false,
isBordered = false,
location = 'home',
}: CategoryStoreListProps) => {
const CategoryStoreList = ({ hasName = false, isCircular = false, isBordered = false }: CategoryStoreListProps) => {
const { data: categories } = useCategoryStoreQuery();

return (
Expand All @@ -38,8 +21,8 @@ const CategoryStoreList = ({
<CategoryItem
key={category.id}
category={category}
width={imgSize[location].width}
height={imgSize[location].height}
width={68}
height={51}
categoryType={categoryType}
hasName={hasName}
isCircular={isCircular}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { style } from '@vanilla-extract/css';

export const categoryStoreListWrapper = style({
display: 'flex',
justifyContent: 'space-between',
justifyContent: 'space-evenly',
width: '100%',
padding: '0 20px',
});
2 changes: 1 addition & 1 deletion src/components/Common/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Header = () => {
return (
<header className={container}>
<Link to={PATH.HOME}>
<Logo width={120} />
<Logo />
</Link>
<Link to={PATH.SEARCH}>
<SvgIcon variant="search2" width={20} height={20} fill="none" stroke="#232527" />
Expand Down
4 changes: 2 additions & 2 deletions src/components/Common/SectionHeader/SectionHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ interface SectionHeaderProps {
const SectionHeader = ({ name, link, state }: SectionHeaderProps) => {
return (
<div className={container}>
<h1 className={title}>{name}</h1>
<h2 className={title}>{name}</h2>
{link && (
<Link to={link} state={state}>
<SvgIcon variant="arrowRight" width={20} height={20} />
<SvgIcon variant="arrowRight" width={16} height={16} style={{ transform: 'translateY(2px)' }} />
</Link>
)}
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Common/SectionHeader/sectionHeader.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export const container = style({
});

export const title = style({
fontSize: '1.8rem',
fontWeight: 600,
fontSize: '1.6rem',
fontWeight: 700,
});
2 changes: 1 addition & 1 deletion src/components/Common/TopBar/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const TopBar = ({ children }: TopBarProps) => {
const Logo = () => {
return (
<Link to={PATH.HOME}>
<LogoImage width={120} />
<LogoImage />
</Link>
);
};
Expand Down
4 changes: 2 additions & 2 deletions src/components/Members/MemberRecipeList/MemberRecipeList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import styled from 'styled-components';
import { PATH } from '@/constants/path';
import { useIntersectionObserver } from '@/hooks/common';
import { useInfiniteMemberRecipeQuery } from '@/hooks/queries/members';
import useDisplaySlice from '@/utils/displaySlice';
import displaySlice from '@/utils/displaySlice';

interface MemberRecipeListProps {
isPreview?: boolean;
Expand All @@ -17,7 +17,7 @@ const MemberRecipeList = ({ isPreview = false }: MemberRecipeListProps) => {

const { fetchNextPage, hasNextPage, data } = useInfiniteMemberRecipeQuery();
const memberRecipes = data?.pages.flatMap((page) => page.recipes);
const recipeToDisplay = useDisplaySlice(isPreview, memberRecipes);
const recipeToDisplay = displaySlice(isPreview, memberRecipes);

useIntersectionObserver<HTMLDivElement>(fetchNextPage, scrollRef, hasNextPage);

Expand Down
4 changes: 2 additions & 2 deletions src/components/Members/MemberReviewList/MemberReviewList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import MemberReviewItem from '../MemberReviewItem/MemberReviewItem';
import { PATH } from '@/constants/path';
import { useIntersectionObserver } from '@/hooks/common';
import { useInfiniteMemberReviewQuery } from '@/hooks/queries/members';
import useDisplaySlice from '@/utils/displaySlice';
import displaySlice from '@/utils/displaySlice';

interface MemberReviewListProps {
isPreview?: boolean;
Expand All @@ -18,7 +18,7 @@ const MemberReviewList = ({ isPreview = false }: MemberReviewListProps) => {
const scrollRef = useRef<HTMLDivElement>(null);
const { fetchNextPage, hasNextPage, data } = useInfiniteMemberReviewQuery();
const memberReviews = data.pages.flatMap((page) => page.reviews);
const reviewsToDisplay = useDisplaySlice(isPreview, memberReviews);
const reviewsToDisplay = displaySlice(isPreview, memberReviews);

useIntersectionObserver<HTMLDivElement>(fetchNextPage, scrollRef, hasNextPage);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import ProductItem from '../ProductItem/ProductItem';
import { PATH } from '@/constants/path';
import { useInfiniteProductsQuery } from '@/hooks/queries/product';
import type { CategoryVariant } from '@/types/common';
import useDisplaySlice from '@/utils/displaySlice';
import displaySlice from '@/utils/displaySlice';

interface ProductPreviewListProps {
category: CategoryVariant;
Expand All @@ -18,7 +18,7 @@ const ProductPreviewList = ({ categoryId }: ProductPreviewListProps) => {
const { data } = useInfiniteProductsQuery(categoryId, 'reviewCount,desc');
const products = data.pages.flatMap((page) => page.products);
// λͺ‡κ°œκΉŒμ§€ 보여쀄지
const productToDisplay = useDisplaySlice(false, products, 5);
const productToDisplay = displaySlice(true, products, 5);

return (
<ul className={container}>
Expand Down
64 changes: 42 additions & 22 deletions src/components/Rank/ReviewRankingItem/ReviewRankingItem.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,51 @@ const meta: Meta<typeof ReviewRankingItem> = {
title: 'review/ReviewRankingItem',
component: ReviewRankingItem,
args: {
reviewRanking: {
reviewId: 1,
productId: 5,
productName: 'ꡬ운감자슬림λͺ…λž€λ§ˆμš”',
content:
'ν• λ¨Έλ‹ˆκ°€ 먹을 κ±° 같은 λ§›μž…λ‹ˆλ‹€. 1960λ…„ μ „μŸ λ•Œ 맛 보고 μ‹Άμ—ˆλŠ”λ° κ·Έλ•ŒλŠ” λ„ˆλ¬΄ κ°€λ‚œν•΄μ„œ 먹을 수 μ—†μ—ˆλŠ”λ°μš” 이것보닀 κΈ΄ 리뷰도 잘렀 λ³΄μΈλ‹΅λ‹ˆλ‹€',
image: REVIEW_CARD_DEFAULT_IMAGE_URL,
categoryType: 'food',
tags: [
{
id: 5,
name: 'πŸ˜‹ λ§›μžˆμ–΄μš”',
tagType: 'TASTE',
},
{
id: 1,
name: '🍭 λ‹¬λ‹¬ν•΄μš”',
tagType: 'TASTE',
},
],
},
productName: 'ꡬ운감자슬림λͺ…λž€λ§ˆμš”',
content:
'ν• λ¨Έλ‹ˆκ°€ 먹을 κ±° 같은 λ§›μž…λ‹ˆλ‹€. 1960λ…„ μ „μŸ λ•Œ 맛 보고 μ‹Άμ—ˆλŠ”λ° κ·Έλ•ŒλŠ” λ„ˆλ¬΄ κ°€λ‚œν•΄μ„œ 먹을 수 μ—†μ—ˆλŠ”λ°μš” 이것보닀 κΈ΄ 리뷰도 잘렀 λ³΄μΈλ‹΅λ‹ˆλ‹€',
image: REVIEW_CARD_DEFAULT_IMAGE_URL,
},
};

export default meta;
type Story = StoryObj<typeof ReviewRankingItem>;

export const Default: Story = {};
export const Default: Story = {
args: {
tags: [
{
id: 5,
name: 'πŸ˜‹ λ§›μžˆμ–΄μš”',
tagType: 'TASTE',
},
{
id: 1,
name: '🍭 λ‹¬λ‹¬ν•΄μš”',
tagType: 'TASTE',
},
],
},
};

export const ExtraTag: Story = {
args: {
tags: [
{
id: 5,
name: 'πŸ˜‹ λ§›μžˆμ–΄μš”',
tagType: 'TASTE',
},
{
id: 1,
name: '🍭 속이 νŽΈν•΄μš”',
tagType: 'TASTE',
},
{
id: 2,
name: '🍭 λ‹¬λ‹¬ν•΄μš”',
tagType: 'TASTE',
},
],
},
};
Loading

0 comments on commit 8febefa

Please sign in to comment.