@digilogiclabs/create-saas-app 1.5.3 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +109 -49
- package/bin/index.js +1 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/templates/mobile/base/template/App.tsx +113 -23
- package/dist/templates/mobile/base/template/package.json +41 -38
- package/dist/templates/web/base/template/package.json +2 -2
- package/dist/templates/web/base/template/src/app/checkout/page.tsx +99 -8
- package/dist/templates/web/base/template/src/app/dashboard/page.tsx +309 -0
- package/dist/templates/web/base/template/src/app/globals.css +97 -0
- package/dist/templates/web/base/template/src/app/login/page.tsx +36 -8
- package/dist/templates/web/base/template/src/app/page.tsx +123 -83
- package/dist/templates/web/base/template/src/app/signup/page.tsx +36 -8
- package/dist/templates/web/base/template/src/components/shared/header.tsx +49 -30
- package/dist/templates/web/ui-auth/template/package.json +3 -3
- package/dist/templates/web/ui-auth/template/src/app/page.tsx +203 -61
- package/dist/templates/web/ui-auth-payments/template/package.json +3 -3
- package/dist/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +253 -87
- package/dist/templates/web/ui-auth-payments/template/src/app/globals.css +129 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/page.tsx +246 -74
- package/dist/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +106 -40
- package/dist/templates/web/ui-auth-payments-audio/template/package.json +3 -3
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +221 -82
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +132 -40
- package/dist/templates/web/ui-auth-payments-video/template/package.json +3 -3
- package/dist/templates/web/ui-auth-payments-video/template/src/app/globals.css +146 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/page.tsx +259 -85
- package/dist/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +133 -41
- package/dist/templates/web/ui-only/template/package.json +1 -1
- package/package.json +106 -106
- package/src/templates/mobile/base/template/App.tsx +113 -23
- package/src/templates/mobile/base/template/package.json +41 -38
- package/src/templates/web/base/template/package.json +2 -2
- package/src/templates/web/base/template/src/app/checkout/page.tsx +99 -8
- package/src/templates/web/base/template/src/app/dashboard/page.tsx +309 -0
- package/src/templates/web/base/template/src/app/globals.css +97 -0
- package/src/templates/web/base/template/src/app/login/page.tsx +36 -8
- package/src/templates/web/base/template/src/app/page.tsx +123 -83
- package/src/templates/web/base/template/src/app/signup/page.tsx +36 -8
- package/src/templates/web/base/template/src/components/shared/header.tsx +49 -30
- package/src/templates/web/ui-auth/template/package.json +3 -3
- package/src/templates/web/ui-auth/template/src/app/page.tsx +203 -61
- package/src/templates/web/ui-auth-payments/template/package.json +3 -3
- package/src/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +253 -87
- package/src/templates/web/ui-auth-payments/template/src/app/globals.css +129 -0
- package/src/templates/web/ui-auth-payments/template/src/app/page.tsx +246 -74
- package/src/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +106 -40
- package/src/templates/web/ui-auth-payments-audio/template/package.json +3 -3
- package/src/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +221 -82
- package/src/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +132 -40
- package/src/templates/web/ui-auth-payments-video/template/package.json +3 -3
- package/src/templates/web/ui-auth-payments-video/template/src/app/globals.css +146 -0
- package/src/templates/web/ui-auth-payments-video/template/src/app/page.tsx +259 -85
- package/src/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +133 -41
- package/src/templates/web/ui-only/template/package.json +1 -1
- package/dist/index.js +0 -1173
- package/dist/index.js.map +0 -1
|
@@ -2,12 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import Link from 'next/link';
|
|
5
|
-
import { LogOut, CreditCard } from 'lucide-react';
|
|
5
|
+
import { LogOut, CreditCard, User, Settings, Home, Video, Film, Play } from 'lucide-react';
|
|
6
6
|
import { useAuth } from '@digilogiclabs/saas-factory-auth';
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
ResponsiveHeader,
|
|
9
|
+
MobileNavigation,
|
|
10
|
+
HamburgerIcon,
|
|
11
|
+
useNetworkInfo,
|
|
12
|
+
useOfflineState
|
|
13
|
+
} from '@digilogiclabs/saas-factory-ui';
|
|
14
|
+
import { ThemeToggle } from '@/components/ui/theme-toggle';
|
|
8
15
|
|
|
9
16
|
export function Header() {
|
|
10
17
|
const { user, signOut } = useAuth();
|
|
18
|
+
const networkInfo = useNetworkInfo();
|
|
19
|
+
const isOnline = useOfflineState();
|
|
11
20
|
|
|
12
21
|
const handleSignOut = async () => {
|
|
13
22
|
try {
|
|
@@ -17,46 +26,129 @@ export function Header() {
|
|
|
17
26
|
}
|
|
18
27
|
};
|
|
19
28
|
|
|
29
|
+
const navigationItems = [
|
|
30
|
+
{
|
|
31
|
+
label: 'Home',
|
|
32
|
+
href: '/',
|
|
33
|
+
icon: Home,
|
|
34
|
+
protected: false
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: 'Video Library',
|
|
38
|
+
href: '/videos',
|
|
39
|
+
icon: Video,
|
|
40
|
+
protected: true
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: 'Watch Later',
|
|
44
|
+
href: '/watchlater',
|
|
45
|
+
icon: Film,
|
|
46
|
+
protected: true
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
label: 'Dashboard',
|
|
50
|
+
href: '/dashboard',
|
|
51
|
+
icon: User,
|
|
52
|
+
protected: true
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: 'Billing',
|
|
56
|
+
href: '/billing',
|
|
57
|
+
icon: CreditCard,
|
|
58
|
+
protected: true
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
label: 'Checkout',
|
|
62
|
+
href: '/checkout',
|
|
63
|
+
icon: CreditCard,
|
|
64
|
+
protected: false
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
label: 'Settings',
|
|
68
|
+
href: '/settings',
|
|
69
|
+
icon: Settings,
|
|
70
|
+
protected: true
|
|
71
|
+
}
|
|
72
|
+
];
|
|
73
|
+
|
|
74
|
+
const authActions = user ? [
|
|
75
|
+
{
|
|
76
|
+
label: 'Sign Out',
|
|
77
|
+
icon: LogOut,
|
|
78
|
+
onClick: handleSignOut,
|
|
79
|
+
variant: 'ghost' as const
|
|
80
|
+
}
|
|
81
|
+
] : [
|
|
82
|
+
{
|
|
83
|
+
label: 'Login',
|
|
84
|
+
href: '/login',
|
|
85
|
+
variant: 'ghost' as const
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
label: 'Sign Up',
|
|
89
|
+
href: '/signup',
|
|
90
|
+
variant: 'default' as const
|
|
91
|
+
}
|
|
92
|
+
];
|
|
93
|
+
|
|
20
94
|
return (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
95
|
+
<>
|
|
96
|
+
{/* Network Status Banner */}
|
|
97
|
+
{!isOnline && (
|
|
98
|
+
<div className="bg-red-500 text-white text-center py-2 text-sm animate-pulse">
|
|
99
|
+
<span>📹 Offline - Cached videos only</span>
|
|
100
|
+
</div>
|
|
101
|
+
)}
|
|
102
|
+
|
|
103
|
+
{/* Video Quality Banner */}
|
|
104
|
+
{isOnline && networkInfo?.effectiveType === '2g' && (
|
|
105
|
+
<div className="bg-yellow-500 text-white text-center py-2 text-sm">
|
|
106
|
+
<div className="animate-marquee whitespace-nowrap">
|
|
107
|
+
🐌 Slow connection - Video quality reduced to 360p • Buffering optimized • Download recommended for smooth playback
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
)}
|
|
111
|
+
|
|
112
|
+
{/* HD Video Quality Banner */}
|
|
113
|
+
{isOnline && (networkInfo?.effectiveType === '4g' || networkInfo?.effectiveType === '5g') && (
|
|
114
|
+
<div className="bg-green-500 text-white text-center py-2 text-sm">
|
|
115
|
+
<div className="animate-marquee whitespace-nowrap">
|
|
116
|
+
🎬 High-speed connection - HD/4K video quality enabled • Instant streaming • Auto-quality adjustment active
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
)}
|
|
120
|
+
|
|
121
|
+
<ResponsiveHeader
|
|
122
|
+
logo={{
|
|
123
|
+
text: '{{titleCaseName}}',
|
|
124
|
+
href: '/',
|
|
125
|
+
className: 'text-2xl font-bold flex items-center gap-2',
|
|
126
|
+
icon: <Play className="w-6 h-6" />
|
|
127
|
+
}}
|
|
128
|
+
navigationItems={navigationItems}
|
|
129
|
+
actions={authActions}
|
|
130
|
+
showThemeToggle={true}
|
|
131
|
+
user={user}
|
|
132
|
+
mobileBreakpoint="md"
|
|
133
|
+
className="bg-white dark:bg-gray-800 shadow-md"
|
|
134
|
+
hamburgerIcon={
|
|
135
|
+
<HamburgerIcon
|
|
136
|
+
className="w-6 h-6 text-gray-600 dark:text-gray-300"
|
|
137
|
+
animated={true}
|
|
138
|
+
hapticFeedback={true}
|
|
139
|
+
/>
|
|
140
|
+
}
|
|
141
|
+
networkStatus={{
|
|
142
|
+
isOnline,
|
|
143
|
+
connectionType: networkInfo?.effectiveType,
|
|
144
|
+
showIndicator: true,
|
|
145
|
+
customLabels: {
|
|
146
|
+
online: 'Streaming Ready',
|
|
147
|
+
offline: 'Offline Mode'
|
|
148
|
+
}
|
|
149
|
+
}}
|
|
150
|
+
/>
|
|
151
|
+
</>
|
|
60
152
|
);
|
|
61
153
|
}
|
|
62
154
|
|