app templates

This commit is contained in:
JzoNg
2024-02-24 14:21:42 +08:00
parent 14cfb310e3
commit 804a090457
11 changed files with 85 additions and 273 deletions

View File

@ -23,13 +23,15 @@ const Category: FC<ICategoryProps> = ({
}) => {
const { t } = useTranslation()
const itemClassName = (isSelected: boolean) => cn(isSelected ? 'bg-white text-primary-600 border-gray-200 font-semibold' : 'border-transparent font-medium', 'flex items-center h-7 px-3 border cursor-pointer rounded-lg')
const itemStyle = (isSelected: boolean) => isSelected ? { boxShadow: '0px 1px 2px rgba(16, 24, 40, 0.05)' } : {}
const itemClassName = (isSelected: boolean) => cn(
'px-3 py-[5px] h-[28px] rounded-lg border-[0.5px] border-transparent text-gray-700 font-medium leading-[18px] cursor-pointer hover:bg-gray-200',
isSelected && 'bg-white border-gray-200 shadow-xs text-primary-600 hover:bg-white',
)
return (
<div className={cn(className, 'flex space-x-1 text-[13px] flex-wrap')}>
<div
className={itemClassName(value === '')}
style={itemStyle(value === '')}
onClick={() => onChange('')}
>
{t('explore.apps.allCategories')}
@ -38,7 +40,6 @@ const Category: FC<ICategoryProps> = ({
<div
key={name}
className={itemClassName(name === value)}
style={itemStyle(name === value)}
onClick={() => onChange(name)}
>
{categoryI18n[name] ? t(`explore.category.${name}`) : name}