feat(frontend): add members to user page

This commit is contained in:
sam 2024-09-25 19:48:28 +02:00
parent f81ae97821
commit 6f79d35f11
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
7 changed files with 212 additions and 94 deletions

View file

@ -3,6 +3,7 @@ export type PartialUser = {
username: string;
display_name?: string | null;
avatar_url?: string | null;
custom_preferences: Record<string, CustomPreference>;
};
export type User = PartialUser & {
@ -12,7 +13,6 @@ export type User = PartialUser & {
names: FieldEntry[];
pronouns: Pronoun[];
fields: Field[];
custom_preferences: Record<string, CustomPreference>;
};
export type UserWithMembers = User & { members: PartialMember[] };
@ -35,6 +35,7 @@ export type PartialMember = {
avatar_url: string | null;
names: FieldEntry[];
pronouns: Pronoun[];
unlisted: boolean | null;
};
export type FieldEntry = {
@ -63,6 +64,10 @@ export enum PreferenceSize {
Small = "SMALL",
}
export function mergePreferences(prefs: Record<string, CustomPreference>) {
return Object.assign({}, defaultPreferences, prefs);
}
export const defaultPreferences = Object.freeze({
favourite: {
icon: "heart-fill",

View file

@ -0,0 +1 @@
export const defaultAvatarUrl = "https://pronouns.cc/default/512.webp";