frontend changes
This commit is contained in:
parent
5cc0f02ac2
commit
2cc7cdbf00
@ -3,7 +3,6 @@ import type { NextConfig } from "next";
|
|||||||
const nextConfig: NextConfig = {
|
const nextConfig: NextConfig = {
|
||||||
transpilePackages: ['@tldraw/tldraw'],
|
transpilePackages: ['@tldraw/tldraw'],
|
||||||
output: 'export',
|
output: 'export',
|
||||||
trailingSlash: true,
|
|
||||||
eslint: { ignoreDuringBuilds: true },
|
eslint: { ignoreDuringBuilds: true },
|
||||||
typescript: { ignoreBuildErrors: true },
|
typescript: { ignoreBuildErrors: true },
|
||||||
webpack: (config, { isServer }) => {
|
webpack: (config, { isServer }) => {
|
||||||
|
|||||||
@ -1,7 +1,26 @@
|
|||||||
import { Suspense } from "react"
|
"use client"
|
||||||
|
|
||||||
|
import { Suspense, useEffect } from "react"
|
||||||
|
import { useRouter } from "next/navigation"
|
||||||
import { MainDashboard } from "@/components/main-dashboard"
|
import { MainDashboard } from "@/components/main-dashboard"
|
||||||
|
import { useAuth } from "@/contexts/auth-context"
|
||||||
|
|
||||||
export default function ProjectBuilderPage() {
|
export default function ProjectBuilderPage() {
|
||||||
|
const router = useRouter()
|
||||||
|
const { user, isLoading } = useAuth()
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (isLoading) return
|
||||||
|
if (!user) {
|
||||||
|
const returnUrl = encodeURIComponent("/project-builder")
|
||||||
|
router.replace(`/signin?returnUrl=${returnUrl}`)
|
||||||
|
}
|
||||||
|
}, [user, isLoading, router])
|
||||||
|
|
||||||
|
if (isLoading || !user) {
|
||||||
|
return <div className="min-h-screen flex items-center justify-center">Loading...</div>
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Suspense fallback={<div>Loading...</div>}>
|
<Suspense fallback={<div>Loading...</div>}>
|
||||||
<MainDashboard />
|
<MainDashboard />
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user