Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ export const CustomizedExploreContent = () => {
key={filterItem.key}
label={filterItem.label}
pressed={appliedFilterKeys.includes(filterItem.key)}
icon={filterItem.icon}
onPress={() => handleFilterPress(filterItem.key)}
/>
))}
Expand Down
26 changes: 6 additions & 20 deletions src/domains/home/model/buddy-filter.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
import type { SVGProps } from 'react';

import {
AgeIcon,
CertificationIcon,
CompanionIcon,
CountryIcon,
DateIcon,
GenderIcon,
} from '@/shared/components/icons';

export type BuddyFilterKey =
| 'country'
| 'date'
Expand All @@ -17,17 +6,14 @@ export type BuddyFilterKey =
| 'buddyType'
| 'verification';

export type BuddyFilterIcon = React.ComponentType<SVGProps<SVGSVGElement>>;

export const buddyFilterItems = [
{ key: 'country', label: '국가', icon: CountryIcon },
{ key: 'date', label: '날짜', icon: DateIcon },
{ key: 'age', label: '나이', icon: AgeIcon },
{ key: 'gender', label: '성별', icon: GenderIcon },
{ key: 'buddyType', label: '동행 유형', icon: CompanionIcon },
{ key: 'verification', label: '인증 상태', icon: CertificationIcon },
{ key: 'country', label: '국가' },
{ key: 'date', label: '날짜' },
{ key: 'age', label: '나이' },
{ key: 'gender', label: '성별' },
{ key: 'buddyType', label: '동행 유형' },
{ key: 'verification', label: '인증 상태' },
] satisfies {
key: BuddyFilterKey;
label: string;
icon?: BuddyFilterIcon;
}[];
1 change: 0 additions & 1 deletion src/domains/home/sections/buddy-search-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ export const BuddySearchSection = () => {
key={filterItem.key}
label={filterItem.label}
pressed={appliedFilterKeys.includes(filterItem.key)}
icon={filterItem.icon}
onPress={() => handleFilterPress(filterItem.key)}
/>
))}
Expand Down
19 changes: 5 additions & 14 deletions src/shared/components/ui/filter/filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { cn } from '@/lib/cn';
const FILTER_STYLES = {
default: {
bg: 'bg-white',
text: 'text-gray-800',
border: 'border border-gray-300',
text: 'text-gray-500',
border: 'border border-gray-100',
},
pressed: {
bg: 'bg-gray-800',
Expand All @@ -15,21 +15,13 @@ const FILTER_STYLES = {
},
};

type IconComponent = React.ComponentType<React.SVGProps<SVGSVGElement>>;

export interface FilterProps {
label: string;
pressed: boolean;
onPress: () => void;
icon?: IconComponent;
}

export const Filter = ({
label,
pressed,
onPress,
icon: Icon,
}: FilterProps) => {
export const Filter = ({ label, pressed, onPress }: FilterProps) => {
const { bg, text, border } = FILTER_STYLES[pressed ? 'pressed' : 'default'];

return (
Expand All @@ -38,13 +30,12 @@ export const Filter = ({
onClick={onPress}
aria-pressed={pressed}
className={cn(
'inline-flex shrink-0 items-center gap-1.5 rounded-[30px] py-2.5 pr-4 pl-3',
'inline-flex shrink-0 items-center gap-1.5 rounded-[30px] px-4 py-2',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

아이콘이 제거되면서 버튼 내부 요소가 label 하나만 남아서 gap-1.5는 더 이상 필요하지 않을 것 같아요.

동작에는 영향 없지만 아이콘 관련 스타일을 정리하는 김에 함께 제거해도 좋을 것 같습니다!

bg,
border,
)}
>
{Icon && <Icon aria-hidden="true" className={cn('size-5', text)} />}
<span className={cn('text-body-sb-14', text)}>{label}</span>
<span className={cn('text-body-r-14', text)}>{label}</span>
</button>
);
};
2 changes: 1 addition & 1 deletion src/shared/components/ui/tab/tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const Tab = ({ items, value, onChange }: TabProps) => {
className={cn(
'text-body-sb-15 flex-1 border-b-[3px] px-17.5 py-4.5 active:bg-gray-50',
isSelected
? 'border-b-gray-800 text-gray-800'
? 'border-b-mint-300 text-mint-300'
: 'border-transparent text-gray-200',
)}
onClick={() => onChange(item.value)}
Expand Down
Loading