Skip to content

Commit 0f68bf3

Browse files
committed
feat: Enhance Analytics UI and Pokemon Referral Card
- Add gradient backgrounds to Analytics components with theme support - Add 'Coming Soon' badges to Demos and Engagement tabs - Improve Pokemon Referral Card with Experience Points in stats - Optimize GIF generation with simplified 4-frame approach - Fix TypeScript build errors in analytics components - Update theme classes for consistent gradient styling - Enhance button animations and progress indicators
1 parent bb6676f commit 0f68bf3

8 files changed

Lines changed: 672 additions & 440 deletions

File tree

analytics/components/AccountAnalytics.tsx

Lines changed: 137 additions & 91 deletions
Large diffs are not rendered by default.

analytics/components/AnalyticsDashboard.tsx

Lines changed: 55 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ import { FeedbackAnalytics } from './FeedbackAnalytics';
77
import { AnalyticsView } from '../types';
88
import { ThemeToggle } from '@/components/ui/ThemeToggle';
99
import { useTheme } from '@/contexts/ui/ThemeContext';
10+
import Image from 'next/image';
11+
12+
interface ViewConfig {
13+
id: AnalyticsView;
14+
label: string;
15+
icon: string;
16+
comingSoon?: boolean;
17+
}
1018

1119
interface AnalyticsDashboardProps {
1220
className?: string;
@@ -17,28 +25,34 @@ export const AnalyticsDashboard: React.FC<AnalyticsDashboardProps> = ({ classNam
1725
const [activeView, setActiveView] = useState<AnalyticsView>('overview');
1826
const [loading, setLoading] = useState(false);
1927

20-
const views = [
28+
const views: ViewConfig[] = [
2129
{ id: 'overview', label: 'Overview', icon: '📊' },
2230
{ id: 'users', label: 'Users', icon: '👥' },
2331
{ id: 'feedback', label: 'Feedback', icon: '💬' },
24-
{ id: 'demos', label: 'Demos', icon: '🎮' },
25-
{ id: 'engagement', label: 'Engagement', icon: '⚡' },
26-
] as const;
32+
{ id: 'demos', label: 'Demos', icon: '🎮', comingSoon: true },
33+
{ id: 'engagement', label: 'Engagement', icon: '⚡', comingSoon: true },
34+
];
2735

2836
const getThemeClasses = () => {
2937
if (theme === 'light') {
3038
return {
31-
container: 'p-6 bg-white/90 backdrop-blur-sm rounded-lg border border-gray-200/50 shadow-lg',
39+
container:
40+
'p-6 bg-gradient-to-br from-white to-gray-50 backdrop-blur-sm rounded-2xl border border-gray-200/50 shadow-2xl',
41+
headerContainer:
42+
'p-6 bg-gradient-to-br from-blue-50 to-indigo-100 backdrop-blur-sm rounded-2xl border border-blue-200/50 shadow-2xl',
3243
text: 'text-gray-800',
3344
textSecondary: 'text-gray-600',
34-
textMuted: 'text-gray-500'
45+
textMuted: 'text-gray-500',
3546
};
3647
} else {
3748
return {
38-
container: 'p-6 bg-gray-900/80 backdrop-blur-sm rounded-lg border border-white/30',
49+
container:
50+
'p-6 bg-gradient-to-br from-slate-900 to-slate-800 backdrop-blur-sm rounded-2xl border border-white/20 shadow-2xl',
51+
headerContainer:
52+
'p-6 bg-gradient-to-br from-slate-900 to-slate-800 backdrop-blur-sm rounded-2xl border border-white/20 shadow-2xl',
3953
text: 'text-white',
4054
textSecondary: 'text-gray-300',
41-
textMuted: 'text-gray-400'
55+
textMuted: 'text-gray-400',
4256
};
4357
}
4458
};
@@ -63,7 +77,9 @@ export const AnalyticsDashboard: React.FC<AnalyticsDashboardProps> = ({ classNam
6377
case 'engagement':
6478
return (
6579
<div className={themeClasses.container}>
66-
<h2 className={`text-xl font-semibold ${themeClasses.text} mb-4`}>Engagement Analytics</h2>
80+
<h2 className={`text-xl font-semibold ${themeClasses.text} mb-4`}>
81+
Engagement Analytics
82+
</h2>
6783
<p className={themeClasses.textSecondary}>Engagement analytics coming soon...</p>
6884
</div>
6985
);
@@ -75,16 +91,20 @@ export const AnalyticsDashboard: React.FC<AnalyticsDashboardProps> = ({ classNam
7591
return (
7692
<div className={`space-y-6 ${className}`}>
7793
{/* Header */}
78-
<div className={themeClasses.container}>
79-
<div className="flex items-center justify-between">
94+
<div className={themeClasses.headerContainer}>
95+
<div className='flex items-center justify-between'>
8096
<div>
97+
<div className='flex items-center space-x-2'>
98+
<Image src='/images/logo/logoicon.png' alt='Nexus Logo' width={100} height={100} />
99+
<Image src='/images/logo/iconletter.png' alt='Nexus Logo' width={100} height={100} />
100+
</div>
81101
<h1 className={`text-2xl font-bold ${themeClasses.text}`}>Analytics Dashboard</h1>
82102
<p className={`${themeClasses.textMuted} mt-1`}>Platform insights and user analytics</p>
83103
</div>
84-
<div className="flex items-center space-x-4">
104+
<div className='flex items-center space-x-4'>
85105
<button
86106
onClick={() => setLoading(true)}
87-
className="px-4 py-2 bg-blue-500/20 border border-blue-400/50 text-blue-300 rounded-lg hover:bg-blue-500/30 transition-colors"
107+
className='px-4 py-2 bg-blue-500/20 border border-blue-400/50 text-blue-300 rounded-lg hover:bg-blue-500/30 transition-colors'
88108
>
89109
🔄 Refresh
90110
</button>
@@ -95,37 +115,49 @@ export const AnalyticsDashboard: React.FC<AnalyticsDashboardProps> = ({ classNam
95115

96116
{/* Navigation Tabs */}
97117
<div className={themeClasses.container}>
98-
<div className="flex flex-wrap gap-2">
99-
{views.map((view) => (
118+
<div className='flex flex-wrap gap-2'>
119+
{views.map(view => (
100120
<button
101121
key={view.id}
102122
onClick={() => setActiveView(view.id)}
103-
className={`px-4 py-2 rounded-lg transition-colors ${
123+
className={`px-4 py-2 rounded-lg transition-colors relative ${
104124
activeView === view.id
105-
? theme === 'light'
125+
? theme === 'light'
106126
? 'bg-blue-500/20 border border-blue-400/50 text-blue-600'
107127
: 'bg-blue-500/20 border border-blue-400/50 text-blue-300'
108128
: theme === 'light'
109129
? 'bg-gray-100/50 border border-gray-200/50 text-gray-600 hover:bg-gray-200/50'
110130
: 'bg-white/5 border border-white/20 text-gray-300 hover:bg-white/10'
111131
}`}
112132
>
113-
<span className="mr-2">{view.icon}</span>
133+
<span className='mr-2'>{view.icon}</span>
114134
{view.label}
135+
{view.comingSoon && (
136+
<div className={`absolute -top-2 -right-2 bg-gradient-to-r from-orange-400 to-red-500 text-white text-xs font-bold px-2 py-1 rounded-full border-2 ${
137+
theme === 'light' ? 'border-white' : 'border-gray-900'
138+
} animate-pulse shadow-lg`}>
139+
Soon
140+
</div>
141+
)}
115142
</button>
116143
))}
117144
</div>
118145
</div>
119146

120147
{/* Content */}
121-
<div className="min-h-[600px]">
148+
<div className='min-h-[600px]'>
122149
{loading ? (
123150
<div className={themeClasses.container}>
124-
<div className="animate-pulse space-y-4">
125-
<div className={`h-6 ${theme === 'light' ? 'bg-gray-200' : 'bg-white/10'} rounded w-1/3`}></div>
126-
<div className="grid grid-cols-2 md:grid-cols-4 gap-4">
151+
<div className='animate-pulse space-y-4'>
152+
<div
153+
className={`h-6 ${theme === 'light' ? 'bg-gray-200' : 'bg-white/10'} rounded w-1/3`}
154+
></div>
155+
<div className='grid grid-cols-2 md:grid-cols-4 gap-4'>
127156
{[...Array(8)].map((_, i) => (
128-
<div key={i} className={`h-20 ${theme === 'light' ? 'bg-gray-200' : 'bg-white/10'} rounded`}></div>
157+
<div
158+
key={i}
159+
className={`h-20 ${theme === 'light' ? 'bg-gray-200' : 'bg-white/10'} rounded`}
160+
></div>
129161
))}
130162
</div>
131163
</div>

0 commit comments

Comments
 (0)