Add initial app structure with Inertia.js integration
This commit is contained in:
21
resources/js/app.jsx
Normal file
21
resources/js/app.jsx
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import "./bootstrap";
|
||||||
|
import "../css/app.css";
|
||||||
|
import { createRoot } from "react-dom/client";
|
||||||
|
import { createInertiaApp } from "@inertiajs/react";
|
||||||
|
import { resolvePageComponent } from "laravel-vite-plugin/inertia-helpers";
|
||||||
|
|
||||||
|
createInertiaApp({
|
||||||
|
title: (title) => `${title} - Perpustakaanku`,
|
||||||
|
resolve: (name) =>
|
||||||
|
resolvePageComponent(
|
||||||
|
`./Pages/${name}.jsx`,
|
||||||
|
import.meta.glob("./Pages/**/*.jsx"),
|
||||||
|
),
|
||||||
|
setup({ el, App, props }) {
|
||||||
|
const root = createRoot(el);
|
||||||
|
root.render(<App {...props} />);
|
||||||
|
},
|
||||||
|
progress: {
|
||||||
|
color: "#4F46E5",
|
||||||
|
},
|
||||||
|
});
|
||||||
14
resources/views/app.blade.php
Normal file
14
resources/views/app.blade.php
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="{{ str_replace('_', '.', app()->getLocale()) }}">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title>Perpustakaanku</title>
|
||||||
|
@viteReactRefresh
|
||||||
|
@vite(['resources/css/app.css', 'resources/js/app.jsx'])
|
||||||
|
@inertiaHead
|
||||||
|
</head>
|
||||||
|
<body class="bg-gray-100">
|
||||||
|
@inertia
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user