@digilogiclabs/create-saas-app 1.3.0 → 1.5.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 +42 -0
- package/README.md +46 -22
- package/dist/.tsbuildinfo +1 -1
- package/dist/index.js +48 -6
- package/dist/index.js.map +1 -1
- package/dist/templates/web/base/template/package.json +20 -10
- package/dist/templates/web/base/template/src/app/error.tsx +97 -0
- package/dist/templates/web/base/template/src/app/layout.tsx +8 -2
- package/dist/templates/web/base/template/src/app/loading.tsx +34 -0
- package/dist/templates/web/base/template/src/components/__tests__/example.test.tsx +49 -0
- package/dist/templates/web/base/template/src/components/providers/app-providers.tsx +6 -2
- package/dist/templates/web/base/template/src/components/providers/theme-provider.tsx +94 -0
- package/dist/templates/web/base/template/src/components/shared/footer.tsx +36 -0
- package/dist/templates/web/base/template/src/components/shared/header.tsx +2 -0
- package/dist/templates/web/base/template/src/components/ui/theme-toggle.tsx +34 -0
- package/dist/templates/web/base/template/src/lib/auth-server.ts +177 -0
- package/dist/templates/web/base/template/src/lib/env.ts +46 -0
- package/dist/templates/web/base/template/src/lib/utils.ts +133 -0
- package/dist/templates/web/base/template/src/test/setup.ts +79 -0
- package/dist/templates/web/base/template/vitest.config.ts +17 -0
- package/dist/templates/web/ui-auth/template/package.json +14 -4
- package/dist/templates/web/ui-auth/template/src/app/error.tsx +67 -0
- package/dist/templates/web/ui-auth/template/src/app/layout.tsx +6 -2
- package/dist/templates/web/ui-auth/template/src/app/loading.tsx +20 -0
- package/dist/templates/web/ui-auth/template/src/components/__tests__/example.test.tsx +49 -0
- package/dist/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +6 -2
- package/dist/templates/web/ui-auth/template/src/components/providers/theme-provider.tsx +94 -0
- package/dist/templates/web/ui-auth/template/src/components/shared/footer.tsx +36 -0
- package/dist/templates/web/ui-auth/template/src/components/shared/header.tsx +2 -0
- package/dist/templates/web/ui-auth/template/src/components/ui/theme-toggle.tsx +34 -0
- package/dist/templates/web/ui-auth/template/src/lib/env.ts +49 -0
- package/dist/templates/web/ui-auth/template/src/lib/utils.ts +133 -0
- package/dist/templates/web/ui-auth/template/src/test/setup.ts +79 -0
- package/dist/templates/web/ui-auth/template/vitest.config.ts +17 -0
- package/dist/templates/web/ui-auth-payments/template/middleware.ts +68 -0
- package/dist/templates/web/ui-auth-payments/template/package.json +14 -4
- package/dist/templates/web/ui-auth-payments/template/src/app/dashboard/layout.tsx +22 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/dashboard/page.tsx +183 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/error.tsx +67 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/layout.tsx +6 -2
- package/dist/templates/web/ui-auth-payments/template/src/app/loading.tsx +20 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/login/loading.tsx +38 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/signup/loading.tsx +50 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/__tests__/example.test.tsx +49 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/client/auth-status.tsx +52 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/client/login-form.tsx +144 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/client/newsletter-signup.tsx +68 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/client/signup-form.tsx +185 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx +6 -2
- package/dist/templates/web/ui-auth-payments/template/src/components/providers/theme-provider.tsx +94 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/shared/footer.tsx +36 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +2 -0
- package/dist/templates/web/ui-auth-payments/template/src/components/ui/theme-toggle.tsx +34 -0
- package/dist/templates/web/ui-auth-payments/template/src/lib/actions/auth.ts +246 -0
- package/dist/templates/web/ui-auth-payments/template/src/lib/actions/index.ts +340 -0
- package/dist/templates/web/ui-auth-payments/template/src/lib/auth-server.ts +177 -0
- package/dist/templates/web/ui-auth-payments/template/src/lib/env.ts +49 -0
- package/dist/templates/web/ui-auth-payments/template/src/lib/utils.ts +133 -0
- package/dist/templates/web/ui-auth-payments/template/src/test/setup.ts +79 -0
- package/dist/templates/web/ui-auth-payments/template/vitest.config.ts +17 -0
- package/dist/templates/web/ui-auth-payments-audio/template/package.json +14 -4
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/error.tsx +67 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/layout.tsx +8 -2
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/loading.tsx +20 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/__tests__/example.test.tsx +49 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +6 -2
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/providers/theme-provider.tsx +94 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/shared/footer.tsx +36 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +2 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/ui/theme-toggle.tsx +34 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/lib/env.ts +49 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/lib/utils.ts +133 -0
- package/dist/templates/web/ui-auth-payments-audio/template/src/test/setup.ts +79 -0
- package/dist/templates/web/ui-auth-payments-audio/template/vitest.config.ts +17 -0
- package/dist/templates/web/ui-auth-payments-video/template/package.json +14 -4
- package/dist/templates/web/ui-auth-payments-video/template/src/app/error.tsx +67 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/app/layout.tsx +6 -2
- package/dist/templates/web/ui-auth-payments-video/template/src/app/loading.tsx +20 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/__tests__/example.test.tsx +49 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +6 -2
- package/dist/templates/web/ui-auth-payments-video/template/src/components/providers/theme-provider.tsx +94 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/shared/footer.tsx +36 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +2 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/components/ui/theme-toggle.tsx +34 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/lib/env.ts +49 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/lib/utils.ts +133 -0
- package/dist/templates/web/ui-auth-payments-video/template/src/test/setup.ts +79 -0
- package/dist/templates/web/ui-auth-payments-video/template/vitest.config.ts +17 -0
- package/dist/templates/web/ui-only/template/package.json +14 -4
- package/dist/templates/web/ui-only/template/src/app/error.tsx +67 -0
- package/dist/templates/web/ui-only/template/src/app/layout.tsx +6 -2
- package/dist/templates/web/ui-only/template/src/app/loading.tsx +20 -0
- package/dist/templates/web/ui-only/template/src/components/__tests__/example.test.tsx +49 -0
- package/dist/templates/web/ui-only/template/src/components/providers/app-providers.tsx +6 -2
- package/dist/templates/web/ui-only/template/src/components/providers/theme-provider.tsx +94 -0
- package/dist/templates/web/ui-only/template/src/components/shared/footer.tsx +36 -0
- package/dist/templates/web/ui-only/template/src/components/shared/header.tsx +2 -0
- package/dist/templates/web/ui-only/template/src/components/ui/theme-toggle.tsx +34 -0
- package/dist/templates/web/ui-only/template/src/lib/env.ts +49 -0
- package/dist/templates/web/ui-only/template/src/lib/utils.ts +133 -0
- package/dist/templates/web/ui-only/template/src/test/setup.ts +79 -0
- package/dist/templates/web/ui-only/template/vitest.config.ts +17 -0
- package/package.json +1 -1
- package/src/templates/web/base/template/package.json +20 -10
- package/src/templates/web/base/template/src/app/error.tsx +97 -0
- package/src/templates/web/base/template/src/app/layout.tsx +8 -2
- package/src/templates/web/base/template/src/app/loading.tsx +34 -0
- package/src/templates/web/base/template/src/components/__tests__/example.test.tsx +49 -0
- package/src/templates/web/base/template/src/components/providers/app-providers.tsx +6 -2
- package/src/templates/web/base/template/src/components/providers/theme-provider.tsx +94 -0
- package/src/templates/web/base/template/src/components/shared/footer.tsx +36 -0
- package/src/templates/web/base/template/src/components/shared/header.tsx +2 -0
- package/src/templates/web/base/template/src/components/ui/theme-toggle.tsx +34 -0
- package/src/templates/web/base/template/src/lib/auth-server.ts +177 -0
- package/src/templates/web/base/template/src/lib/env.ts +46 -0
- package/src/templates/web/base/template/src/lib/utils.ts +133 -0
- package/src/templates/web/base/template/src/test/setup.ts +79 -0
- package/src/templates/web/base/template/vitest.config.ts +17 -0
- package/src/templates/web/ui-auth/template/package.json +14 -4
- package/src/templates/web/ui-auth/template/src/app/error.tsx +67 -0
- package/src/templates/web/ui-auth/template/src/app/layout.tsx +6 -2
- package/src/templates/web/ui-auth/template/src/app/loading.tsx +20 -0
- package/src/templates/web/ui-auth/template/src/components/__tests__/example.test.tsx +49 -0
- package/src/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +6 -2
- package/src/templates/web/ui-auth/template/src/components/providers/theme-provider.tsx +94 -0
- package/src/templates/web/ui-auth/template/src/components/shared/footer.tsx +36 -0
- package/src/templates/web/ui-auth/template/src/components/shared/header.tsx +2 -0
- package/src/templates/web/ui-auth/template/src/components/ui/theme-toggle.tsx +34 -0
- package/src/templates/web/ui-auth/template/src/lib/env.ts +49 -0
- package/src/templates/web/ui-auth/template/src/lib/utils.ts +133 -0
- package/src/templates/web/ui-auth/template/src/test/setup.ts +79 -0
- package/src/templates/web/ui-auth/template/vitest.config.ts +17 -0
- package/src/templates/web/ui-auth-payments/template/middleware.ts +68 -0
- package/src/templates/web/ui-auth-payments/template/package.json +14 -4
- package/src/templates/web/ui-auth-payments/template/src/app/dashboard/layout.tsx +22 -0
- package/src/templates/web/ui-auth-payments/template/src/app/dashboard/page.tsx +183 -0
- package/src/templates/web/ui-auth-payments/template/src/app/error.tsx +67 -0
- package/src/templates/web/ui-auth-payments/template/src/app/layout.tsx +6 -2
- package/src/templates/web/ui-auth-payments/template/src/app/loading.tsx +20 -0
- package/src/templates/web/ui-auth-payments/template/src/app/login/loading.tsx +38 -0
- package/src/templates/web/ui-auth-payments/template/src/app/signup/loading.tsx +50 -0
- package/src/templates/web/ui-auth-payments/template/src/components/__tests__/example.test.tsx +49 -0
- package/src/templates/web/ui-auth-payments/template/src/components/client/auth-status.tsx +52 -0
- package/src/templates/web/ui-auth-payments/template/src/components/client/login-form.tsx +144 -0
- package/src/templates/web/ui-auth-payments/template/src/components/client/newsletter-signup.tsx +68 -0
- package/src/templates/web/ui-auth-payments/template/src/components/client/signup-form.tsx +185 -0
- package/src/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx +6 -2
- package/src/templates/web/ui-auth-payments/template/src/components/providers/theme-provider.tsx +94 -0
- package/src/templates/web/ui-auth-payments/template/src/components/shared/footer.tsx +36 -0
- package/src/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +2 -0
- package/src/templates/web/ui-auth-payments/template/src/components/ui/theme-toggle.tsx +34 -0
- package/src/templates/web/ui-auth-payments/template/src/lib/actions/auth.ts +246 -0
- package/src/templates/web/ui-auth-payments/template/src/lib/actions/index.ts +340 -0
- package/src/templates/web/ui-auth-payments/template/src/lib/auth-server.ts +177 -0
- package/src/templates/web/ui-auth-payments/template/src/lib/env.ts +49 -0
- package/src/templates/web/ui-auth-payments/template/src/lib/utils.ts +133 -0
- package/src/templates/web/ui-auth-payments/template/src/test/setup.ts +79 -0
- package/src/templates/web/ui-auth-payments/template/vitest.config.ts +17 -0
- package/src/templates/web/ui-auth-payments-audio/template/package.json +14 -4
- package/src/templates/web/ui-auth-payments-audio/template/src/app/error.tsx +67 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/layout.tsx +8 -2
- package/src/templates/web/ui-auth-payments-audio/template/src/app/loading.tsx +20 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/components/__tests__/example.test.tsx +49 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +6 -2
- package/src/templates/web/ui-auth-payments-audio/template/src/components/providers/theme-provider.tsx +94 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/components/shared/footer.tsx +36 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +2 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/components/ui/theme-toggle.tsx +34 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/lib/env.ts +49 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/lib/utils.ts +133 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/test/setup.ts +79 -0
- package/src/templates/web/ui-auth-payments-audio/template/vitest.config.ts +17 -0
- package/src/templates/web/ui-auth-payments-video/template/package.json +14 -4
- package/src/templates/web/ui-auth-payments-video/template/src/app/error.tsx +67 -0
- package/src/templates/web/ui-auth-payments-video/template/src/app/layout.tsx +6 -2
- package/src/templates/web/ui-auth-payments-video/template/src/app/loading.tsx +20 -0
- package/src/templates/web/ui-auth-payments-video/template/src/components/__tests__/example.test.tsx +49 -0
- package/src/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +6 -2
- package/src/templates/web/ui-auth-payments-video/template/src/components/providers/theme-provider.tsx +94 -0
- package/src/templates/web/ui-auth-payments-video/template/src/components/shared/footer.tsx +36 -0
- package/src/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +2 -0
- package/src/templates/web/ui-auth-payments-video/template/src/components/ui/theme-toggle.tsx +34 -0
- package/src/templates/web/ui-auth-payments-video/template/src/lib/env.ts +49 -0
- package/src/templates/web/ui-auth-payments-video/template/src/lib/utils.ts +133 -0
- package/src/templates/web/ui-auth-payments-video/template/src/test/setup.ts +79 -0
- package/src/templates/web/ui-auth-payments-video/template/vitest.config.ts +17 -0
- package/src/templates/web/ui-only/template/package.json +14 -4
- package/src/templates/web/ui-only/template/src/app/error.tsx +67 -0
- package/src/templates/web/ui-only/template/src/app/layout.tsx +6 -2
- package/src/templates/web/ui-only/template/src/app/loading.tsx +20 -0
- package/src/templates/web/ui-only/template/src/components/__tests__/example.test.tsx +49 -0
- package/src/templates/web/ui-only/template/src/components/providers/app-providers.tsx +6 -2
- package/src/templates/web/ui-only/template/src/components/providers/theme-provider.tsx +94 -0
- package/src/templates/web/ui-only/template/src/components/shared/footer.tsx +36 -0
- package/src/templates/web/ui-only/template/src/components/shared/header.tsx +2 -0
- package/src/templates/web/ui-only/template/src/components/ui/theme-toggle.tsx +34 -0
- package/src/templates/web/ui-only/template/src/lib/env.ts +49 -0
- package/src/templates/web/ui-only/template/src/lib/utils.ts +133 -0
- package/src/templates/web/ui-only/template/src/test/setup.ts +79 -0
- package/src/templates/web/ui-only/template/vitest.config.ts +17 -0
|
@@ -3,6 +3,7 @@ import { Inter } from 'next/font/google'
|
|
|
3
3
|
import './globals.css'
|
|
4
4
|
import { AppProviders } from '@/components/providers/app-providers'
|
|
5
5
|
import { Header } from '@/components/shared/header'
|
|
6
|
+
import { Footer } from '@/components/shared/footer'
|
|
6
7
|
|
|
7
8
|
const inter = Inter({ subsets: ['latin'] })
|
|
8
9
|
|
|
@@ -18,10 +19,13 @@ export default function RootLayout({
|
|
|
18
19
|
}) {
|
|
19
20
|
return (
|
|
20
21
|
<html lang="en" suppressHydrationWarning>
|
|
21
|
-
<body className={inter.className}>
|
|
22
|
+
<body className={`${inter.className} min-h-screen flex flex-col`}>
|
|
22
23
|
<AppProviders>
|
|
23
24
|
<Header />
|
|
24
|
-
|
|
25
|
+
<main className="flex-1">
|
|
26
|
+
{children}
|
|
27
|
+
</main>
|
|
28
|
+
<Footer />
|
|
25
29
|
</AppProviders>
|
|
26
30
|
</body>
|
|
27
31
|
</html>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Card } from '@digilogiclabs/saas-factory-ui'
|
|
2
|
+
import { Loader2 } from 'lucide-react'
|
|
3
|
+
|
|
4
|
+
export default function Loading() {
|
|
5
|
+
return (
|
|
6
|
+
<div className="min-h-screen bg-gray-50 dark:bg-gray-900 flex items-center justify-center p-4">
|
|
7
|
+
<Card className="w-full max-w-md p-8 text-center">
|
|
8
|
+
<div className="flex flex-col items-center">
|
|
9
|
+
<Loader2 className="h-8 w-8 animate-spin text-blue-600 dark:text-blue-400 mb-4" />
|
|
10
|
+
<h2 className="text-lg font-medium text-gray-900 dark:text-white mb-2">
|
|
11
|
+
Loading
|
|
12
|
+
</h2>
|
|
13
|
+
<p className="text-sm text-gray-600 dark:text-gray-300">
|
|
14
|
+
Please wait while we load your content...
|
|
15
|
+
</p>
|
|
16
|
+
</div>
|
|
17
|
+
</Card>
|
|
18
|
+
</div>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Card } from '@digilogiclabs/saas-factory-ui'
|
|
2
|
+
|
|
3
|
+
export default function LoginLoading() {
|
|
4
|
+
return (
|
|
5
|
+
<div className="flex items-center justify-center min-h-screen bg-gray-100 dark:bg-gray-900">
|
|
6
|
+
<Card className="w-full max-w-md p-8">
|
|
7
|
+
<div className="animate-pulse space-y-6">
|
|
8
|
+
{/* Title skeleton */}
|
|
9
|
+
<div className="h-8 bg-gray-200 dark:bg-gray-700 rounded-md mx-auto w-32"></div>
|
|
10
|
+
|
|
11
|
+
{/* Form skeleton */}
|
|
12
|
+
<div className="space-y-4">
|
|
13
|
+
{/* Email field */}
|
|
14
|
+
<div>
|
|
15
|
+
<div className="h-4 bg-gray-200 dark:bg-gray-700 rounded w-16 mb-2"></div>
|
|
16
|
+
<div className="h-10 bg-gray-200 dark:bg-gray-700 rounded"></div>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
{/* Password field */}
|
|
20
|
+
<div>
|
|
21
|
+
<div className="h-4 bg-gray-200 dark:bg-gray-700 rounded w-20 mb-2"></div>
|
|
22
|
+
<div className="h-10 bg-gray-200 dark:bg-gray-700 rounded"></div>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
{/* Sign in button */}
|
|
26
|
+
<div className="h-10 bg-blue-200 dark:bg-blue-800 rounded"></div>
|
|
27
|
+
|
|
28
|
+
{/* OAuth button */}
|
|
29
|
+
<div className="h-10 bg-gray-200 dark:bg-gray-700 rounded"></div>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
{/* Sign up link */}
|
|
33
|
+
<div className="h-4 bg-gray-200 dark:bg-gray-700 rounded w-48 mx-auto"></div>
|
|
34
|
+
</div>
|
|
35
|
+
</Card>
|
|
36
|
+
</div>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Card } from '@digilogiclabs/saas-factory-ui'
|
|
2
|
+
|
|
3
|
+
export default function SignupLoading() {
|
|
4
|
+
return (
|
|
5
|
+
<div className="flex items-center justify-center min-h-screen bg-gray-100 dark:bg-gray-900">
|
|
6
|
+
<Card className="w-full max-w-md p-8">
|
|
7
|
+
<div className="animate-pulse space-y-6">
|
|
8
|
+
{/* Title skeleton */}
|
|
9
|
+
<div className="h-8 bg-gray-200 dark:bg-gray-700 rounded-md mx-auto w-32"></div>
|
|
10
|
+
|
|
11
|
+
{/* Form skeleton */}
|
|
12
|
+
<div className="space-y-4">
|
|
13
|
+
{/* Name field */}
|
|
14
|
+
<div>
|
|
15
|
+
<div className="h-4 bg-gray-200 dark:bg-gray-700 rounded w-12 mb-2"></div>
|
|
16
|
+
<div className="h-10 bg-gray-200 dark:bg-gray-700 rounded"></div>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
{/* Email field */}
|
|
20
|
+
<div>
|
|
21
|
+
<div className="h-4 bg-gray-200 dark:bg-gray-700 rounded w-16 mb-2"></div>
|
|
22
|
+
<div className="h-10 bg-gray-200 dark:bg-gray-700 rounded"></div>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
{/* Password field */}
|
|
26
|
+
<div>
|
|
27
|
+
<div className="h-4 bg-gray-200 dark:bg-gray-700 rounded w-20 mb-2"></div>
|
|
28
|
+
<div className="h-10 bg-gray-200 dark:bg-gray-700 rounded"></div>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
{/* Confirm password field */}
|
|
32
|
+
<div>
|
|
33
|
+
<div className="h-4 bg-gray-200 dark:bg-gray-700 rounded w-32 mb-2"></div>
|
|
34
|
+
<div className="h-10 bg-gray-200 dark:bg-gray-700 rounded"></div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
{/* Sign up button */}
|
|
38
|
+
<div className="h-10 bg-blue-200 dark:bg-blue-800 rounded"></div>
|
|
39
|
+
|
|
40
|
+
{/* OAuth button */}
|
|
41
|
+
<div className="h-10 bg-gray-200 dark:bg-gray-700 rounded"></div>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
{/* Sign in link */}
|
|
45
|
+
<div className="h-4 bg-gray-200 dark:bg-gray-700 rounded w-44 mx-auto"></div>
|
|
46
|
+
</div>
|
|
47
|
+
</Card>
|
|
48
|
+
</div>
|
|
49
|
+
)
|
|
50
|
+
}
|
package/dist/templates/web/ui-auth-payments/template/src/components/__tests__/example.test.tsx
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Example test file demonstrating testing patterns for SaaS Factory components
|
|
3
|
+
*
|
|
4
|
+
* This is optional and serves as a reference for testing your components.
|
|
5
|
+
* You can delete this file if you don't need example tests.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { render, screen } from '@testing-library/react'
|
|
9
|
+
import { Button } from '@digilogiclabs/saas-factory-ui'
|
|
10
|
+
|
|
11
|
+
// Example: Testing UI components
|
|
12
|
+
describe('UI Components', () => {
|
|
13
|
+
it('renders button with correct text', () => {
|
|
14
|
+
render(<Button>Click me</Button>)
|
|
15
|
+
expect(screen.getByRole('button', { name: /click me/i })).toBeInTheDocument()
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
it('button can be disabled', () => {
|
|
19
|
+
render(<Button disabled>Disabled button</Button>)
|
|
20
|
+
expect(screen.getByRole('button')).toBeDisabled()
|
|
21
|
+
})
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
// Example: Testing custom components
|
|
25
|
+
function MockComponent({ title }: { title: string }) {
|
|
26
|
+
return <h1>{title}</h1>
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
describe('Custom Components', () => {
|
|
30
|
+
it('renders with correct title', () => {
|
|
31
|
+
render(<MockComponent title="Test Title" />)
|
|
32
|
+
expect(screen.getByRole('heading', { level: 1 })).toHaveTextContent('Test Title')
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
// Example: Testing utilities
|
|
37
|
+
function formatCurrency(amount: number): string {
|
|
38
|
+
return new Intl.NumberFormat('en-US', {
|
|
39
|
+
style: 'currency',
|
|
40
|
+
currency: 'USD',
|
|
41
|
+
}).format(amount)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
describe('Utilities', () => {
|
|
45
|
+
it('formats currency correctly', () => {
|
|
46
|
+
expect(formatCurrency(1000)).toBe('$1,000.00')
|
|
47
|
+
expect(formatCurrency(0)).toBe('$0.00')
|
|
48
|
+
})
|
|
49
|
+
})
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { Button } from '@digilogiclabs/saas-factory-ui'
|
|
4
|
+
import { LogOut, User } from 'lucide-react'
|
|
5
|
+
import { useAuth } from '@digilogiclabs/saas-factory-auth'
|
|
6
|
+
import Link from 'next/link'
|
|
7
|
+
|
|
8
|
+
export function AuthStatus() {
|
|
9
|
+
const { user, signOut, loading } = useAuth()
|
|
10
|
+
|
|
11
|
+
const handleSignOut = async () => {
|
|
12
|
+
try {
|
|
13
|
+
await signOut()
|
|
14
|
+
} catch (err) {
|
|
15
|
+
console.error('Sign out error:', err)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (loading) {
|
|
20
|
+
return (
|
|
21
|
+
<div className="text-sm text-gray-600 dark:text-gray-300">
|
|
22
|
+
Loading...
|
|
23
|
+
</div>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (user) {
|
|
28
|
+
return (
|
|
29
|
+
<div className="flex items-center gap-4">
|
|
30
|
+
<div className="flex items-center gap-2 text-sm text-gray-600 dark:text-gray-300">
|
|
31
|
+
<User className="w-4 h-4" />
|
|
32
|
+
Welcome, {user.email}
|
|
33
|
+
</div>
|
|
34
|
+
<Button variant="outline" size="sm" onClick={handleSignOut}>
|
|
35
|
+
<LogOut className="w-4 h-4 mr-2" />
|
|
36
|
+
Sign Out
|
|
37
|
+
</Button>
|
|
38
|
+
</div>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<div className="flex gap-2">
|
|
44
|
+
<Link href="/login">
|
|
45
|
+
<Button variant="outline" size="sm">Sign In</Button>
|
|
46
|
+
</Link>
|
|
47
|
+
<Link href="/signup">
|
|
48
|
+
<Button size="sm">Sign Up</Button>
|
|
49
|
+
</Link>
|
|
50
|
+
</div>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import React, { useState, useActionState } from 'react'
|
|
4
|
+
import { Button, Card, Input, Label } from '@digilogiclabs/saas-factory-ui'
|
|
5
|
+
import { useAuth } from '@digilogiclabs/saas-factory-auth'
|
|
6
|
+
import { useRouter } from 'next/navigation'
|
|
7
|
+
import { signInAction } from '@/lib/actions/auth'
|
|
8
|
+
|
|
9
|
+
export function LoginForm() {
|
|
10
|
+
const [email, setEmail] = useState('')
|
|
11
|
+
const [password, setPassword] = useState('')
|
|
12
|
+
const { signIn, signInWithOAuth, loading, error, user } = useAuth()
|
|
13
|
+
const [actionState, formAction] = useActionState(signInAction, null)
|
|
14
|
+
const router = useRouter()
|
|
15
|
+
|
|
16
|
+
// Redirect if already logged in
|
|
17
|
+
React.useEffect(() => {
|
|
18
|
+
if (user) {
|
|
19
|
+
router.push('/')
|
|
20
|
+
}
|
|
21
|
+
}, [user, router])
|
|
22
|
+
|
|
23
|
+
const handleLogin = async (e: React.FormEvent) => {
|
|
24
|
+
e.preventDefault()
|
|
25
|
+
try {
|
|
26
|
+
await signIn(email, password)
|
|
27
|
+
router.push('/')
|
|
28
|
+
} catch (err) {
|
|
29
|
+
console.error('Login error:', err)
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const handleGoogleLogin = async () => {
|
|
34
|
+
try {
|
|
35
|
+
await signInWithOAuth('google', window.location.origin)
|
|
36
|
+
} catch (err) {
|
|
37
|
+
console.error('Google login error:', err)
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Enhanced form action that uses both server action validation and client auth
|
|
42
|
+
const handleServerAction = async (formData: FormData) => {
|
|
43
|
+
const result = await formAction(formData)
|
|
44
|
+
|
|
45
|
+
if (result?.success) {
|
|
46
|
+
// If server validation passes, proceed with client auth
|
|
47
|
+
const emailValue = formData.get('email') as string
|
|
48
|
+
const passwordValue = formData.get('password') as string
|
|
49
|
+
|
|
50
|
+
try {
|
|
51
|
+
await signIn(emailValue, passwordValue)
|
|
52
|
+
router.push('/')
|
|
53
|
+
} catch (err) {
|
|
54
|
+
console.error('Login error:', err)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (loading) {
|
|
60
|
+
return (
|
|
61
|
+
<div className="flex items-center justify-center min-h-screen bg-gray-100 dark:bg-gray-900">
|
|
62
|
+
<div>Loading...</div>
|
|
63
|
+
</div>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<div className="flex items-center justify-center min-h-screen bg-gray-100 dark:bg-gray-900">
|
|
69
|
+
<Card className="w-full max-w-md p-8">
|
|
70
|
+
<h1 className="text-2xl font-bold text-center mb-6">Sign In</h1>
|
|
71
|
+
|
|
72
|
+
{/* Server action errors */}
|
|
73
|
+
{actionState?.error && (
|
|
74
|
+
<div className="mb-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded">
|
|
75
|
+
{actionState.error}
|
|
76
|
+
</div>
|
|
77
|
+
)}
|
|
78
|
+
|
|
79
|
+
{/* Client auth errors */}
|
|
80
|
+
{error && (
|
|
81
|
+
<div className="mb-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded">
|
|
82
|
+
{error.message}
|
|
83
|
+
</div>
|
|
84
|
+
)}
|
|
85
|
+
|
|
86
|
+
<form action={handleServerAction} className="space-y-4">
|
|
87
|
+
<div>
|
|
88
|
+
<Label htmlFor="email">Email</Label>
|
|
89
|
+
<Input
|
|
90
|
+
id="email"
|
|
91
|
+
name="email"
|
|
92
|
+
type="email"
|
|
93
|
+
value={email}
|
|
94
|
+
onChange={(e) => setEmail(e.target.value)}
|
|
95
|
+
placeholder="Enter your email"
|
|
96
|
+
required
|
|
97
|
+
disabled={loading}
|
|
98
|
+
/>
|
|
99
|
+
{actionState?.fieldErrors?.email && (
|
|
100
|
+
<p className="text-sm text-red-600 mt-1">{actionState.fieldErrors.email[0]}</p>
|
|
101
|
+
)}
|
|
102
|
+
</div>
|
|
103
|
+
<div>
|
|
104
|
+
<Label htmlFor="password">Password</Label>
|
|
105
|
+
<Input
|
|
106
|
+
id="password"
|
|
107
|
+
name="password"
|
|
108
|
+
type="password"
|
|
109
|
+
value={password}
|
|
110
|
+
onChange={(e) => setPassword(e.target.value)}
|
|
111
|
+
placeholder="Enter your password"
|
|
112
|
+
required
|
|
113
|
+
disabled={loading}
|
|
114
|
+
/>
|
|
115
|
+
{actionState?.fieldErrors?.password && (
|
|
116
|
+
<p className="text-sm text-red-600 mt-1">{actionState.fieldErrors.password[0]}</p>
|
|
117
|
+
)}
|
|
118
|
+
</div>
|
|
119
|
+
<Button type="submit" className="w-full" disabled={loading}>
|
|
120
|
+
{loading ? 'Signing In...' : 'Sign In'}
|
|
121
|
+
</Button>
|
|
122
|
+
<Button
|
|
123
|
+
type="button"
|
|
124
|
+
variant="outline"
|
|
125
|
+
className="w-full"
|
|
126
|
+
onClick={handleGoogleLogin}
|
|
127
|
+
disabled={loading}
|
|
128
|
+
>
|
|
129
|
+
Sign in with Google
|
|
130
|
+
</Button>
|
|
131
|
+
</form>
|
|
132
|
+
|
|
133
|
+
<div className="mt-4 text-center">
|
|
134
|
+
<p className="text-sm text-gray-600 dark:text-gray-300">
|
|
135
|
+
Don't have an account?{' '}
|
|
136
|
+
<a href="/signup" className="text-blue-600 hover:underline dark:text-blue-400">
|
|
137
|
+
Sign up
|
|
138
|
+
</a>
|
|
139
|
+
</p>
|
|
140
|
+
</div>
|
|
141
|
+
</Card>
|
|
142
|
+
</div>
|
|
143
|
+
)
|
|
144
|
+
}
|
package/dist/templates/web/ui-auth-payments/template/src/components/client/newsletter-signup.tsx
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useState, useActionState } from 'react'
|
|
4
|
+
import { Button, Input, Label } from '@digilogiclabs/saas-factory-ui'
|
|
5
|
+
import { subscribeToNewsletter } from '@/lib/actions'
|
|
6
|
+
|
|
7
|
+
export function NewsletterSignup() {
|
|
8
|
+
const [email, setEmail] = useState('')
|
|
9
|
+
const [state, formAction, isPending] = useActionState(subscribeToNewsletter, null)
|
|
10
|
+
|
|
11
|
+
const handleSubmit = async (formData: FormData) => {
|
|
12
|
+
await formAction(formData)
|
|
13
|
+
if (state?.success) {
|
|
14
|
+
setEmail('') // Clear form on success
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div className="bg-blue-600 dark:bg-blue-800 rounded-lg p-6 text-white">
|
|
20
|
+
<h3 className="text-lg font-semibold mb-2">Stay Updated</h3>
|
|
21
|
+
<p className="text-blue-100 dark:text-blue-200 mb-4 text-sm">
|
|
22
|
+
Get the latest updates and features delivered to your inbox
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
{state?.success && (
|
|
26
|
+
<div className="mb-4 p-3 bg-green-100 border border-green-400 text-green-700 rounded">
|
|
27
|
+
{state.data?.message}
|
|
28
|
+
</div>
|
|
29
|
+
)}
|
|
30
|
+
|
|
31
|
+
{state?.error && (
|
|
32
|
+
<div className="mb-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded">
|
|
33
|
+
{state.error}
|
|
34
|
+
</div>
|
|
35
|
+
)}
|
|
36
|
+
|
|
37
|
+
<form action={handleSubmit} className="flex gap-2">
|
|
38
|
+
<div className="flex-1">
|
|
39
|
+
<Label htmlFor="newsletter-email" className="sr-only">
|
|
40
|
+
Email address
|
|
41
|
+
</Label>
|
|
42
|
+
<Input
|
|
43
|
+
id="newsletter-email"
|
|
44
|
+
name="email"
|
|
45
|
+
type="email"
|
|
46
|
+
value={email}
|
|
47
|
+
onChange={(e) => setEmail(e.target.value)}
|
|
48
|
+
placeholder="Enter your email"
|
|
49
|
+
required
|
|
50
|
+
disabled={isPending}
|
|
51
|
+
className="bg-white dark:bg-gray-800 text-gray-900 dark:text-white"
|
|
52
|
+
/>
|
|
53
|
+
</div>
|
|
54
|
+
<Button
|
|
55
|
+
type="submit"
|
|
56
|
+
variant="secondary"
|
|
57
|
+
disabled={isPending}
|
|
58
|
+
>
|
|
59
|
+
{isPending ? 'Subscribing...' : 'Subscribe'}
|
|
60
|
+
</Button>
|
|
61
|
+
</form>
|
|
62
|
+
|
|
63
|
+
<p className="text-xs text-blue-200 dark:text-blue-300 mt-2">
|
|
64
|
+
We respect your privacy. Unsubscribe at any time.
|
|
65
|
+
</p>
|
|
66
|
+
</div>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import React, { useState, useActionState } from 'react'
|
|
4
|
+
import { Button, Card, Input, Label } from '@digilogiclabs/saas-factory-ui'
|
|
5
|
+
import { useAuth } from '@digilogiclabs/saas-factory-auth'
|
|
6
|
+
import { useRouter } from 'next/navigation'
|
|
7
|
+
import { signUpAction } from '@/lib/actions/auth'
|
|
8
|
+
|
|
9
|
+
export function SignupForm() {
|
|
10
|
+
const [name, setName] = useState('')
|
|
11
|
+
const [email, setEmail] = useState('')
|
|
12
|
+
const [password, setPassword] = useState('')
|
|
13
|
+
const [confirmPassword, setConfirmPassword] = useState('')
|
|
14
|
+
const { signUp, signInWithOAuth, loading, error, user } = useAuth()
|
|
15
|
+
const [actionState, formAction] = useActionState(signUpAction, null)
|
|
16
|
+
const router = useRouter()
|
|
17
|
+
|
|
18
|
+
// Redirect if already logged in
|
|
19
|
+
React.useEffect(() => {
|
|
20
|
+
if (user) {
|
|
21
|
+
router.push('/')
|
|
22
|
+
}
|
|
23
|
+
}, [user, router])
|
|
24
|
+
|
|
25
|
+
const handleSignUp = async (e: React.FormEvent) => {
|
|
26
|
+
e.preventDefault()
|
|
27
|
+
|
|
28
|
+
if (password !== confirmPassword) {
|
|
29
|
+
console.error('Passwords do not match')
|
|
30
|
+
return
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
try {
|
|
34
|
+
await signUp(email, password, { name })
|
|
35
|
+
router.push('/')
|
|
36
|
+
} catch (err) {
|
|
37
|
+
console.error('Sign up error:', err)
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const handleGoogleSignUp = async () => {
|
|
42
|
+
try {
|
|
43
|
+
await signInWithOAuth('google', window.location.origin)
|
|
44
|
+
} catch (err) {
|
|
45
|
+
console.error('Google sign up error:', err)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Enhanced form action that uses both server action validation and client auth
|
|
50
|
+
const handleServerAction = async (formData: FormData) => {
|
|
51
|
+
const result = await formAction(formData)
|
|
52
|
+
|
|
53
|
+
if (result?.success) {
|
|
54
|
+
// If server validation passes, proceed with client auth
|
|
55
|
+
const emailValue = formData.get('email') as string
|
|
56
|
+
const passwordValue = formData.get('password') as string
|
|
57
|
+
const nameValue = formData.get('name') as string
|
|
58
|
+
|
|
59
|
+
try {
|
|
60
|
+
await signUp(emailValue, passwordValue, { name: nameValue })
|
|
61
|
+
router.push('/')
|
|
62
|
+
} catch (err) {
|
|
63
|
+
console.error('Sign up error:', err)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (loading) {
|
|
69
|
+
return (
|
|
70
|
+
<div className="flex items-center justify-center min-h-screen bg-gray-100 dark:bg-gray-900">
|
|
71
|
+
<div>Loading...</div>
|
|
72
|
+
</div>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<div className="flex items-center justify-center min-h-screen bg-gray-100 dark:bg-gray-900">
|
|
78
|
+
<Card className="w-full max-w-md p-8">
|
|
79
|
+
<h1 className="text-2xl font-bold text-center mb-6">Sign Up</h1>
|
|
80
|
+
|
|
81
|
+
{/* Server action errors */}
|
|
82
|
+
{actionState?.error && (
|
|
83
|
+
<div className="mb-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded">
|
|
84
|
+
{actionState.error}
|
|
85
|
+
</div>
|
|
86
|
+
)}
|
|
87
|
+
|
|
88
|
+
{/* Client auth errors */}
|
|
89
|
+
{error && (
|
|
90
|
+
<div className="mb-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded">
|
|
91
|
+
{error.message}
|
|
92
|
+
</div>
|
|
93
|
+
)}
|
|
94
|
+
|
|
95
|
+
<form action={handleServerAction} className="space-y-4">
|
|
96
|
+
<div>
|
|
97
|
+
<Label htmlFor="name">Name</Label>
|
|
98
|
+
<Input
|
|
99
|
+
id="name"
|
|
100
|
+
name="name"
|
|
101
|
+
type="text"
|
|
102
|
+
value={name}
|
|
103
|
+
onChange={(e) => setName(e.target.value)}
|
|
104
|
+
placeholder="Enter your name"
|
|
105
|
+
required
|
|
106
|
+
disabled={loading}
|
|
107
|
+
/>
|
|
108
|
+
{actionState?.fieldErrors?.name && (
|
|
109
|
+
<p className="text-sm text-red-600 mt-1">{actionState.fieldErrors.name[0]}</p>
|
|
110
|
+
)}
|
|
111
|
+
</div>
|
|
112
|
+
<div>
|
|
113
|
+
<Label htmlFor="email">Email</Label>
|
|
114
|
+
<Input
|
|
115
|
+
id="email"
|
|
116
|
+
name="email"
|
|
117
|
+
type="email"
|
|
118
|
+
value={email}
|
|
119
|
+
onChange={(e) => setEmail(e.target.value)}
|
|
120
|
+
placeholder="Enter your email"
|
|
121
|
+
required
|
|
122
|
+
disabled={loading}
|
|
123
|
+
/>
|
|
124
|
+
{actionState?.fieldErrors?.email && (
|
|
125
|
+
<p className="text-sm text-red-600 mt-1">{actionState.fieldErrors.email[0]}</p>
|
|
126
|
+
)}
|
|
127
|
+
</div>
|
|
128
|
+
<div>
|
|
129
|
+
<Label htmlFor="password">Password</Label>
|
|
130
|
+
<Input
|
|
131
|
+
id="password"
|
|
132
|
+
name="password"
|
|
133
|
+
type="password"
|
|
134
|
+
value={password}
|
|
135
|
+
onChange={(e) => setPassword(e.target.value)}
|
|
136
|
+
placeholder="Enter your password"
|
|
137
|
+
required
|
|
138
|
+
disabled={loading}
|
|
139
|
+
/>
|
|
140
|
+
{actionState?.fieldErrors?.password && (
|
|
141
|
+
<p className="text-sm text-red-600 mt-1">{actionState.fieldErrors.password[0]}</p>
|
|
142
|
+
)}
|
|
143
|
+
</div>
|
|
144
|
+
<div>
|
|
145
|
+
<Label htmlFor="confirmPassword">Confirm Password</Label>
|
|
146
|
+
<Input
|
|
147
|
+
id="confirmPassword"
|
|
148
|
+
name="confirmPassword"
|
|
149
|
+
type="password"
|
|
150
|
+
value={confirmPassword}
|
|
151
|
+
onChange={(e) => setConfirmPassword(e.target.value)}
|
|
152
|
+
placeholder="Confirm your password"
|
|
153
|
+
required
|
|
154
|
+
disabled={loading}
|
|
155
|
+
/>
|
|
156
|
+
{actionState?.fieldErrors?.confirmPassword && (
|
|
157
|
+
<p className="text-sm text-red-600 mt-1">{actionState.fieldErrors.confirmPassword[0]}</p>
|
|
158
|
+
)}
|
|
159
|
+
</div>
|
|
160
|
+
<Button type="submit" className="w-full" disabled={loading}>
|
|
161
|
+
{loading ? 'Signing Up...' : 'Sign Up'}
|
|
162
|
+
</Button>
|
|
163
|
+
<Button
|
|
164
|
+
type="button"
|
|
165
|
+
variant="outline"
|
|
166
|
+
className="w-full"
|
|
167
|
+
onClick={handleGoogleSignUp}
|
|
168
|
+
disabled={loading}
|
|
169
|
+
>
|
|
170
|
+
Sign up with Google
|
|
171
|
+
</Button>
|
|
172
|
+
</form>
|
|
173
|
+
|
|
174
|
+
<div className="mt-4 text-center">
|
|
175
|
+
<p className="text-sm text-gray-600 dark:text-gray-300">
|
|
176
|
+
Already have an account?{' '}
|
|
177
|
+
<a href="/login" className="text-blue-600 hover:underline dark:text-blue-400">
|
|
178
|
+
Sign in
|
|
179
|
+
</a>
|
|
180
|
+
</p>
|
|
181
|
+
</div>
|
|
182
|
+
</Card>
|
|
183
|
+
</div>
|
|
184
|
+
)
|
|
185
|
+
}
|
package/dist/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx
CHANGED
|
@@ -4,6 +4,7 @@ import React from 'react'
|
|
|
4
4
|
import { ThemeProvider } from 'next-themes'
|
|
5
5
|
import { AuthProvider } from '@digilogiclabs/saas-factory-auth'
|
|
6
6
|
import { PaymentsProvider } from '@digilogiclabs/saas-factory-payments'
|
|
7
|
+
import { AppThemeProvider } from './theme-provider'
|
|
7
8
|
|
|
8
9
|
interface AppProvidersProps {
|
|
9
10
|
children: React.ReactNode
|
|
@@ -13,13 +14,16 @@ export function AppProviders({ children }: AppProvidersProps) {
|
|
|
13
14
|
return (
|
|
14
15
|
<ThemeProvider
|
|
15
16
|
attribute="class"
|
|
16
|
-
defaultTheme="
|
|
17
|
+
defaultTheme="{{defaultTheme}}"
|
|
17
18
|
enableSystem
|
|
18
19
|
disableTransitionOnChange
|
|
20
|
+
storageKey="{{packageName}}-theme"
|
|
19
21
|
>
|
|
20
22
|
<AuthProvider>
|
|
21
23
|
<PaymentsProvider>
|
|
22
|
-
{
|
|
24
|
+
<AppThemeProvider themeColor="{{themeColor}}">
|
|
25
|
+
{children}
|
|
26
|
+
</AppThemeProvider>
|
|
23
27
|
</PaymentsProvider>
|
|
24
28
|
</AuthProvider>
|
|
25
29
|
</ThemeProvider>
|