Skip to content

Commit

Permalink
fix: grid, flex 다른 방법으로 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
hae-on committed Apr 23, 2024
1 parent 0ab1095 commit 7c1b728
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/components/Product/ProductList/productList.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { style } from '@vanilla-extract/css';

export const container = style({
display: 'grid',
gridTemplateColumns: 'repeat(2, 1fr)',
gridTemplateColumns: 'minmax(0, 1fr) 1fr',
gridAutoRows: 'auto',
columnGap: 10,
rowGap: 20,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Link } from 'react-router-dom';

import { container } from './productPreviewList.css';
import { container, productItemWrapper } from './productPreviewList.css';
import ProductItem from '../ProductItem/ProductItem';

import { PATH } from '@/constants/path';
Expand All @@ -23,7 +23,7 @@ const ProductPreviewList = ({ categoryId }: ProductPreviewListProps) => {
return (
<ul className={container}>
{productToDisplay.map((product) => (
<li key={product.id}>
<li key={product.id} className={productItemWrapper}>
<Link to={`${PATH.PRODUCT_LIST}/detail/${product.id}`}>
<ProductItem product={product} />
</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ export const container = style({
padding: '0 20px',
overflowX: 'auto',
});

export const productItemWrapper = style({
minWidth: 163,
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { style } from '@vanilla-extract/css';

export const container = style({
display: 'grid',
gridTemplateColumns: 'repeat(2, 1fr)',
gridTemplateColumns: 'minmax(0, 1fr) 1fr',
gridAutoRows: 'auto',
columnGap: 10,
rowGap: 20,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { style } from '@vanilla-extract/css';
export const reviewImage = style({
width: '100%',
height: 'auto',
minWidth: 164,
borderRadius: '6px',
objectFit: 'cover',
aspectRatio: '164 / 90',
Expand Down
4 changes: 2 additions & 2 deletions src/components/Rank/ReviewRankingList/ReviewRankingList.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Link } from 'react-router-dom';

import { container } from './reviewRankingList.css';
import { container, reviewItemWrapper } from './reviewRankingList.css';
import ReviewRankingItem from '../ReviewRankingItem/ReviewRankingItem';

import { PATH } from '@/constants/path';
Expand All @@ -20,7 +20,7 @@ const ReviewRankingList = () => {
return (
<ul className={container}>
{reviews.map(({ reviewId, productName, content, tags, image }) => (
<li key={reviewId}>
<li key={reviewId} className={reviewItemWrapper}>
<Link to={`${PATH.REVIEW}/${reviewId}`} onClick={handleReviewRankingLinkClick}>
<ReviewRankingItem productName={productName} content={content} tags={tags} image={image} />
</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ export const container = style({
gap: 10,
padding: '0 20px',
});

export const reviewItemWrapper = style({
minWidth: 164,
});
2 changes: 1 addition & 1 deletion src/components/Recipe/RecipeList/recipeList.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { style } from '@vanilla-extract/css';

export const container = style({
display: 'grid',
gridTemplateColumns: 'repeat(2, 1fr)',
gridTemplateColumns: 'minmax(0, 1fr) 1fr',
gridAutoRows: 'auto',
columnGap: 10,
rowGap: 20,
Expand Down
1 change: 0 additions & 1 deletion src/styles/common.css.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { style } from '@vanilla-extract/css';

export const ellipsis = style({
maxWidth: 163,
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
Expand Down

0 comments on commit 7c1b728

Please sign in to comment.