mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-08 14:43:24 +00:00
28 lines
715 B
TypeScript
28 lines
715 B
TypeScript
import { resolvePageComponent } from '@adonisjs/inertia/helpers';
|
|
import { createInertiaApp } from '@inertiajs/react';
|
|
import 'dayjs/locale/en';
|
|
import 'dayjs/locale/fr';
|
|
import { hydrateRoot } from 'react-dom/client';
|
|
import 'react-toggle/style.css';
|
|
import { primaryColor } from '~/styles/common_colors';
|
|
import '../i18n/index';
|
|
|
|
const appName = import.meta.env.VITE_APP_NAME || 'MyLinks';
|
|
|
|
createInertiaApp({
|
|
progress: { color: primaryColor },
|
|
|
|
title: (title) => `${appName}${title && ` - ${title}`}`,
|
|
|
|
resolve: (name) => {
|
|
return resolvePageComponent(
|
|
`../pages/${name}.tsx`,
|
|
import.meta.glob('../pages/**/*.tsx')
|
|
);
|
|
},
|
|
|
|
setup({ el, App, props }) {
|
|
hydrateRoot(el, <App {...props} />);
|
|
},
|
|
});
|