From 816998b867d8c38b6828dad72dcd886b3c733424 Mon Sep 17 00:00:00 2001 From: paulclindo Date: Fri, 7 Feb 2025 12:21:50 -0500 Subject: [PATCH 1/8] fixes and add new galxe quests UI --- .../vector-fs/components/all-files-tab.tsx | 4 +- .../src/pages/analytics-settings.tsx | 12 +- .../src/pages/export-connection.tsx | 10 +- .../src/pages/galxe-validation.tsx | 117 +++++++++++++++++- .../src/pages/layout/settings-layout.tsx | 7 +- .../src/pages/prompt-library.tsx | 2 +- .../shinkai-desktop/src/pages/public-keys.tsx | 6 +- apps/shinkai-desktop/src/pages/settings.tsx | 12 +- 8 files changed, 137 insertions(+), 33 deletions(-) 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..1d3a9d684 100644 --- a/apps/shinkai-desktop/src/pages/galxe-validation.tsx +++ b/apps/shinkai-desktop/src/pages/galxe-validation.tsx @@ -1,16 +1,121 @@ import { useTranslation } from '@shinkai_network/shinkai-i18n'; +import { Button, Progress } from '@shinkai_network/shinkai-ui'; +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, +} from '@shinkai_network/shinkai-ui'; +import { Loader2, RefreshCw } from 'lucide-react'; +import { useState } from 'react'; +import { toast } from 'sonner'; -import { GalxeSusbcriptions } from './galxe-subscriptions'; -import { SubpageLayout } from './layout/simple-layout'; +import { SimpleLayout } from './layout/simple-layout'; +interface Quest { + name: string; + description: string; + progress: number; +} + +const initialQuests: Quest[] = [ + { + name: 'The Coding Initiate', + description: 'Complete your first programming challenge', + progress: 100, + }, + { + name: 'Bug Hunter', + description: 'Find and fix 5 bugs in the codebase', + progress: 60, + }, + { + name: 'Feature Fanatic', + description: 'Implement a new feature from start to finish', + progress: 30, + }, + { + name: 'Test Master', + description: 'Achieve 90% test coverage on a module', + progress: 0, + }, + { + name: 'Documentation Dynamo', + description: 'Update and improve project documentation', + progress: 75, + }, + { + name: 'Code Reviewer', + description: 'Review and provide feedback on 10 pull requests', + progress: 50, + }, +]; export const GalxeValidation = () => { const { t } = useTranslation(); + const [quests, setQuests] = useState(initialQuests); + const [isSyncing, setIsSyncing] = useState(false); + + const handleSync = async () => { + setIsSyncing(true); + + await new Promise((resolve) => setTimeout(resolve, 2000)); + + const updatedQuests = quests.map((quest) => ({ + ...quest, + progress: Math.min(100, quest.progress + Math.floor(Math.random() * 30)), + })); + + setQuests(updatedQuests); + setIsSyncing(false); + toast.success('Sync Completed', { + description: 'Your quest progress has been updated.', + }); + }; return ( - -
- + + {isSyncing ? ( + <> + + Syncing... + + ) : ( + <> + + Sync Progress + + )} + + } + title={t('galxe.label')} + > +
+ {quests.map((quest, index) => ( + + + + {quest.name} + + + {quest.description} + + + + +

+ Progress: {quest.progress}% +

+
+
+ ))}
- +
); }; 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 ( -