feat(note_bars/collection): add icon to checkboxes

This commit is contained in:
Elian Doran 2025-12-11 19:44:22 +02:00
parent 9f4757af5b
commit e766b82418
No known key found for this signature in database
2 changed files with 7 additions and 1 deletions

View File

@ -67,6 +67,7 @@ function ViewOptions({ note, viewType }: { note: FNote, viewType: ViewTypeOption
<ViewProperty note={note} property={{ <ViewProperty note={note} property={{
type: "checkbox", type: "checkbox",
icon: "bx bx-archive",
label: t("book_properties.include_archived_notes"), label: t("book_properties.include_archived_notes"),
bindToLabel: "includeArchived" bindToLabel: "includeArchived"
} as CheckBoxProperty} /> } as CheckBoxProperty} />
@ -126,6 +127,7 @@ function CheckBoxPropertyView({ note, property }: { note: FNote, property: Check
const [ value, setValue ] = useNoteLabelBoolean(note, property.bindToLabel); const [ value, setValue ] = useNoteLabelBoolean(note, property.bindToLabel);
return ( return (
<FormListToggleableItem <FormListToggleableItem
icon={property.icon}
title={property.label} title={property.label}
currentValue={value} currentValue={value}
onChange={setValue} onChange={setValue}

View File

@ -18,7 +18,8 @@ interface BookConfig {
export interface CheckBoxProperty { export interface CheckBoxProperty {
type: "checkbox", type: "checkbox",
label: string; label: string;
bindToLabel: FilterLabelsByType<boolean> bindToLabel: FilterLabelsByType<boolean>;
icon?: string;
} }
export interface ButtonProperty { export interface ButtonProperty {
@ -107,11 +108,13 @@ export const bookPropertiesConfig: Record<ViewTypeOptions, BookConfig> = {
properties: [ properties: [
{ {
label: t("book_properties_config.hide-weekends"), label: t("book_properties_config.hide-weekends"),
icon: "bx bx-calendar-week",
type: "checkbox", type: "checkbox",
bindToLabel: "calendar:hideWeekends" bindToLabel: "calendar:hideWeekends"
}, },
{ {
label: t("book_properties_config.display-week-numbers"), label: t("book_properties_config.display-week-numbers"),
icon: "bx bx-hash",
type: "checkbox", type: "checkbox",
bindToLabel: "calendar:weekNumbers" bindToLabel: "calendar:weekNumbers"
} }
@ -147,6 +150,7 @@ export const bookPropertiesConfig: Record<ViewTypeOptions, BookConfig> = {
}, },
{ {
label: t("book_properties_config.show-scale"), label: t("book_properties_config.show-scale"),
icon: "bx bx-ruler",
type: "checkbox", type: "checkbox",
bindToLabel: "map:scale" bindToLabel: "map:scale"
} }