Skip to content

Commit

Permalink
change: use ProfileClass on GroupContext
Browse files Browse the repository at this point in the history
  • Loading branch information
NiiMiyo committed Dec 2, 2023
1 parent e6a96fe commit 949a8ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/pages/Group/Group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { GroupContext, GroupIntro, GroupTabRenderer, GroupTabs, fetchGroupPageDa
import { ProfileInfo } from "@/components/ProfileInfo/ProfileInfo";
import { AuthContext } from "@/contexts/Auth";
import "./Group.less";
import { ProfileClass } from "@/types/Profile";

export function GroupPage() {
const page = useLoaderData() as GroupPageLoaderResponse;
Expand Down Expand Up @@ -72,11 +73,11 @@ export function GroupPage() {
group: data.group!,
loggedData: {
isParticipant: data.loggedData?.isParticipant!,
profile: data.loggedData?.profile!,
profile: new ProfileClass(data.loggedData?.profile!),
links: data.loggedData?.links ?? [],
groups: data.loggedData?.groups ?? [],
},
participants: data.participants,
participants: data.participants.map(ProfileClass.new),
subgroups: data.subGroups,

currentContent: undefined,
Expand Down
6 changes: 3 additions & 3 deletions src/pages/Group/GroupContext.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { createContext } from "react";
import { Group } from "@/types/Group";
import { Profile } from "@/types/Profile";
import { type ProfileClass } from "@/types/Profile";
import type { Content, Folder } from "@/types/Capacity";
import { Link } from "@/types/Link";

export type GroupContextType = null | {
group: Group;
subgroups: Group[];
participants: Profile[];
participants: ProfileClass[];
folders: Folder[];

currentContent: Folder | undefined;
Expand All @@ -33,7 +33,7 @@ export type GroupContextType = null | {

loggedData: {
isParticipant: boolean;
profile: Profile;
profile: ProfileClass;
links: Link[];
groups: Group[];
};
Expand Down

0 comments on commit 949a8ab

Please sign in to comment.