This commit is contained in:
ct
2025-07-15 05:11:25 +08:00
parent b7e5f42f7a
commit 8b29b6d6b3
12 changed files with 132 additions and 175 deletions

View File

@@ -1,7 +1,7 @@
import AuthUser from '@/modules/auth/auth-user';
import Footer from '@/pages/front/partials/Footer.jsx';
import { Head } from '@inertiajs/react';
import React from 'react';
import { Head } from '@inertiajs/react';
import AuthUser from '@/modules/auth/auth-user';
import Footer from '@/pages/home/partials/Footer.jsx';
interface PrivacyProps {
content: string;
@@ -12,19 +12,22 @@ const Privacy: React.FC<PrivacyProps> = ({ content, title }) => {
return (
<div className="min-h-[100vh] bg-neutral-50 dark:bg-black">
<Head title={title} />
<div className="container mx-auto px-4 py-8">
<div className="mx-auto max-w-4xl">
<div className="rounded-lg bg-white p-8 shadow-lg dark:bg-neutral-900">
<div className="max-w-none" dangerouslySetInnerHTML={{ __html: content }} />
<div className="max-w-4xl mx-auto">
<div className="bg-white dark:bg-neutral-900 rounded-lg shadow-lg p-8">
<div
className="max-w-none"
dangerouslySetInnerHTML={{ __html: content }}
/>
</div>
</div>
</div>
<Footer />
<AuthUser />
</div>
);
};
export default Privacy;
export default Privacy;

View File

@@ -1,7 +1,7 @@
import AuthUser from '@/modules/auth/auth-user';
import Footer from '@/pages/front/partials/Footer.jsx';
import { Head } from '@inertiajs/react';
import React from 'react';
import { Head } from '@inertiajs/react';
import AuthUser from '@/modules/auth/auth-user';
import Footer from '@/pages/home/partials/Footer.jsx';
interface TermsProps {
content: string;
@@ -12,19 +12,22 @@ const Terms: React.FC<TermsProps> = ({ content, title }) => {
return (
<div className="min-h-[100vh] bg-neutral-50 dark:bg-black">
<Head title={title} />
<div className="container mx-auto px-4 py-8">
<div className="mx-auto max-w-4xl">
<div className="rounded-lg bg-white p-8 shadow-lg dark:bg-neutral-900">
<div className="max-w-none" dangerouslySetInnerHTML={{ __html: content }} />
<div className="max-w-4xl mx-auto">
<div className="bg-white dark:bg-neutral-900 rounded-lg shadow-lg p-8">
<div
className="max-w-none"
dangerouslySetInnerHTML={{ __html: content }}
/>
</div>
</div>
</div>
<Footer />
<AuthUser />
</div>
);
};
export default Terms;
export default Terms;

View File

@@ -1,42 +0,0 @@
import AuthUser from '@/modules/auth/auth-user';
import FAQDiscord from '@/pages/front/partials/FAQDiscord.jsx';
import Features from '@/pages/front/partials/Features.jsx';
import Footer from '@/pages/front/partials/Footer.jsx';
import Hero from '@/pages/front/partials/Hero.jsx';
import { useEffect, useState } from 'react';
const Home = () => {
const [isClient, setIsClient] = useState(false);
const [Editor, setEditor] = useState(null);
useEffect(() => {
setIsClient(true);
// Dynamically import Editor only on client-side to avoid SSR issues with Konva
import('@/modules/editor/editor.jsx').then((module) => {
setEditor(() => module.default);
});
}, []);
return (
<div className="min-h-[100vh] bg-neutral-50 pb-10 dark:bg-black">
<div className="to-muted/10 w-full bg-gradient-to-b from-transparent dark:from-transparent dark:to-neutral-900">
{isClient && Editor ? (
<Editor />
) : (
<div className="flex h-96 items-center justify-center">
<div className="text-muted-foreground">Loading editor...</div>
</div>
)}
</div>
<div className="space-y-16">
<Hero />
<Features />
<FAQDiscord />
</div>
<Footer />
<AuthUser />
</div>
);
};
export default Home;

View File

@@ -0,0 +1,25 @@
import AuthUser from '@/modules/auth/auth-user';
import Editor from '@/modules/editor/editor.jsx';
import FAQDiscord from './partials/FAQDiscord.jsx';
import Features from './partials/Features.jsx';
import Footer from './partials/Footer.jsx';
import Hero from './partials/Hero.jsx';
const Home = () => {
return (
<div className="min-h-[100vh] bg-neutral-50 pb-10 dark:bg-black">
<div className="to-muted/10 w-full bg-gradient-to-b from-transparent dark:from-transparent dark:to-neutral-900">
<Editor />
</div>
<div className="space-y-16">
<Hero />
<Features />
<FAQDiscord />
</div>
<Footer />
<AuthUser />
</div>
);
};
export default Home;

View File

@@ -2,12 +2,7 @@ import { createInertiaApp } from '@inertiajs/react';
import createServer from '@inertiajs/react/server';
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
import ReactDOMServer from 'react-dom/server';
import { ErrorBoundary } from 'react-error-boundary';
import { Toaster } from 'sonner';
import { type RouteName, route } from 'ziggy-js';
import { AxiosProvider } from './plugins/AxiosContext';
import { GA4Provider } from './plugins/GA4Context';
import { MittProvider } from './plugins/MittContext';
const appName = import.meta.env.VITE_APP_NAME || 'Laravel';
@@ -29,34 +24,7 @@ createServer((page) =>
});
/* eslint-enable */
const app = (
<ErrorBoundary
FallbackComponent={DetailedErrorFallback}
onError={(error, errorInfo) => {
// Log to console for debugging
console.error('Error caught by boundary:', error, errorInfo);
// You could also send to an error reporting service here
// e.g., Sentry, LogRocket, etc.
}}
onReset={() => {
// Optional: Clear any error state in your app
console.log('Error boundary reset');
}}
>
<GA4Provider>
<MittProvider>
<AxiosProvider>
<Toaster position="top-right" />
{/* <AuthDialog /> */}
<App {...props} />
</AxiosProvider>
</MittProvider>
</GA4Provider>
</ErrorBoundary>
);
return app;
return <App {...props} />;
},
}),
);

File diff suppressed because one or more lines are too long