create-varity-app 2.0.0-beta.14 → 2.0.0-beta.15
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
|
@@ -4,7 +4,6 @@ import { useState, useEffect, useCallback } from 'react';
|
|
|
4
4
|
import { useRouter, usePathname } from 'next/navigation';
|
|
5
5
|
import { APP_NAME, NAVIGATION_ITEMS } from '@/lib/constants';
|
|
6
6
|
import { useProjects, useTasks, useTeam } from '@/lib/hooks';
|
|
7
|
-
import { withBasePath } from '@/lib/utils';
|
|
8
7
|
import { CommandPalette } from '@varity-labs/ui-kit';
|
|
9
8
|
import { Menu, X } from 'lucide-react';
|
|
10
9
|
|
|
@@ -25,7 +24,7 @@ try {
|
|
|
25
24
|
function RedirectToLogin() {
|
|
26
25
|
const router = useRouter();
|
|
27
26
|
useEffect(() => {
|
|
28
|
-
router.push(
|
|
27
|
+
router.push('/login');
|
|
29
28
|
}, [router]);
|
|
30
29
|
return null;
|
|
31
30
|
}
|
|
@@ -155,7 +154,7 @@ function DashboardShell({ children }: { children: React.ReactNode }) {
|
|
|
155
154
|
|
|
156
155
|
const handleLogout = async () => {
|
|
157
156
|
await logout();
|
|
158
|
-
window.location.href =
|
|
157
|
+
window.location.href = '/';
|
|
159
158
|
};
|
|
160
159
|
|
|
161
160
|
// Fallback layout when DashboardLayout from ui-kit isn't available
|
|
@@ -165,7 +164,7 @@ function DashboardShell({ children }: { children: React.ReactNode }) {
|
|
|
165
164
|
<CommandPalette
|
|
166
165
|
open={commandPaletteOpen}
|
|
167
166
|
onClose={() => setCommandPaletteOpen(false)}
|
|
168
|
-
onNavigate={(path: string) => router.push(
|
|
167
|
+
onNavigate={(path: string) => router.push(path)}
|
|
169
168
|
projects={projects}
|
|
170
169
|
tasks={tasks}
|
|
171
170
|
team={team}
|
|
@@ -182,7 +181,7 @@ function DashboardShell({ children }: { children: React.ReactNode }) {
|
|
|
182
181
|
{navWithActive.map((item) => (
|
|
183
182
|
<button
|
|
184
183
|
key={item.path}
|
|
185
|
-
onClick={() => router.push(
|
|
184
|
+
onClick={() => router.push(item.path)}
|
|
186
185
|
className={`flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium transition-colors ${
|
|
187
186
|
item.active
|
|
188
187
|
? 'bg-primary-50 text-primary-700'
|
|
@@ -212,7 +211,7 @@ function DashboardShell({ children }: { children: React.ReactNode }) {
|
|
|
212
211
|
navItems={navWithActive}
|
|
213
212
|
userEmail={userEmail}
|
|
214
213
|
onLogout={handleLogout}
|
|
215
|
-
onNavigate={(path) => router.push(
|
|
214
|
+
onNavigate={(path) => router.push(path)}
|
|
216
215
|
/>
|
|
217
216
|
)}
|
|
218
217
|
|
|
@@ -229,7 +228,7 @@ function DashboardShell({ children }: { children: React.ReactNode }) {
|
|
|
229
228
|
<CommandPalette
|
|
230
229
|
open={commandPaletteOpen}
|
|
231
230
|
onClose={() => setCommandPaletteOpen(false)}
|
|
232
|
-
onNavigate={(path: string) => router.push(
|
|
231
|
+
onNavigate={(path: string) => router.push(path)}
|
|
233
232
|
projects={projects}
|
|
234
233
|
tasks={tasks}
|
|
235
234
|
team={team}
|
|
@@ -243,7 +242,7 @@ function DashboardShell({ children }: { children: React.ReactNode }) {
|
|
|
243
242
|
navItems={navWithActive}
|
|
244
243
|
userEmail={userEmail}
|
|
245
244
|
onLogout={handleLogout}
|
|
246
|
-
onNavigate={(path) => router.push(
|
|
245
|
+
onNavigate={(path) => router.push(path)}
|
|
247
246
|
/>
|
|
248
247
|
)}
|
|
249
248
|
|
|
@@ -259,8 +258,8 @@ function DashboardShell({ children }: { children: React.ReactNode }) {
|
|
|
259
258
|
address: userEmail,
|
|
260
259
|
}}
|
|
261
260
|
onLogout={handleLogout}
|
|
262
|
-
onNavigateToProfile={() => router.push(
|
|
263
|
-
onNavigateToSettings={() => router.push(
|
|
261
|
+
onNavigateToProfile={() => router.push('/dashboard/settings')}
|
|
262
|
+
onNavigateToSettings={() => router.push('/dashboard/settings')}
|
|
264
263
|
onSearchClick={() => setCommandPaletteOpen(true)}
|
|
265
264
|
searchPlaceholder="Search projects, tasks, team..."
|
|
266
265
|
>
|
|
@@ -5,7 +5,6 @@ import { useRouter } from 'next/navigation';
|
|
|
5
5
|
import Link from 'next/link';
|
|
6
6
|
import { CheckCircle } from 'lucide-react';
|
|
7
7
|
import { APP_NAME } from '@/lib/constants';
|
|
8
|
-
import { withBasePath } from '@/lib/utils';
|
|
9
8
|
|
|
10
9
|
let PrivyStackComponent: any = null;
|
|
11
10
|
let usePrivyHook: (() => { authenticated: boolean; ready: boolean; login: () => void }) | null = null;
|
|
@@ -23,7 +22,7 @@ function LoginContent() {
|
|
|
23
22
|
|
|
24
23
|
useEffect(() => {
|
|
25
24
|
if (privy?.authenticated) {
|
|
26
|
-
router.push(
|
|
25
|
+
router.push('/dashboard');
|
|
27
26
|
}
|
|
28
27
|
}, [privy?.authenticated, router]);
|
|
29
28
|
|
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Navigate using Next.js basePath-aware paths.
|
|
3
|
-
* In static export with basePath, router.push does NOT prepend basePath
|
|
4
|
-
* automatically, so we do it manually.
|
|
5
|
-
*/
|
|
6
|
-
export function getBasePath(): string {
|
|
7
|
-
return process.env.NEXT_PUBLIC_BASE_PATH || '';
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function withBasePath(path: string): string {
|
|
11
|
-
const base = getBasePath();
|
|
12
|
-
if (!base) return path;
|
|
13
|
-
return `${base}${path}`;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
1
|
export function formatDate(dateString: string | undefined | null): string {
|
|
17
2
|
if (!dateString) return '—';
|
|
18
3
|
const date = new Date(dateString);
|