Skip to content

Commit fd20c20

Browse files
committed
Ensure Inertia pages are children of AppLayout
1 parent 0eecfe8 commit fd20c20

File tree

9 files changed

+58
-24
lines changed

9 files changed

+58
-24
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ composer.lock
33
/phpunit.xml
44
/.phpunit.cache
55
.phpunit.result.cache
6+
.idea

src/Console/InstallCommand.php

+1
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ protected function installInertiaStack()
422422

423423
// Inertia Pages...
424424
copy(__DIR__.'/../../stubs/inertia/resources/js/Pages/Dashboard.vue', resource_path('js/Pages/Dashboard.vue'));
425+
copy(__DIR__.'/../../stubs/inertia/resources/js/Pages/PageContainer.vue', resource_path('js/Pages/PageContainer.vue'));
425426
copy(__DIR__.'/../../stubs/inertia/resources/js/Pages/PrivacyPolicy.vue', resource_path('js/Pages/PrivacyPolicy.vue'));
426427
copy(__DIR__.'/../../stubs/inertia/resources/js/Pages/TermsOfService.vue', resource_path('js/Pages/TermsOfService.vue'));
427428
copy(__DIR__.'/../../stubs/inertia/resources/js/Pages/Welcome.vue', resource_path('js/Pages/Welcome.vue'));

stubs/inertia/resources/js/Layouts/AppLayout.vue

+1-14
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
<script setup>
22
import { ref } from 'vue';
3-
import { Head, Link, router } from '@inertiajs/vue3';
3+
import { Link, router } from '@inertiajs/vue3';
44
import ApplicationMark from '@/Components/ApplicationMark.vue';
55
import Banner from '@/Components/Banner.vue';
66
import Dropdown from '@/Components/Dropdown.vue';
77
import DropdownLink from '@/Components/DropdownLink.vue';
88
import NavLink from '@/Components/NavLink.vue';
99
import ResponsiveNavLink from '@/Components/ResponsiveNavLink.vue';
1010
11-
defineProps({
12-
title: String,
13-
});
14-
1511
const showingNavigationDropdown = ref(false);
1612
1713
const switchToTeam = (team) => {
@@ -29,8 +25,6 @@ const logout = () => {
2925

3026
<template>
3127
<div>
32-
<Head :title="title" />
33-
3428
<Banner />
3529

3630
<div class="min-h-screen bg-gray-100 dark:bg-gray-900">
@@ -273,13 +267,6 @@ const logout = () => {
273267
</div>
274268
</nav>
275269

276-
<!-- Page Heading -->
277-
<header v-if="$slots.header" class="bg-white dark:bg-gray-800 shadow">
278-
<div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
279-
<slot name="header" />
280-
</div>
281-
</header>
282-
283270
<!-- Page Content -->
284271
<main>
285272
<slot />

stubs/inertia/resources/js/Pages/API/Index.vue

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<script setup>
22
import ApiTokenManager from '@/Pages/API/Partials/ApiTokenManager.vue';
33
import AppLayout from '@/Layouts/AppLayout.vue';
4+
import PageContainer from "@/Pages/PageContainer.vue";
5+
6+
defineOptions({
7+
layout: AppLayout,
8+
})
49
510
defineProps({
611
tokens: Array,
@@ -10,7 +15,7 @@ defineProps({
1015
</script>
1116

1217
<template>
13-
<AppLayout title="API Tokens">
18+
<PageContainer title="API Tokens">
1419
<template #header>
1520
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">
1621
API Tokens
@@ -26,5 +31,5 @@ defineProps({
2631
/>
2732
</div>
2833
</div>
29-
</AppLayout>
34+
</PageContainer>
3035
</template>

stubs/inertia/resources/js/Pages/Dashboard.vue

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
<script setup>
22
import AppLayout from '@/Layouts/AppLayout.vue';
33
import Welcome from '@/Components/Welcome.vue';
4+
import PageContainer from "@/Pages/PageContainer.vue";
5+
6+
defineOptions({
7+
layout: AppLayout,
8+
})
49
</script>
510

611
<template>
7-
<AppLayout title="Dashboard">
12+
<PageContainer title="Dashboard">
813
<template #header>
914
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">
1015
Dashboard
@@ -18,5 +23,5 @@ import Welcome from '@/Components/Welcome.vue';
1823
</div>
1924
</div>
2025
</div>
21-
</AppLayout>
26+
</PageContainer>
2227
</template>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<script setup>
2+
import { Head } from '@inertiajs/vue3';
3+
4+
defineProps({
5+
title: String,
6+
});
7+
</script>
8+
9+
<template>
10+
<Head :title="title" />
11+
12+
<!-- Page Heading -->
13+
<header v-if="$slots.header" class="bg-white dark:bg-gray-800 shadow">
14+
<div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
15+
<slot name="header" />
16+
</div>
17+
</header>
18+
19+
<slot />
20+
</template>

stubs/inertia/resources/js/Pages/Profile/Show.vue

+7-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ import SectionBorder from '@/Components/SectionBorder.vue';
66
import TwoFactorAuthenticationForm from '@/Pages/Profile/Partials/TwoFactorAuthenticationForm.vue';
77
import UpdatePasswordForm from '@/Pages/Profile/Partials/UpdatePasswordForm.vue';
88
import UpdateProfileInformationForm from '@/Pages/Profile/Partials/UpdateProfileInformationForm.vue';
9+
import PageContainer from "@/Pages/PageContainer.vue";
10+
11+
defineOptions({
12+
layout: AppLayout,
13+
})
914
1015
defineProps({
1116
confirmsTwoFactorAuthentication: Boolean,
@@ -14,7 +19,7 @@ defineProps({
1419
</script>
1520

1621
<template>
17-
<AppLayout title="Profile">
22+
<PageContainer title="Profile">
1823
<template #header>
1924
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">
2025
Profile
@@ -53,5 +58,5 @@ defineProps({
5358
</template>
5459
</div>
5560
</div>
56-
</AppLayout>
61+
</PageContainer>
5762
</template>

stubs/inertia/resources/js/Pages/Teams/Create.vue

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
<script setup>
22
import AppLayout from '@/Layouts/AppLayout.vue';
33
import CreateTeamForm from '@/Pages/Teams/Partials/CreateTeamForm.vue';
4+
import PageContainer from "@/Pages/PageContainer.vue";
5+
6+
defineOptions({
7+
layout: AppLayout,
8+
})
49
</script>
510

611
<template>
7-
<AppLayout title="Create Team">
12+
<PageContainer title="Create Team">
813
<template #header>
914
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">
1015
Create Team
@@ -16,5 +21,5 @@ import CreateTeamForm from '@/Pages/Teams/Partials/CreateTeamForm.vue';
1621
<CreateTeamForm />
1722
</div>
1823
</div>
19-
</AppLayout>
24+
</PageContainer>
2025
</template>

stubs/inertia/resources/js/Pages/Teams/Show.vue

+7-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ import DeleteTeamForm from '@/Pages/Teams/Partials/DeleteTeamForm.vue';
44
import SectionBorder from '@/Components/SectionBorder.vue';
55
import TeamMemberManager from '@/Pages/Teams/Partials/TeamMemberManager.vue';
66
import UpdateTeamNameForm from '@/Pages/Teams/Partials/UpdateTeamNameForm.vue';
7+
import PageContainer from "@/Pages/PageContainer.vue";
8+
9+
defineOptions({
10+
layout: AppLayout,
11+
})
712
813
defineProps({
914
team: Object,
@@ -13,7 +18,7 @@ defineProps({
1318
</script>
1419

1520
<template>
16-
<AppLayout title="Team Settings">
21+
<PageContainer title="Team Settings">
1722
<template #header>
1823
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">
1924
Team Settings
@@ -38,5 +43,5 @@ defineProps({
3843
</template>
3944
</div>
4045
</div>
41-
</AppLayout>
46+
</PageContainer>
4247
</template>

0 commit comments

Comments
 (0)