feat(frontend): show custom preferences

This commit is contained in:
Sam 2023-04-19 12:24:34 +02:00 committed by Gitea
parent 2c71741d7c
commit 8bda5f9860
7 changed files with 120 additions and 57 deletions

View file

@ -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;

View file

@ -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 {