Feat: add theme switcher (#18093)

This commit is contained in:
KVOJJJin
2025-05-14 09:06:14 +08:00
committed by GitHub
parent 297d35364e
commit 3548c133e3
23 changed files with 330 additions and 54 deletions

View File

@@ -31,8 +31,8 @@ const Category: FC<ICategoryProps> = ({
const isAllCategories = !list.includes(value as AppCategory) || value === allCategoriesEn
const itemClassName = (isSelected: boolean) => cn(
'flex h-[32px] cursor-pointer items-center rounded-lg border-[0.5px] border-transparent px-3 py-[7px] font-medium leading-[18px] text-gray-700 hover:bg-gray-200',
isSelected && 'border-gray-200 bg-white text-primary-600 shadow-xs hover:bg-white',
'flex h-[32px] cursor-pointer items-center rounded-lg border-[0.5px] border-transparent px-3 py-[7px] font-medium leading-[18px] text-text-tertiary hover:bg-components-main-nav-nav-button-bg-active',
isSelected && 'border-components-main-nav-nav-button-border bg-components-main-nav-nav-button-bg-active text-components-main-nav-nav-button-text-active shadow-xs',
)
return (
@@ -50,7 +50,7 @@ const Category: FC<ICategoryProps> = ({
className={itemClassName(name === value)}
onClick={() => onChange(name)}
>
{categoryI18n[name] ? t(`explore.category.${name}`) : name}
{(categoryI18n as any)[name] ? t(`explore.category.${name}`) : name}
</div>
))}
</div>