chore: ui and clear

pull/19758/head
Joel 11 months ago committed by Junyan Qin
parent 6ebc1c62f7
commit c62f0c8fcd
No known key found for this signature in database
GPG Key ID: 22FE3AFADC710CEB

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

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

Loading…
Cancel
Save