diff --git a/frontend/src/lib/api/default_preferences.ts b/frontend/src/lib/api/default_preferences.ts new file mode 100644 index 0000000..ad8a2dc --- /dev/null +++ b/frontend/src/lib/api/default_preferences.ts @@ -0,0 +1,41 @@ +import { type CustomPreferences, PreferenceSize } from "./entities"; + +const defaultPreferences: CustomPreferences = { + favourite: { + icon: "heart-fill", + tooltip: "Favourite", + size: PreferenceSize.Large, + muted: false, + favourite: true, + }, + okay: { + icon: "hand-thumbs-up", + tooltip: "Okay", + size: PreferenceSize.Normal, + muted: false, + favourite: false, + }, + jokingly: { + icon: "emoji-laughing", + tooltip: "Jokingly", + size: PreferenceSize.Normal, + muted: false, + favourite: false, + }, + friends_only: { + icon: "people", + tooltip: "Friends only", + size: PreferenceSize.Normal, + muted: false, + favourite: false, + }, + avoid: { + icon: "people", + tooltip: "Avoid", + size: PreferenceSize.Small, + muted: true, + favourite: false, + }, +}; + +export default defaultPreferences; diff --git a/frontend/src/lib/api/entities.ts b/frontend/src/lib/api/entities.ts index 70dd2a6..b5cac81 100644 --- a/frontend/src/lib/api/entities.ts +++ b/frontend/src/lib/api/entities.ts @@ -16,6 +16,25 @@ export interface User { pronouns: Pronoun[]; members: PartialMember[]; fields: Field[]; + custom_preferences: CustomPreferences; +} + +export interface CustomPreferences { + [key: string]: CustomPreference; +} + +export interface CustomPreference { + icon: string; + tooltip: string; + size: PreferenceSize; + muted: boolean; + favourite: boolean; +} + +export enum PreferenceSize { + Large = "large", + Normal = "normal", + Small = "small", } export interface MeUser extends User { @@ -80,6 +99,7 @@ export interface MemberPartialUser { name: string; display_name: string | null; avatar: string | null; + custom_preferences: CustomPreferences; } export interface Invite { diff --git a/frontend/src/lib/components/FieldCard.svelte b/frontend/src/lib/components/FieldCard.svelte index 9d2a9f5..8abaffd 100644 --- a/frontend/src/lib/components/FieldCard.svelte +++ b/frontend/src/lib/components/FieldCard.svelte @@ -1,16 +1,17 @@