Icon pack import: the install screen gets the row's full width

This commit is contained in:
CRTkafa 2026-10-01 04:54:37 +07:00
parent da4b55209b
commit 257c47b8dd
2 changed files with 4 additions and 2 deletions

View file

@ -210,7 +210,7 @@ export function Appearance({ notify }: { notify: Notify }) {
<ColorField label={t('wb.appearance.accentColor')} value={choice.accent} swatches={[...themes.accents]} autoLabel={t('wb.appearance.theme')} onChange={accent => void update({ ...choice, accent })}/> <ColorField label={t('wb.appearance.accentColor')} value={choice.accent} swatches={[...themes.accents]} autoLabel={t('wb.appearance.theme')} onChange={accent => void update({ ...choice, accent })}/>
</Row> </Row>
{themes.iconPacks?.length ? <Row label={t('wb.appearance.icons')} hint={t('wb.appearance.iconsHint')} keywords="icon pack glyphs symbols pixel import" wide> {themes.iconPacks?.length ? <Row label={t('wb.appearance.icons')} hint={t('wb.appearance.iconsHint')} keywords="icon pack glyphs symbols pixel import" wide>
<div className="bt-inline"> <div className="wb-pack-row"><div className="bt-inline">
<Select label={t('wb.appearance.icons')} value={choice.icons ?? 'theme'} width={220} <Select label={t('wb.appearance.icons')} value={choice.icons ?? 'theme'} width={220}
onChange={icons => void update({ ...choice, icons: icons === 'theme' ? undefined : icons })} onChange={icons => void update({ ...choice, icons: icons === 'theme' ? undefined : icons })}
options={[{ value: 'theme', label: t('wb.appearance.icons.theme') }, { value: 'site', label: t('wb.appearance.icons.site') }, ...themes.iconPacks.filter(pack => !choice.packs?.some(item => item.id === pack.id)).map(pack => ({ value: pack.id, label: pack.name })), ...(choice.packs ?? []).map(pack => ({ value: pack.id, label: pack.name }))]}/> options={[{ value: 'theme', label: t('wb.appearance.icons.theme') }, { value: 'site', label: t('wb.appearance.icons.site') }, ...themes.iconPacks.filter(pack => !choice.packs?.some(item => item.id === pack.id)).map(pack => ({ value: pack.id, label: pack.name })), ...(choice.packs ?? []).map(pack => ({ value: pack.id, label: pack.name }))]}/>
@ -218,7 +218,7 @@ export function Appearance({ notify }: { notify: Notify }) {
</div> </div>
{choice.packs?.length ? <div className="bt-inline wb-pack-list" aria-label={t('wb.appearance.icons.imported')}>{choice.packs.map(pack => <Button key={pack.id} size="sm" tone="ghost" onClick={() => void update({ ...choice, packs: choice.packs!.filter(item => item.id !== pack.id), ...(choice.icons === pack.id ? { icons: undefined } : {}) }).then(() => notify(t('wb.appearance.icons.removed', { name: pack.name })))}>{t('wb.appearance.icons.remove', { name: pack.name })}</Button>)}</div> : null} {choice.packs?.length ? <div className="bt-inline wb-pack-list" aria-label={t('wb.appearance.icons.imported')}>{choice.packs.map(pack => <Button key={pack.id} size="sm" tone="ghost" onClick={() => void update({ ...choice, packs: choice.packs!.filter(item => item.id !== pack.id), ...(choice.icons === pack.id ? { icons: undefined } : {}) }).then(() => notify(t('wb.appearance.icons.removed', { name: pack.name })))}>{t('wb.appearance.icons.remove', { name: pack.name })}</Button>)}</div> : null}
{packReview && <IconPackReview {...packReview} replaces={!!choice.packs?.some(item => item.id === packReview.pack.id)} onCancel={() => setPackReview(null)} {packReview && <IconPackReview {...packReview} replaces={!!choice.packs?.some(item => item.id === packReview.pack.id)} onCancel={() => setPackReview(null)}
onInstall={() => { const { pack } = packReview; setPackReview(null); void update({ ...choice, packs: [...(choice.packs ?? []).filter(item => item.id !== pack.id), pack], icons: pack.id }).then(() => notify(t('wb.appearance.icons.installed', { name: pack.name }))); }}/>} onInstall={() => { const { pack } = packReview; setPackReview(null); void update({ ...choice, packs: [...(choice.packs ?? []).filter(item => item.id !== pack.id), pack], icons: pack.id }).then(() => notify(t('wb.appearance.icons.installed', { name: pack.name }))); }}/>}</div>
</Row> : null} </Row> : null}
<Row label={t('wb.appearance.fonts')} hint={t('wb.appearance.fontsHint')} <Row label={t('wb.appearance.fonts')} hint={t('wb.appearance.fontsHint')}
keywords="typeface typography family font google fonts post text heading numbers code interface window dialogs" wide> keywords="typeface typography family font google fonts post text heading numbers code interface window dialogs" wide>

View file

@ -397,3 +397,5 @@
.wb-pack-grid .bt-glyph { width: 20px; height: 20px; } .wb-pack-grid .bt-glyph { width: 20px; height: 20px; }
.wb-pack-warning { color: var(--c-warn, #d9a441); font-size: 12px; } .wb-pack-warning { color: var(--c-warn, #d9a441); font-size: 12px; }
.wb-pack-list { flex-wrap: wrap; margin-top: 6px; } .wb-pack-list { flex-wrap: wrap; margin-top: 6px; }
.wb-pack-row { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.wb-pack-review { width: 100%; max-width: 560px; box-sizing: border-box; }