chore: ui and clear

This commit is contained in:
Joel 2025-06-25 16:45:21 +08:00
parent 2f241d932c
commit 93a560ee54
2 changed files with 17 additions and 6 deletions

View File

@ -24,25 +24,30 @@ const PluginsPicker: FC<Props> = ({
const { t } = useTranslation()
const hasSelected = value.length > 0
const isExcludeMode = updateMode === AUTO_UPDATE_MODE.exclude
const handleClear = () => {
onChange([])
}
return (
<div className='mt-2 rounded-[10px] bg-background-section-burn p-2.5'>
{hasSelected ? (
<div className='flex justify-between text-text-tertiary'>
<div className='system-xs-medium'>{t(`${i18nPrefix}.${isExcludeMode ? 'excludeUpdate' : 'partialUPdate'}`, { num: value.length })}</div>
<div className='system-xs-medium cursor-pointer'>Clear all</div>
<div className='system-xs-medium cursor-pointer' onClick={handleClear}>{t(`${i18nPrefix}.operation.clearAll`)}</div>
</div>
) : (
<NoPluginSelected updateMode={updateMode} />
)}
<PluginsSelected
className='mt-2'
plugins={value}
/>
{hasSelected && (
<PluginsSelected
className='mt-2'
plugins={value}
/>
)}
<Button className='mt-2 w-full' size='small' variant='secondary-accent'>
<RiAddLine className='size-3.5' />
Select
{t(`${i18nPrefix}.operation.select`)}
</Button>
</div>
)

View File

@ -143,6 +143,12 @@ const translation = {
exclude: '选定的插件将不会自动更新',
partial: '仅选定的插件将自动更新。目前未选择任何插件,因此不会自动更新任何插件。',
},
excludeUpdate: '以下 {{num}} 个插件将不会自动更新',
partialUPdate: '仅以下 {{num}} 个插件将自动更新',
operation: {
clearAll: '清除所有',
select: '选择插件',
},
nextUpdateTime: '下次自动更新时间: {{time}}',
pluginDowngradeWarning: {
title: '插件降级',