@djangocfg/layouts 1.2.0 → 1.2.1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/layouts",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Layout system and components for Unrealon applications",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "DjangoCFG",
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"check": "tsc --noEmit"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@djangocfg/api": "^1.2.
|
|
57
|
-
"@djangocfg/og-image": "^1.2.
|
|
58
|
-
"@djangocfg/ui": "^1.2.
|
|
56
|
+
"@djangocfg/api": "^1.2.1",
|
|
57
|
+
"@djangocfg/og-image": "^1.2.1",
|
|
58
|
+
"@djangocfg/ui": "^1.2.1",
|
|
59
59
|
"@hookform/resolvers": "^5.2.0",
|
|
60
60
|
"consola": "^3.4.2",
|
|
61
61
|
"lucide-react": "^0.468.0",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"vidstack": "0.6.15"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@djangocfg/typescript-config": "^1.2.
|
|
79
|
+
"@djangocfg/typescript-config": "^1.2.1",
|
|
80
80
|
"@types/node": "^24.7.2",
|
|
81
81
|
"@types/react": "19.2.2",
|
|
82
82
|
"@types/react-dom": "19.2.1",
|
|
@@ -89,8 +89,19 @@ function LayoutRouter({
|
|
|
89
89
|
// If forceLayout is specified, use it
|
|
90
90
|
if (forceLayout) return forceLayout;
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
const isAuthRoute = config.routes.detectors.isAuthRoute(router.pathname);
|
|
93
|
+
const isPrivateRoute = config.routes.detectors.isPrivateRoute(router.pathname);
|
|
94
|
+
// const isPublicRoute = config.routes.detectors.isPublicRoute(router.pathname);
|
|
95
|
+
|
|
96
|
+
if (isAuthRoute) return 'auth';
|
|
97
|
+
|
|
98
|
+
if (isPrivateRoute) {
|
|
99
|
+
if (isAuthenticated) {
|
|
100
|
+
return 'private';
|
|
101
|
+
};
|
|
102
|
+
return 'auth';
|
|
103
|
+
};
|
|
104
|
+
|
|
94
105
|
return 'public';
|
|
95
106
|
};
|
|
96
107
|
|
|
@@ -102,19 +113,17 @@ function LayoutRouter({
|
|
|
102
113
|
case 'public':
|
|
103
114
|
return <PublicLayout>{children}</PublicLayout>;
|
|
104
115
|
|
|
105
|
-
// Auth routes: render inside
|
|
116
|
+
// Auth routes: render inside AuthLayout
|
|
106
117
|
case 'auth':
|
|
107
118
|
return (
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
</AuthLayout>
|
|
117
|
-
</PublicLayout>
|
|
119
|
+
<AuthLayout
|
|
120
|
+
termsUrl={config.auth?.termsUrl}
|
|
121
|
+
privacyUrl={config.auth?.privacyUrl}
|
|
122
|
+
supportUrl={config.auth?.supportUrl}
|
|
123
|
+
enablePhoneAuth={config.auth?.enablePhoneAuth}
|
|
124
|
+
>
|
|
125
|
+
{children}
|
|
126
|
+
</AuthLayout>
|
|
118
127
|
);
|
|
119
128
|
|
|
120
129
|
// Private routes: wait for client-side hydration and auth check
|
|
@@ -7,10 +7,11 @@ import { OTPForm } from './OTPForm';
|
|
|
7
7
|
import type { AuthProps } from './types';
|
|
8
8
|
|
|
9
9
|
export const AuthLayout: React.FC<AuthProps> = (props) => {
|
|
10
|
+
|
|
10
11
|
return (
|
|
11
12
|
<AuthProvider {...props}>
|
|
12
13
|
<div
|
|
13
|
-
className={`flex flex-col items-center justify-center bg-background py-6 px-4 sm:py-12 sm:px-6 lg:px-8 ${props.className || ''}`}
|
|
14
|
+
className={`min-h-screen flex flex-col items-center justify-center bg-background py-6 px-4 sm:py-12 sm:px-6 lg:px-8 ${props.className || ''}`}
|
|
14
15
|
>
|
|
15
16
|
<div className="w-full sm:max-w-md space-y-8">
|
|
16
17
|
{props.children}
|
|
@@ -28,11 +29,11 @@ const AuthContent: React.FC = () => {
|
|
|
28
29
|
|
|
29
30
|
return (
|
|
30
31
|
<>
|
|
31
|
-
{error && (
|
|
32
|
+
{/* {error && (
|
|
32
33
|
<div className="bg-destructive/10 border border-destructive/20 text-destructive px-4 py-3 rounded-md">
|
|
33
34
|
{error}
|
|
34
35
|
</div>
|
|
35
|
-
)}
|
|
36
|
+
)} */}
|
|
36
37
|
|
|
37
38
|
<div>{step === 'identifier' ? <IdentifierForm /> : <OTPForm />}</div>
|
|
38
39
|
</>
|
|
@@ -101,15 +101,7 @@ export const IdentifierForm: React.FC = () => {
|
|
|
101
101
|
? 'Enter your phone number to receive a verification code via SMS'
|
|
102
102
|
: 'Enter your email address to receive a verification code';
|
|
103
103
|
};
|
|
104
|
-
|
|
105
|
-
const getChannelIcon = () => {
|
|
106
|
-
return localChannel === 'phone' ? (
|
|
107
|
-
<Phone className="w-5 h-5" />
|
|
108
|
-
) : (
|
|
109
|
-
<Mail className="w-5 h-5" />
|
|
110
|
-
);
|
|
111
|
-
};
|
|
112
|
-
|
|
104
|
+
|
|
113
105
|
return (
|
|
114
106
|
<Card className="w-full max-w-md mx-auto shadow-lg border border-border bg-card/50 backdrop-blur-sm">
|
|
115
107
|
<CardHeader className="text-center pb-6">
|