Update
This commit is contained in:
@@ -24,7 +24,7 @@ public function index()
|
||||
];
|
||||
});
|
||||
|
||||
return Inertia::render('home', [
|
||||
return Inertia::render('home/home', [
|
||||
'stats' => $stats,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -14,9 +14,12 @@ const Privacy: React.FC<PrivacyProps> = ({ content, title }) => {
|
||||
<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>
|
||||
|
||||
@@ -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;
|
||||
@@ -14,9 +14,12 @@ const Terms: React.FC<TermsProps> = ({ content, title }) => {
|
||||
<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>
|
||||
|
||||
@@ -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;
|
||||
25
resources/js/pages/home/home.tsx
Normal file
25
resources/js/pages/home/home.tsx
Normal 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;
|
||||
@@ -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
160
vite.config.ts
160
vite.config.ts
@@ -36,95 +36,95 @@ export default defineConfig({
|
||||
optimizeDeps: {
|
||||
exclude: ['@ffmpeg/ffmpeg', '@ffmpeg/util']
|
||||
},
|
||||
// build: {
|
||||
// rollupOptions: {
|
||||
// output: {
|
||||
// manualChunks: {
|
||||
// // React MUST be first and separate to avoid dependency issues
|
||||
// 'react-vendor': ['react', 'react-dom'],
|
||||
build: {
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks: {
|
||||
// React MUST be first and separate to avoid dependency issues
|
||||
'react-vendor': ['react', 'react-dom'],
|
||||
|
||||
// // Heavy libraries that can be safely separated
|
||||
// 'ffmpeg': ['@ffmpeg/ffmpeg', '@ffmpeg/util'],
|
||||
// 'motion': ['motion'],
|
||||
// 'canvas': ['konva', 'react-konva', 'react-konva-utils'],
|
||||
// 'charts': ['recharts'],
|
||||
// Heavy libraries that can be safely separated
|
||||
'ffmpeg': ['@ffmpeg/ffmpeg', '@ffmpeg/util'],
|
||||
'motion': ['motion'],
|
||||
'canvas': ['konva', 'react-konva', 'react-konva-utils'],
|
||||
'charts': ['recharts'],
|
||||
|
||||
// // UI libraries that depend on React
|
||||
// 'radix-ui': [
|
||||
// '@radix-ui/react-accordion',
|
||||
// '@radix-ui/react-alert-dialog',
|
||||
// '@radix-ui/react-aspect-ratio',
|
||||
// '@radix-ui/react-avatar',
|
||||
// '@radix-ui/react-checkbox',
|
||||
// '@radix-ui/react-collapsible',
|
||||
// '@radix-ui/react-context-menu',
|
||||
// '@radix-ui/react-dialog',
|
||||
// '@radix-ui/react-dropdown-menu',
|
||||
// '@radix-ui/react-hover-card',
|
||||
// '@radix-ui/react-label',
|
||||
// '@radix-ui/react-menubar',
|
||||
// '@radix-ui/react-navigation-menu',
|
||||
// '@radix-ui/react-popover',
|
||||
// '@radix-ui/react-progress',
|
||||
// '@radix-ui/react-radio-group',
|
||||
// '@radix-ui/react-scroll-area',
|
||||
// '@radix-ui/react-select',
|
||||
// '@radix-ui/react-separator',
|
||||
// '@radix-ui/react-slider',
|
||||
// '@radix-ui/react-slot',
|
||||
// '@radix-ui/react-switch',
|
||||
// '@radix-ui/react-tabs',
|
||||
// '@radix-ui/react-toggle',
|
||||
// '@radix-ui/react-toggle-group',
|
||||
// '@radix-ui/react-tooltip'
|
||||
// ],
|
||||
// UI libraries that depend on React
|
||||
'radix-ui': [
|
||||
'@radix-ui/react-accordion',
|
||||
'@radix-ui/react-alert-dialog',
|
||||
'@radix-ui/react-aspect-ratio',
|
||||
'@radix-ui/react-avatar',
|
||||
'@radix-ui/react-checkbox',
|
||||
'@radix-ui/react-collapsible',
|
||||
'@radix-ui/react-context-menu',
|
||||
'@radix-ui/react-dialog',
|
||||
'@radix-ui/react-dropdown-menu',
|
||||
'@radix-ui/react-hover-card',
|
||||
'@radix-ui/react-label',
|
||||
'@radix-ui/react-menubar',
|
||||
'@radix-ui/react-navigation-menu',
|
||||
'@radix-ui/react-popover',
|
||||
'@radix-ui/react-progress',
|
||||
'@radix-ui/react-radio-group',
|
||||
'@radix-ui/react-scroll-area',
|
||||
'@radix-ui/react-select',
|
||||
'@radix-ui/react-separator',
|
||||
'@radix-ui/react-slider',
|
||||
'@radix-ui/react-slot',
|
||||
'@radix-ui/react-switch',
|
||||
'@radix-ui/react-tabs',
|
||||
'@radix-ui/react-toggle',
|
||||
'@radix-ui/react-toggle-group',
|
||||
'@radix-ui/react-tooltip'
|
||||
],
|
||||
|
||||
// // Form libraries
|
||||
// 'forms': ['react-hook-form', '@hookform/resolvers', 'zod'],
|
||||
// Form libraries
|
||||
'forms': ['react-hook-form', '@hookform/resolvers', 'zod'],
|
||||
|
||||
// // UI utilities
|
||||
// 'ui-utils': [
|
||||
// 'tailwind-merge',
|
||||
// 'class-variance-authority',
|
||||
// 'clsx',
|
||||
// 'lucide-react',
|
||||
// 'sonner',
|
||||
// 'cmdk',
|
||||
// 'next-themes'
|
||||
// ],
|
||||
// UI utilities
|
||||
'ui-utils': [
|
||||
'tailwind-merge',
|
||||
'class-variance-authority',
|
||||
'clsx',
|
||||
'lucide-react',
|
||||
'sonner',
|
||||
'cmdk',
|
||||
'next-themes'
|
||||
],
|
||||
|
||||
// // Other React components
|
||||
// 'react-components': [
|
||||
// 'react-day-picker',
|
||||
// 'react-error-boundary',
|
||||
// 'embla-carousel-react',
|
||||
// 'react-resizable-panels'
|
||||
// ],
|
||||
// Other React components
|
||||
'react-components': [
|
||||
'react-day-picker',
|
||||
'react-error-boundary',
|
||||
'embla-carousel-react',
|
||||
'react-resizable-panels'
|
||||
],
|
||||
|
||||
// // Non-React utilities
|
||||
// 'utils': [
|
||||
// 'date-fns',
|
||||
// 'axios',
|
||||
// 'mitt',
|
||||
// 'zustand',
|
||||
// 'embla-carousel-autoplay'
|
||||
// ],
|
||||
// Non-React utilities
|
||||
'utils': [
|
||||
'date-fns',
|
||||
'axios',
|
||||
'mitt',
|
||||
'zustand',
|
||||
'embla-carousel-autoplay'
|
||||
],
|
||||
|
||||
// // Inertia
|
||||
// 'inertia': ['@inertiajs/react']
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// // Temporarily increase limit while optimizing
|
||||
// chunkSizeWarningLimit: 1000,
|
||||
// Inertia
|
||||
'inertia': ['@inertiajs/react']
|
||||
}
|
||||
}
|
||||
},
|
||||
// Temporarily increase limit while optimizing
|
||||
chunkSizeWarningLimit: 1000,
|
||||
|
||||
// // Additional optimizations
|
||||
// minify: 'esbuild',
|
||||
// target: 'es2020',
|
||||
// Additional optimizations
|
||||
minify: 'esbuild',
|
||||
target: 'es2020',
|
||||
|
||||
// // Enable source maps for better debugging (optional)
|
||||
// sourcemap: false,
|
||||
// },
|
||||
// Enable source maps for better debugging (optional)
|
||||
sourcemap: false,
|
||||
},
|
||||
server: {
|
||||
headers: {
|
||||
'Cross-Origin-Opener-Policy': 'same-origin',
|
||||
|
||||
Reference in New Issue
Block a user