mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-04-24 03:00:09 -04:00
* feat: set up quests dashboard move quest explorer to /quests/general * feat: prepare containers for path-of-the-engaged and initiation quests * chore(release): 0.2.0 * feat: add metacollab and web 3 onboarding categories * feat: move initiation quests from notion -> metaOS awyiss it's happening * chore: lint quickfix * feat: add descriptions, objectives, checkbox, collapse/expand * add Dockerfile to .gitignore * go * quick fix * upload proof modal * config and install * upload proof works * show status of quests (pending, etc..) * remove initiation & update engaged quests * fix quest categories add bridgebuilders, builders, patrons, fix icons * typecheck fix * fix address for bridgebuilders quests * design of chain progress + small fix * minor fixes * using latest version of quest-chains sdk * basic UI for quests * using children for react-markdown * better styling for quest tiles * completed quest chain styling * fixed toasts * fixed imageLink * added link to quest chains * minor fixes * added back to onboarding paths link * fixed external link icon as absolute pos * reduce gaps for mobile Co-authored-by: Vid <vid@meisterlabs.com> Co-authored-by: dan13ram <dan13ram@gmail.com>
49 lines
1.3 KiB
TypeScript
49 lines
1.3 KiB
TypeScript
import { graphql } from '@quest-chains/sdk';
|
|
import { useMemo } from 'react';
|
|
|
|
export type UserStatusType = {
|
|
[questId: string]: {
|
|
submissions: {
|
|
description: string | undefined | null;
|
|
externalUrl: string | undefined | null;
|
|
timestamp: string;
|
|
}[];
|
|
reviews: {
|
|
description: string | undefined | null;
|
|
externalUrl: string | undefined | null;
|
|
timestamp: string;
|
|
reviewer: string;
|
|
accepted: boolean;
|
|
}[];
|
|
status: graphql.Status;
|
|
};
|
|
};
|
|
|
|
export const useUserStatus = (
|
|
questStatuses: graphql.QuestStatusInfoFragment[],
|
|
): UserStatusType => {
|
|
const userStatus: UserStatusType = useMemo(() => {
|
|
const userStat: UserStatusType = {};
|
|
questStatuses.forEach((item) => {
|
|
userStat[item.quest.questId] = {
|
|
status: item.status,
|
|
submissions: item.submissions.map((sub) => ({
|
|
description: sub.description,
|
|
externalUrl: sub.externalUrl,
|
|
timestamp: sub.timestamp,
|
|
})),
|
|
reviews: item.reviews.map((sub) => ({
|
|
description: sub.description,
|
|
externalUrl: sub.externalUrl,
|
|
timestamp: sub.timestamp,
|
|
accepted: sub.accepted,
|
|
reviewer: sub.reviewer.id,
|
|
})),
|
|
};
|
|
});
|
|
return userStat;
|
|
}, [questStatuses]);
|
|
|
|
return userStatus;
|
|
};
|