diff --git a/apps/shinkai-desktop/src/components/vector-fs/components/all-files-tab.tsx b/apps/shinkai-desktop/src/components/vector-fs/components/all-files-tab.tsx index 88a8ed139..87588ea80 100644 --- a/apps/shinkai-desktop/src/components/vector-fs/components/all-files-tab.tsx +++ b/apps/shinkai-desktop/src/components/vector-fs/components/all-files-tab.tsx @@ -228,8 +228,8 @@ const AllFiles = () => { > diff --git a/apps/shinkai-desktop/src/pages/analytics-settings.tsx b/apps/shinkai-desktop/src/pages/analytics-settings.tsx index 8876694a6..6cc4a713e 100644 --- a/apps/shinkai-desktop/src/pages/analytics-settings.tsx +++ b/apps/shinkai-desktop/src/pages/analytics-settings.tsx @@ -4,7 +4,7 @@ import { CheckIcon, XIcon } from 'lucide-react'; import { analyticsBulletPoints } from '../constants/analytics'; import { useSettings } from '../store/settings'; -import { SubpageLayout } from './layout/simple-layout'; +import { SimpleLayout } from './layout/simple-layout'; const AnalyticsSettingsPage = () => { const { t, Trans } = useTranslation(); @@ -13,9 +13,9 @@ const AnalyticsSettingsPage = () => { const acceptAnalytics = useSettings((state) => state.acceptAnalytics); return ( - +
-

{t('analytics.title')}

+

{t('analytics.title')}

    {analyticsBulletPoints().map((item) => ( @@ -54,7 +54,7 @@ const AnalyticsSettingsPage = () => { onClick={() => { denyAnalytics(); }} - size="lg" + size="sm" > {t('common.optOut')} @@ -64,14 +64,14 @@ const AnalyticsSettingsPage = () => { onClick={() => { acceptAnalytics(); }} - size="lg" + size="sm" > {t('common.optIn')} )}
-
+ ); }; diff --git a/apps/shinkai-desktop/src/pages/export-connection.tsx b/apps/shinkai-desktop/src/pages/export-connection.tsx index b6eef6aec..2a2a83aee 100644 --- a/apps/shinkai-desktop/src/pages/export-connection.tsx +++ b/apps/shinkai-desktop/src/pages/export-connection.tsx @@ -21,7 +21,7 @@ import { useEffect, useState } from 'react'; import { useForm } from 'react-hook-form'; import { useAuth } from '../store/auth'; -import { SubpageLayout } from './layout/simple-layout'; +import { SimpleLayout, SubpageLayout } from './layout/simple-layout'; export const ExportConnection = () => { const { t } = useTranslation(); @@ -75,8 +75,8 @@ export const ExportConnection = () => { } }; return ( - -
+ +
{ )} />
- @@ -135,6 +135,6 @@ export const ExportConnection = () => {
)} -
+ ); }; diff --git a/apps/shinkai-desktop/src/pages/galxe-validation.tsx b/apps/shinkai-desktop/src/pages/galxe-validation.tsx index 0cb4a9da4..ba7f53d85 100644 --- a/apps/shinkai-desktop/src/pages/galxe-validation.tsx +++ b/apps/shinkai-desktop/src/pages/galxe-validation.tsx @@ -1,16 +1,170 @@ import { useTranslation } from '@shinkai_network/shinkai-i18n'; +import { QuestNames } from '@shinkai_network/shinkai-message-ts/api/quests/types'; +import { useUpdateQuestsStatus } from '@shinkai_network/shinkai-node-state/v2/mutations/updateQuestsStatus/useUpdateQuestsStatus'; +import { useGetQuestsStatus } from '@shinkai_network/shinkai-node-state/v2/queries/getQuestsStatus/useGetQuestsStatus'; +import { Button, Skeleton } from '@shinkai_network/shinkai-ui'; +import { + Card, + CardDescription, + CardHeader, + CardTitle, +} from '@shinkai_network/shinkai-ui'; +import { Check, CircleIcon, RefreshCw } from 'lucide-react'; +import { useMemo } from 'react'; -import { GalxeSusbcriptions } from './galxe-subscriptions'; -import { SubpageLayout } from './layout/simple-layout'; +import { useAuth } from '../store/auth'; +import { SimpleLayout } from './layout/simple-layout'; +const questStatusInfoMap: Record< + QuestNames, + { name: string; description: string } +> = { + [QuestNames.InstalledApp]: { + name: 'App Installation', + description: 'Install Shinkai Desktop App.', + }, + [QuestNames.CreateIdentity]: { + name: 'Create Your Shinkai Identity', + description: + 'Get started by creating your unique identity on Shinkai. This is your first step to becoming part of the community.', + }, + [QuestNames.DownloadFromStore]: { + name: 'First Store Download', + description: + 'Download your first file from the Shinkai store. Explore the available resources and tools.', + }, + [QuestNames.ComeBack2Days]: { + name: 'Daily Explorer 2 Days', + description: + 'Show your commitment by returning to Shinkai for 2 consecutive days. Build a habit of regular engagement.', + }, + [QuestNames.ComeBack4Days]: { + name: 'Daily Explorer 4 Days', + description: + 'Show your commitment by returning to Shinkai for 4 consecutive days. Build a habit of regular engagement.', + }, + [QuestNames.ComeBack7Days]: { + name: 'Daily Explorer 7 Days', + description: + 'Show your commitment by returning to Shinkai for 7 consecutive days. Build a habit of regular engagement.', + }, + [QuestNames.CreateTool]: { + name: 'Tool Creator', + description: + 'Create and publish your first tool on Shinkai. Share your creativity with the community.', + }, + [QuestNames.SubmitAndGetApprovalForTool]: { + name: 'Submit and Get Approval for Tool', + description: + 'Submit your tool for review and get it approved by the Shinkai team. Ensure your creation meets our quality standards.', + }, + [QuestNames.SubmitAndGetApprovalFor2Tool]: { + name: 'Submit and Get Approval for 2 Tools', + description: + 'Submit your tool for review and get it approved by the Shinkai team. Ensure your creation meets our quality standards.', + }, + [QuestNames.SubmitAndGetApprovalFor3Tool]: { + name: 'Submit and Get Approval for 3 Tools', + description: + 'Submit your tool for review and get it approved by the Shinkai team. Ensure your creation meets our quality standards.', + }, + [QuestNames.FeaturedInRanking]: { + name: 'Featured in Ranking', + description: 'Get featured in the Shinkai ranking.', + }, + [QuestNames.WriteHonestReview]: { + name: 'Honest Reviewer', + description: + 'Write a detailed and honest review about your experience with Shinkai. Help others make informed decisions.', + }, + [QuestNames.Write5HonestReview]: { + name: 'Community Contributor', + description: + 'Help improve Shinkai by providing constructive feedback. Your input shapes the future of the platform.', + }, + [QuestNames.Write10HonestReview]: { + name: 'Community Contributor', + description: + 'Help improve Shinkai by providing constructive feedback. Your input shapes the future of the platform.', + }, + [QuestNames.UseRAG3Days]: { + name: 'RAG Explorer', + description: + 'Experience the power of Retrieval-Augmented Generation (RAG) by using it for 3 days. Discover how it enhances your workflow.', + }, +}; export const GalxeValidation = () => { const { t } = useTranslation(); + const auth = useAuth((state) => state.auth); + + const { data, isPending, isSuccess } = useGetQuestsStatus({ + nodeAddress: auth?.node_address ?? '', + token: auth?.api_v2_key ?? '', + }); + + const { mutate: updateQuestsStatus, isPending: isQuestsStatusUpdating } = + useUpdateQuestsStatus(); + + const quests = useMemo(() => { + return data?.data?.quests.map((quest) => ({ + key: quest.name, + name: questStatusInfoMap[quest.name].name, + description: questStatusInfoMap[quest.name].description, + progress: quest.status ? 100 : 0, + })); + }, [data]); return ( - -
- + + updateQuestsStatus({ + nodeAddress: auth?.node_address ?? '', + token: auth?.api_v2_key ?? '', + }) + } + size="xs" + > + {isQuestsStatusUpdating ? null : } + {isQuestsStatusUpdating ? 'Syncing...' : 'Sync Quests'} + + } + title={t('galxe.label')} + > +
+ {isPending && + Array.from({ length: 10 }).map((_, index) => ( + + ))} + {isSuccess && + quests?.map((quest, index) => ( + + + + {quest.progress === 100 ? ( +
+ +
+ ) : ( + + )} +
+
+ + {quest.name} + + + {quest.description} + +
+
+
+ ))}
- +
); }; diff --git a/apps/shinkai-desktop/src/pages/layout/settings-layout.tsx b/apps/shinkai-desktop/src/pages/layout/settings-layout.tsx index 8b5976430..862cfd7f7 100644 --- a/apps/shinkai-desktop/src/pages/layout/settings-layout.tsx +++ b/apps/shinkai-desktop/src/pages/layout/settings-layout.tsx @@ -159,12 +159,11 @@ export function MainNav() { galxe icon
), - disabled: true, }, ].filter(Boolean) as NavigationLink[]; return ( -