@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
|
|
package/package.json
CHANGED
|
@@ -1,106 +1,106 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@digilogiclabs/create-saas-app",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Create modern SaaS applications with Digi Logic Labs packages",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"bin": {
|
|
7
|
-
"create-saas-app": "bin/index.js"
|
|
8
|
-
},
|
|
9
|
-
"scripts": {
|
|
10
|
-
"build": "tsc --project tsconfig.build.json && npm run copy-templates",
|
|
11
|
-
"copy-templates": "node -e \"require('fs-extra').copySync('src/templates', 'dist/templates')\"",
|
|
12
|
-
"dev": "tsup --watch",
|
|
13
|
-
"test": "jest",
|
|
14
|
-
"test:templates": "tsx scripts/test-all-templates.ts",
|
|
15
|
-
"lint": "eslint src",
|
|
16
|
-
"lint:fix": "eslint src --fix",
|
|
17
|
-
"type-check": "tsc --noEmit --skipLibCheck",
|
|
18
|
-
"validate": "tsx scripts/validate-templates.ts",
|
|
19
|
-
"changeset": "changeset",
|
|
20
|
-
"version": "changeset version",
|
|
21
|
-
"release": "npm run build && changeset publish",
|
|
22
|
-
"prepublishOnly": "npm run build && npm run lint && npm run type-check"
|
|
23
|
-
},
|
|
24
|
-
"keywords": [
|
|
25
|
-
"cli",
|
|
26
|
-
"saas",
|
|
27
|
-
"template",
|
|
28
|
-
"nextjs",
|
|
29
|
-
"react-native",
|
|
30
|
-
"expo",
|
|
31
|
-
"typescript",
|
|
32
|
-
"tailwind",
|
|
33
|
-
"firebase",
|
|
34
|
-
"supabase",
|
|
35
|
-
"digilogiclabs"
|
|
36
|
-
],
|
|
37
|
-
"author": "Digi Logic Labs",
|
|
38
|
-
"license": "MIT",
|
|
39
|
-
"repository": {
|
|
40
|
-
"type": "git",
|
|
41
|
-
"url": "git+https://github.com/DigiLogicLabs/create-saas-app.git"
|
|
42
|
-
},
|
|
43
|
-
"bugs": {
|
|
44
|
-
"url": "https://github.com/DigiLogicLabs/create-saas-app/issues"
|
|
45
|
-
},
|
|
46
|
-
"homepage": "https://github.com/DigiLogicLabs/create-saas-app#readme",
|
|
47
|
-
"files": [
|
|
48
|
-
"dist",
|
|
49
|
-
"bin",
|
|
50
|
-
"src/templates",
|
|
51
|
-
"README.md",
|
|
52
|
-
"CHANGELOG.md",
|
|
53
|
-
"LICENSE"
|
|
54
|
-
],
|
|
55
|
-
"engines": {
|
|
56
|
-
"node": ">=18.0.0"
|
|
57
|
-
},
|
|
58
|
-
"dependencies": {
|
|
59
|
-
"chalk": "^4.1.2",
|
|
60
|
-
"commander": "^11.1.0",
|
|
61
|
-
"cosmiconfig": "^8.3.6",
|
|
62
|
-
"execa": "^5.1.1",
|
|
63
|
-
"fs-extra": "^11.1.1",
|
|
64
|
-
"glob": "^10.3.10",
|
|
65
|
-
"inquirer": "^9.2.12",
|
|
66
|
-
"listr2": "^7.0.2",
|
|
67
|
-
"mustache": "^4.2.0",
|
|
68
|
-
"ora": "^5.4.1",
|
|
69
|
-
"semver": "^7.5.4",
|
|
70
|
-
"validate-npm-package-name": "^5.0.0",
|
|
71
|
-
"zod": "^3.22.4"
|
|
72
|
-
},
|
|
73
|
-
"devDependencies": {
|
|
74
|
-
"@changesets/cli": "^2.26.2",
|
|
75
|
-
"@supabase/supabase-js": "^2.39.2",
|
|
76
|
-
"@types/fs-extra": "^11.0.4",
|
|
77
|
-
"@types/inquirer": "^9.0.7",
|
|
78
|
-
"@types/jest": "^29.5.6",
|
|
79
|
-
"@types/mustache": "^4.2.5",
|
|
80
|
-
"@types/node": "^20.8.7",
|
|
81
|
-
"@types/semver": "^7.5.4",
|
|
82
|
-
"@types/validate-npm-package-name": "^4.0.2",
|
|
83
|
-
"eslint": "^8.57.1",
|
|
84
|
-
"eslint-config-prettier": "^9.1.2",
|
|
85
|
-
"eslint-plugin-prettier": "^5.5.4",
|
|
86
|
-
"firebase": "^10.7.1",
|
|
87
|
-
"globals": "^16.3.0",
|
|
88
|
-
"jest": "^29.7.0",
|
|
89
|
-
"prettier": "^3.0.3",
|
|
90
|
-
"ts-jest": "^29.1.1",
|
|
91
|
-
"tsup": "^7.2.0",
|
|
92
|
-
"tsx": "^3.14.0",
|
|
93
|
-
"typescript": "^5.2.2",
|
|
94
|
-
"typescript-eslint": "^8.40.0"
|
|
95
|
-
},
|
|
96
|
-
"peerDependencies": {
|
|
97
|
-
"typescript": ">=4.9.0"
|
|
98
|
-
},
|
|
99
|
-
"publishConfig": {
|
|
100
|
-
"access": "public"
|
|
101
|
-
},
|
|
102
|
-
"directories": {
|
|
103
|
-
"doc": "docs",
|
|
104
|
-
"test": "tests"
|
|
105
|
-
}
|
|
106
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@digilogiclabs/create-saas-app",
|
|
3
|
+
"version": "1.6.0",
|
|
4
|
+
"description": "Create modern SaaS applications with Digi Logic Labs packages",
|
|
5
|
+
"main": "dist/cli/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"create-saas-app": "bin/index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc --project tsconfig.build.json && npm run copy-templates",
|
|
11
|
+
"copy-templates": "node -e \"require('fs-extra').copySync('src/templates', 'dist/templates')\"",
|
|
12
|
+
"dev": "tsup --watch",
|
|
13
|
+
"test": "jest",
|
|
14
|
+
"test:templates": "tsx scripts/test-all-templates.ts",
|
|
15
|
+
"lint": "eslint src",
|
|
16
|
+
"lint:fix": "eslint src --fix",
|
|
17
|
+
"type-check": "tsc --noEmit --skipLibCheck",
|
|
18
|
+
"validate": "tsx scripts/validate-templates.ts",
|
|
19
|
+
"changeset": "changeset",
|
|
20
|
+
"version": "changeset version",
|
|
21
|
+
"release": "npm run build && changeset publish",
|
|
22
|
+
"prepublishOnly": "npm run build && npm run lint && npm run type-check"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"cli",
|
|
26
|
+
"saas",
|
|
27
|
+
"template",
|
|
28
|
+
"nextjs",
|
|
29
|
+
"react-native",
|
|
30
|
+
"expo",
|
|
31
|
+
"typescript",
|
|
32
|
+
"tailwind",
|
|
33
|
+
"firebase",
|
|
34
|
+
"supabase",
|
|
35
|
+
"digilogiclabs"
|
|
36
|
+
],
|
|
37
|
+
"author": "Digi Logic Labs",
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "git+https://github.com/DigiLogicLabs/create-saas-app.git"
|
|
42
|
+
},
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/DigiLogicLabs/create-saas-app/issues"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://github.com/DigiLogicLabs/create-saas-app#readme",
|
|
47
|
+
"files": [
|
|
48
|
+
"dist",
|
|
49
|
+
"bin",
|
|
50
|
+
"src/templates",
|
|
51
|
+
"README.md",
|
|
52
|
+
"CHANGELOG.md",
|
|
53
|
+
"LICENSE"
|
|
54
|
+
],
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=18.0.0"
|
|
57
|
+
},
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"chalk": "^4.1.2",
|
|
60
|
+
"commander": "^11.1.0",
|
|
61
|
+
"cosmiconfig": "^8.3.6",
|
|
62
|
+
"execa": "^5.1.1",
|
|
63
|
+
"fs-extra": "^11.1.1",
|
|
64
|
+
"glob": "^10.3.10",
|
|
65
|
+
"inquirer": "^9.2.12",
|
|
66
|
+
"listr2": "^7.0.2",
|
|
67
|
+
"mustache": "^4.2.0",
|
|
68
|
+
"ora": "^5.4.1",
|
|
69
|
+
"semver": "^7.5.4",
|
|
70
|
+
"validate-npm-package-name": "^5.0.0",
|
|
71
|
+
"zod": "^3.22.4"
|
|
72
|
+
},
|
|
73
|
+
"devDependencies": {
|
|
74
|
+
"@changesets/cli": "^2.26.2",
|
|
75
|
+
"@supabase/supabase-js": "^2.39.2",
|
|
76
|
+
"@types/fs-extra": "^11.0.4",
|
|
77
|
+
"@types/inquirer": "^9.0.7",
|
|
78
|
+
"@types/jest": "^29.5.6",
|
|
79
|
+
"@types/mustache": "^4.2.5",
|
|
80
|
+
"@types/node": "^20.8.7",
|
|
81
|
+
"@types/semver": "^7.5.4",
|
|
82
|
+
"@types/validate-npm-package-name": "^4.0.2",
|
|
83
|
+
"eslint": "^8.57.1",
|
|
84
|
+
"eslint-config-prettier": "^9.1.2",
|
|
85
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
86
|
+
"firebase": "^10.7.1",
|
|
87
|
+
"globals": "^16.3.0",
|
|
88
|
+
"jest": "^29.7.0",
|
|
89
|
+
"prettier": "^3.0.3",
|
|
90
|
+
"ts-jest": "^29.1.1",
|
|
91
|
+
"tsup": "^7.2.0",
|
|
92
|
+
"tsx": "^3.14.0",
|
|
93
|
+
"typescript": "^5.2.2",
|
|
94
|
+
"typescript-eslint": "^8.40.0"
|
|
95
|
+
},
|
|
96
|
+
"peerDependencies": {
|
|
97
|
+
"typescript": ">=4.9.0"
|
|
98
|
+
},
|
|
99
|
+
"publishConfig": {
|
|
100
|
+
"access": "public"
|
|
101
|
+
},
|
|
102
|
+
"directories": {
|
|
103
|
+
"doc": "docs",
|
|
104
|
+
"test": "tests"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -5,35 +5,92 @@ import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
|
5
5
|
import { AuthProvider, useAuth } from '@digilogiclabs/saas-factory-auth/native';
|
|
6
6
|
import { StripeProvider } from '@digilogiclabs/saas-factory-payments/native';
|
|
7
7
|
import { Link, Slot } from 'expo-router';
|
|
8
|
+
import {
|
|
9
|
+
NativePageTransition as PageTransition,
|
|
10
|
+
NativeMobileHero as MobileHero,
|
|
11
|
+
NativeMobileContainer as MobileContainer,
|
|
12
|
+
NativeNetworkAwareContent as NetworkAwareContent,
|
|
13
|
+
NativeOfflineWrapper as OfflineWrapper,
|
|
14
|
+
useNetworkInfo,
|
|
15
|
+
useOfflineState
|
|
16
|
+
} from '@digilogiclabs/saas-factory-ui/native';
|
|
8
17
|
|
|
9
18
|
function AppContent() {
|
|
10
19
|
const { user, signOut } = useAuth();
|
|
20
|
+
const networkInfo = useNetworkInfo();
|
|
21
|
+
const isOnline = useOfflineState();
|
|
11
22
|
|
|
12
23
|
return (
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
24
|
+
<PageTransition type="fade" duration={300}>
|
|
25
|
+
<OfflineWrapper
|
|
26
|
+
cacheStrategy="stale-while-revalidate"
|
|
27
|
+
showOfflineIndicator={true}
|
|
28
|
+
>
|
|
29
|
+
<MobileContainer style={styles.container}>
|
|
30
|
+
<NetworkAwareContent
|
|
31
|
+
showOnOffline={
|
|
32
|
+
<View style={styles.offlineContainer}>
|
|
33
|
+
<Text style={styles.offlineTitle}>You're offline</Text>
|
|
34
|
+
<Text style={styles.offlineText}>
|
|
35
|
+
Some features may be limited while offline.
|
|
36
|
+
</Text>
|
|
37
|
+
</View>
|
|
38
|
+
}
|
|
39
|
+
>
|
|
40
|
+
{user ? (
|
|
41
|
+
<MobileHero
|
|
42
|
+
title={{
|
|
43
|
+
text: "Welcome back!",
|
|
44
|
+
size: "lg"
|
|
45
|
+
}}
|
|
46
|
+
description="You are signed in and ready to go."
|
|
47
|
+
actions={[
|
|
48
|
+
{
|
|
49
|
+
label: "Go to Checkout",
|
|
50
|
+
href: "/checkout",
|
|
51
|
+
variant: "default"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
label: "Sign Out",
|
|
55
|
+
onPress: signOut,
|
|
56
|
+
variant: "outline"
|
|
57
|
+
}
|
|
58
|
+
]}
|
|
59
|
+
/>
|
|
60
|
+
) : (
|
|
61
|
+
<MobileHero
|
|
62
|
+
title={{
|
|
63
|
+
text: "Welcome to {{titleCaseName}}",
|
|
64
|
+
size: "xl"
|
|
65
|
+
}}
|
|
66
|
+
description="{{description}}"
|
|
67
|
+
actions={[
|
|
68
|
+
{
|
|
69
|
+
label: "Get Started",
|
|
70
|
+
href: "/signup",
|
|
71
|
+
variant: "default"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
label: "Sign In",
|
|
75
|
+
href: "/login",
|
|
76
|
+
variant: "outline"
|
|
77
|
+
}
|
|
78
|
+
]}
|
|
79
|
+
/>
|
|
80
|
+
)}
|
|
81
|
+
|
|
82
|
+
{/* Network Status Indicator */}
|
|
83
|
+
<View style={styles.statusContainer}>
|
|
84
|
+
<Text style={styles.statusText}>
|
|
85
|
+
Status: {isOnline ? '🟢 Online' : '🔴 Offline'}
|
|
86
|
+
{networkInfo?.type && ` • ${networkInfo.type}`}
|
|
87
|
+
</Text>
|
|
88
|
+
</View>
|
|
89
|
+
</NetworkAwareContent>
|
|
90
|
+
</MobileContainer>
|
|
91
|
+
</OfflineWrapper>
|
|
35
92
|
<StatusBar style="auto" />
|
|
36
|
-
</
|
|
93
|
+
</PageTransition>
|
|
37
94
|
);
|
|
38
95
|
}
|
|
39
96
|
|
|
@@ -85,4 +142,37 @@ const styles = StyleSheet.create({
|
|
|
85
142
|
textAlign: 'center',
|
|
86
143
|
width: '80%',
|
|
87
144
|
},
|
|
145
|
+
offlineContainer: {
|
|
146
|
+
padding: 20,
|
|
147
|
+
alignItems: 'center',
|
|
148
|
+
backgroundColor: '#fff3cd',
|
|
149
|
+
borderRadius: 8,
|
|
150
|
+
margin: 20,
|
|
151
|
+
},
|
|
152
|
+
offlineTitle: {
|
|
153
|
+
fontSize: 18,
|
|
154
|
+
fontWeight: 'bold',
|
|
155
|
+
color: '#856404',
|
|
156
|
+
marginBottom: 8,
|
|
157
|
+
},
|
|
158
|
+
offlineText: {
|
|
159
|
+
fontSize: 14,
|
|
160
|
+
color: '#856404',
|
|
161
|
+
textAlign: 'center',
|
|
162
|
+
},
|
|
163
|
+
statusContainer: {
|
|
164
|
+
position: 'absolute',
|
|
165
|
+
bottom: 50,
|
|
166
|
+
left: 0,
|
|
167
|
+
right: 0,
|
|
168
|
+
alignItems: 'center',
|
|
169
|
+
},
|
|
170
|
+
statusText: {
|
|
171
|
+
fontSize: 12,
|
|
172
|
+
color: '#666',
|
|
173
|
+
backgroundColor: 'rgba(255, 255, 255, 0.9)',
|
|
174
|
+
paddingHorizontal: 12,
|
|
175
|
+
paddingVertical: 6,
|
|
176
|
+
borderRadius: 20,
|
|
177
|
+
},
|
|
88
178
|
});
|
|
@@ -1,38 +1,41 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "{{packageName}}",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "{{description}}",
|
|
5
|
-
"main": "node_modules/expo/AppEntry.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"start": "expo start",
|
|
8
|
-
"android": "expo start --android",
|
|
9
|
-
"ios": "expo start --ios",
|
|
10
|
-
"web": "expo start --web",
|
|
11
|
-
"build": "eas build",
|
|
12
|
-
"eject": "expo eject"
|
|
13
|
-
},
|
|
14
|
-
"dependencies": {
|
|
15
|
-
"expo": "~49.0.0",
|
|
16
|
-
"react": "18.2.0",
|
|
17
|
-
"react-native": "0.72.6",
|
|
18
|
-
"@expo/vector-icons": "^13.0.0",
|
|
19
|
-
"@react-navigation/native": "^6.1.0",
|
|
20
|
-
"@react-navigation/stack": "^6.3.0",
|
|
21
|
-
"@react-navigation/bottom-tabs": "^6.5.0",
|
|
22
|
-
"react-native-screens": "~3.22.0",
|
|
23
|
-
"react-native-safe-area-context": "4.6.3",
|
|
24
|
-
"react-native-gesture-handler": "~2.12.0",
|
|
25
|
-
"@digilogiclabs/saas-factory-ui": "^0.
|
|
26
|
-
"@digilogiclabs/saas-factory-auth": "^0.4.3",
|
|
27
|
-
"@digilogiclabs/saas-factory-payments": "^0.2.0",
|
|
28
|
-
"firebase": "^10.0.0",
|
|
29
|
-
"@supabase/supabase-js": "^2.0.0"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "{{packageName}}",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "{{description}}",
|
|
5
|
+
"main": "node_modules/expo/AppEntry.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"start": "expo start",
|
|
8
|
+
"android": "expo start --android",
|
|
9
|
+
"ios": "expo start --ios",
|
|
10
|
+
"web": "expo start --web",
|
|
11
|
+
"build": "eas build",
|
|
12
|
+
"eject": "expo eject"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"expo": "~49.0.0",
|
|
16
|
+
"react": "18.2.0",
|
|
17
|
+
"react-native": "0.72.6",
|
|
18
|
+
"@expo/vector-icons": "^13.0.0",
|
|
19
|
+
"@react-navigation/native": "^6.1.0",
|
|
20
|
+
"@react-navigation/stack": "^6.3.0",
|
|
21
|
+
"@react-navigation/bottom-tabs": "^6.5.0",
|
|
22
|
+
"react-native-screens": "~3.22.0",
|
|
23
|
+
"react-native-safe-area-context": "4.6.3",
|
|
24
|
+
"react-native-gesture-handler": "~2.12.0",
|
|
25
|
+
"@digilogiclabs/saas-factory-ui": "^0.13.0",
|
|
26
|
+
"@digilogiclabs/saas-factory-auth": "^0.4.3",
|
|
27
|
+
"@digilogiclabs/saas-factory-payments": "^0.2.0",
|
|
28
|
+
"firebase": "^10.0.0",
|
|
29
|
+
"@supabase/supabase-js": "^2.0.0",
|
|
30
|
+
"@react-native-community/netinfo": "^11.0.0",
|
|
31
|
+
"@react-native-async-storage/async-storage": "^1.19.0",
|
|
32
|
+
"expo-haptics": "~12.4.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@babel/core": "^7.20.0",
|
|
36
|
+
"@types/react": "~18.2.14",
|
|
37
|
+
"@types/react-native": "~0.72.2",
|
|
38
|
+
"typescript": "^5.1.3"
|
|
39
|
+
},
|
|
40
|
+
"private": true
|
|
41
|
+
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"description": "{{description}}",
|
|
5
5
|
"private": true,
|
|
6
6
|
"scripts": {
|
|
7
|
-
"dev": "next dev
|
|
7
|
+
"dev": "next dev",
|
|
8
8
|
"build": "next build",
|
|
9
9
|
"start": "next start",
|
|
10
10
|
"lint": "next lint",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"next": "^15.0.0",
|
|
18
18
|
"react": "^19.0.0",
|
|
19
19
|
"react-dom": "^19.0.0",
|
|
20
|
-
"@digilogiclabs/saas-factory-ui": "^0.
|
|
20
|
+
"@digilogiclabs/saas-factory-ui": "^0.13.0",
|
|
21
21
|
"@digilogiclabs/saas-factory-auth": "^0.4.3",
|
|
22
22
|
"@digilogiclabs/saas-factory-payments": "^0.2.0",
|
|
23
23
|
"tailwindcss": "^3.3.0",
|