Skip to content

Commit

Permalink
style: 칩 컴포넌트 스타일 수정 및 칩 컨테이너 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
HoberMin committed Jun 21, 2024
1 parent 81301c2 commit f0695ae
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 21 deletions.
1 change: 1 addition & 0 deletions src/apis/postList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ interface PostListSort {
unsorted: boolean;
sorted: boolean;
}

export interface PostList {
content: PostListContent[];
pageable: PostListPageable;
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/Chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ReactNode } from 'react';
import { type VariantProps, cva } from 'class-variance-authority';

const chipCSS = cva(
'flex w-fit items-center whitespace-nowrap rounded-[20px] border border-gray-accent2 px-4 py-2 text-sm font-semibold',
'text-title-1-md flex w-fit items-center whitespace-nowrap rounded-[30px] border border-gray-accent2 px-3 py-1.5',
{
variants: {
variant: {
Expand Down
36 changes: 17 additions & 19 deletions src/app/_components/ChipContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,24 @@ interface ChipContainerProps {

const ChipContainer = ({ currentChannel = 'all' }: ChipContainerProps) => {
return (
<div className='bg-dark-accent2 sticky top-0 overflow-x-auto'>
<ul className='flex flex-nowrap gap-2 px-4 py-2'>
{channelData.map(({ name, path }, index) => {
const variant = path === currentChannel ? 'selected' : 'default';
<ul className='flex items-center gap-2 px-4 py-2'>
{channelData.map(({ name, path }, index) => {
const variant = path === currentChannel ? 'selected' : 'default';

return (
<li key={`${index}-${name}`}>
<Link
href={{
pathname: '/',
query: path === 'all' ? {} : { channel: path },
}}
>
<Chip variant={variant}>{name}</Chip>
</Link>
</li>
);
})}
</ul>
</div>
return (
<li key={`${index}-${name}`}>
<Link
href={{
pathname: '/',
query: path === 'all' ? {} : { channel: path },
}}
>
<Chip variant={variant}>{name}</Chip>
</Link>
</li>
);
})}
</ul>
);
};

Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/PostItem.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Image from 'next/image';

import { PostListContent } from '@/src/apis/postList';
import { isValidImageUrl } from '@/src/app/(main)/utils';
import Icon from '@/src/components/Icon';
import { isValidImageUrl } from '@/src/utils/isValidImageUrl';

interface PostItemProps {
post: PostListContent;
Expand Down

0 comments on commit f0695ae

Please sign in to comment.