Skip to content

Commit 2ed5bcd

Browse files
Add more components and theming
Add new components and implement free/premium tier separation. Focus on sleek design and premium features for the paid version.
1 parent aa5786d commit 2ed5bcd

6 files changed

Lines changed: 1231 additions & 2 deletions

File tree

src/App.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,25 @@ import DashboardWidgets from "./pages/showcase/DashboardWidgets";
2626
import ModernGallery from "./pages/showcase/ModernGallery";
2727
import AnimationShowcase from "./pages/showcase/AnimationShowcase";
2828
import UniqueComponents from "./pages/showcase/UniqueComponents";
29+
import EcommerceShowcase from "./pages/showcase/EcommerceShowcase";
30+
import CryptoFinance from "./pages/showcase/CryptoFinance";
31+
import SocialMedia from "./pages/showcase/SocialMedia";
2932
import Login from "./pages/Login";
3033
import Register from "./pages/Register";
3134
import NotFound from "./pages/NotFound";
3235
import { HelmetProvider } from "react-helmet-async";
3336
import { ThemeProvider } from "./contexts/ThemeContext";
3437
import { LanguageProvider } from "./contexts/LanguageContext";
38+
import { PremiumProvider } from "./contexts/PremiumContext";
3539

3640
const queryClient = new QueryClient();
3741

3842
const App = () => (
3943
<HelmetProvider>
4044
<ThemeProvider>
4145
<LanguageProvider>
42-
<QueryClientProvider client={queryClient}>
46+
<PremiumProvider>
47+
<QueryClientProvider client={queryClient}>
4348
<TooltipProvider>
4449
<Toaster />
4550
<Sonner />
@@ -72,7 +77,9 @@ const App = () => (
7277
<Route path="/showcase/gallery" element={<ModernGallery />} />
7378
<Route path="/showcase/animations" element={<AnimationShowcase />} />
7479
<Route path="/showcase/unique" element={<UniqueComponents />} />
75-
<Route path="/showcase/unique" element={<UniqueComponents />} />
80+
<Route path="/showcase/ecommerce" element={<EcommerceShowcase />} />
81+
<Route path="/showcase/crypto-finance" element={<CryptoFinance />} />
82+
<Route path="/showcase/social-media" element={<SocialMedia />} />
7683
<Route path="/old-showcase" element={<ComponentShowcase />} />
7784
</Route>
7885
{/* ADD ALL CUSTOM ROUTES ABOVE THE CATCH-ALL "*" ROUTE */}
@@ -81,6 +88,7 @@ const App = () => (
8188
</BrowserRouter>
8289
</TooltipProvider>
8390
</QueryClientProvider>
91+
</PremiumProvider>
8492
</LanguageProvider>
8593
</ThemeProvider>
8694
</HelmetProvider>

src/contexts/PremiumContext.tsx

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import React, { createContext, useContext, useState, ReactNode } from 'react';
2+
3+
interface PremiumContextType {
4+
isPremiumUser: boolean;
5+
upgradeUser: () => void;
6+
downgradeUser: () => void;
7+
premiumFeatures: string[];
8+
}
9+
10+
const PremiumContext = createContext<PremiumContextType | undefined>(undefined);
11+
12+
export const usePremium = () => {
13+
const context = useContext(PremiumContext);
14+
if (context === undefined) {
15+
throw new Error('usePremium must be used within a PremiumProvider');
16+
}
17+
return context;
18+
};
19+
20+
interface PremiumProviderProps {
21+
children: ReactNode;
22+
}
23+
24+
export const PremiumProvider: React.FC<PremiumProviderProps> = ({ children }) => {
25+
const [isPremiumUser, setIsPremiumUser] = useState(false);
26+
27+
const premiumFeatures = [
28+
'Advanced Charts & Analytics',
29+
'E-commerce Components',
30+
'Crypto & Finance Dashboard',
31+
'Social Media Interface',
32+
'Premium UI Components',
33+
'Export Code Functionality',
34+
'Priority Support',
35+
'Custom Themes',
36+
'Advanced Animations',
37+
'Real-time Features'
38+
];
39+
40+
const upgradeUser = () => {
41+
setIsPremiumUser(true);
42+
// Here you would typically integrate with your payment system
43+
};
44+
45+
const downgradeUser = () => {
46+
setIsPremiumUser(false);
47+
};
48+
49+
const value: PremiumContextType = {
50+
isPremiumUser,
51+
upgradeUser,
52+
downgradeUser,
53+
premiumFeatures
54+
};
55+
56+
return (
57+
<PremiumContext.Provider value={value}>
58+
{children}
59+
</PremiumContext.Provider>
60+
);
61+
};

src/pages/showcase/ComponentShowcaseIndex.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ import {
1414
} from "lucide-react";
1515
import { Link } from "react-router-dom";
1616
import { useLanguage } from "@/contexts/LanguageContext";
17+
import { usePremium } from "@/contexts/PremiumContext";
1718

1819
export default function ComponentShowcaseIndex() {
20+
const { isPremiumUser, upgradeUser } = usePremium();
1921
const { t } = useLanguage();
2022

2123
const showcasePages = [

0 commit comments

Comments
 (0)