feat(plugins/settings): add optional descriptions for plugin list filters
This commit is contained in:
parent
408c8463ac
commit
ab81c4b726
2 changed files with 6 additions and 1 deletions
|
|
@ -9,6 +9,7 @@ export interface FilterAndSortActionSheetProps {
|
|||
string,
|
||||
{
|
||||
icon: AssetId
|
||||
desc?: string
|
||||
filter: (p: AnyPlugin, meta: InternalPluginMeta) => boolean
|
||||
}
|
||||
>
|
||||
|
|
@ -57,7 +58,7 @@ export default function FilterAndSortActionSheet({
|
|||
<ActionSheet>
|
||||
<BottomSheetTitleHeader title="Filter & Sort" />
|
||||
<TableRowGroup title="Filter by">
|
||||
{Object.entries(filters).map(([label, { icon }]) => {
|
||||
{Object.entries(filters).map(([label, { icon, desc }]) => {
|
||||
const checked = filter_.includes(label)
|
||||
|
||||
return (
|
||||
|
|
@ -65,6 +66,7 @@ export default function FilterAndSortActionSheet({
|
|||
key={label}
|
||||
icon={<TableRowAssetIcon id={icon} />}
|
||||
label={label}
|
||||
subLabel={desc}
|
||||
value={label}
|
||||
checked={checked}
|
||||
onPress={() => {
|
||||
|
|
|
|||
|
|
@ -65,14 +65,17 @@ const Filters: FilterAndSortActionSheetProps['filters'] = {
|
|||
},
|
||||
Internal: {
|
||||
icon: RevengeIcon,
|
||||
desc: 'Included with Revenge.',
|
||||
filter: (_, meta) => isPluginInternal(meta),
|
||||
},
|
||||
Essential: {
|
||||
icon: getAssetIdByName('StarIcon')!,
|
||||
desc: 'Required for Revenge to function properly.',
|
||||
filter: (_, meta) => isPluginEssential(meta),
|
||||
},
|
||||
'Non-APIs': {
|
||||
icon: getAssetIdByName('PaperIcon')!,
|
||||
desc: 'Exclude essential plugins that provide APIs for other plugins.',
|
||||
filter: (_, meta) =>
|
||||
!(meta.iflags & InternalPluginFlags.ImplicitDependency),
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue