diff --git a/.changeset/funny-pans-perform.md b/.changeset/funny-pans-perform.md new file mode 100644 index 0000000000..cb321cfb35 --- /dev/null +++ b/.changeset/funny-pans-perform.md @@ -0,0 +1,5 @@ +--- +"learn-card-app": patch +--- + +chore: [LC-1497] - Add AI Insights Empty Placeholder diff --git a/apps/learn-card-app/src/hooks/useLogout.tsx b/apps/learn-card-app/src/hooks/useLogout.tsx index a6357fdf3e..9d311e0edb 100644 --- a/apps/learn-card-app/src/hooks/useLogout.tsx +++ b/apps/learn-card-app/src/hooks/useLogout.tsx @@ -94,8 +94,6 @@ const useLogout = () => { console.error(e); } - closeAllModals(); - await logout(); // handle redirect from within LCA over web3Auth redirect @@ -109,6 +107,8 @@ const useLogout = () => { }); } }, 1000); + + closeAllModals(); }; return { handleLogout, isLoggingOut: isLoggingOut || web3AuthLoggingOut }; diff --git a/apps/learn-card-app/src/pages/ai-insights/AiInsights.tsx b/apps/learn-card-app/src/pages/ai-insights/AiInsights.tsx index 2d22954686..1e4cefa9ec 100644 --- a/apps/learn-card-app/src/pages/ai-insights/AiInsights.tsx +++ b/apps/learn-card-app/src/pages/ai-insights/AiInsights.tsx @@ -135,7 +135,7 @@ const AiInsights: React.FC = () => { {!flags?.hideAiPathways && } {topSkills.length > 0 && } - + {topSkills.length > 0 && } ); diff --git a/apps/learn-card-app/src/pages/ai-insights/AiInsightsEmptyPlaceholder.tsx b/apps/learn-card-app/src/pages/ai-insights/AiInsightsEmptyPlaceholder.tsx new file mode 100644 index 0000000000..26c6eb7e4f --- /dev/null +++ b/apps/learn-card-app/src/pages/ai-insights/AiInsightsEmptyPlaceholder.tsx @@ -0,0 +1,26 @@ +import React from 'react'; + +import { AiPathwaysIconWithShape } from 'learn-card-base/svgs/wallet/AiPathwaysIcon'; +import CheckListButton from '../../components/learncard/checklist/CheckListButton'; + +export const AiInsightsEmptyPlaceholder: React.FC = () => { + return ( +
+
+ +
+

+ No AI Insights yet. +

+

+ Build your LearnCard to unlock personalized learning insights and track your + skill development journey. +

+
+ +
+
+ ); +}; + +export default AiInsightsEmptyPlaceholder; diff --git a/apps/learn-card-app/src/pages/ai-insights/AiInsightsLearningSnapshotSkeletonLoader.tsx b/apps/learn-card-app/src/pages/ai-insights/AiInsightsLearningSnapshotSkeletonLoader.tsx new file mode 100644 index 0000000000..e4cabb5e81 --- /dev/null +++ b/apps/learn-card-app/src/pages/ai-insights/AiInsightsLearningSnapshotSkeletonLoader.tsx @@ -0,0 +1,40 @@ +import React from 'react'; + +import { IonSkeletonText } from '@ionic/react'; + +const AiInsightsLearningSnapshotsSkeletonLoader: React.FC = () => { + return ( +
+
+ + + +
+ + + +
+ + + +
+
+ ); +}; + +export default AiInsightsLearningSnapshotsSkeletonLoader; diff --git a/apps/learn-card-app/src/pages/ai-insights/AiInsightsLearningSnapshots.tsx b/apps/learn-card-app/src/pages/ai-insights/AiInsightsLearningSnapshots.tsx index a383966d8b..466fbbd2d3 100644 --- a/apps/learn-card-app/src/pages/ai-insights/AiInsightsLearningSnapshots.tsx +++ b/apps/learn-card-app/src/pages/ai-insights/AiInsightsLearningSnapshots.tsx @@ -1,10 +1,11 @@ import React from 'react'; -import { IonSkeletonText } from '@ionic/react'; import Trophy from 'learn-card-base/svgs/Trophy'; -import WrenchIcon from 'learn-card-base/svgs/WrenchIcon'; import SproutIcon from 'learn-card-base/svgs/SproutIcon'; +import WrenchIcon from 'learn-card-base/svgs/WrenchIcon'; +import AiInsightsEmptyPlaceholder from './AiInsightsEmptyPlaceholder'; import { AiPathwaysIconWithShape } from 'learn-card-base/svgs/wallet/AiPathwaysIcon'; +import AiInsightsLearningSnapshotsSkeletonLoader from './AiInsightsLearningSnapshotSkeletonLoader'; import { useAiInsightCredential } from 'learn-card-base'; @@ -51,40 +52,11 @@ const AiInsightsLearningSnapshots: React.FC<{ isLoading: boolean }> = ({ isLoadi ]; if (isLoading || aiInsightCredentialLoading) { - return ( -
-
- - - -
- - - -
- - - -
-
- ); + return ; } + if (!aiInsightCredential) return ; + return (