Skip to content

Commit

Permalink
[6.x] fix removed auth props in Laravel Breeze support (#371)
Browse files Browse the repository at this point in the history
  • Loading branch information
joelbutcher authored Sep 19, 2024
1 parent ad6337b commit 36bf3aa
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 40 deletions.
23 changes: 15 additions & 8 deletions stubs/breeze/inertia-react-ts/resources/js/Pages/Profile/Edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ import DeleteUserForm from './Partials/DeleteUserForm';
import SetPasswordForm from './Partials/SetPasswordForm';
import UpdatePasswordForm from './Partials/UpdatePasswordForm';
import UpdateProfileInformationForm from './Partials/UpdateProfileInformationForm';
import { Head } from '@inertiajs/react';
import { PageProps, Socialstream } from '@/types';
import {Head} from '@inertiajs/react';
import {PageProps, Socialstream} from '@/types';

export default function Edit({ auth, mustVerifyEmail, status, socialstream }: PageProps<{ mustVerifyEmail: boolean, status?: string, socialstream: Socialstream}>) {
export default function Edit({mustVerifyEmail, status, socialstream}: PageProps<{ mustVerifyEmail: boolean, status?: string, socialstream: Socialstream }>) {
return (
<AuthenticatedLayout
user={auth.user}
header={<h2 className="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">Profile</h2>}
>
<Head title="Profile" />
<Head title="Profile"/>

<div className="py-12">
<div className="max-w-7xl mx-auto sm:px-6 lg:px-8 space-y-6">
Expand All @@ -26,18 +25,26 @@ export default function Edit({ auth, mustVerifyEmail, status, socialstream }: Pa
</div>

<div className="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
{socialstream.hasPassword ? <UpdatePasswordForm className="max-w-xl" /> : <SetPasswordForm className="max-w-xl" />}
{socialstream.hasPassword ? (
<UpdatePasswordForm className="max-w-xl"/>
) : (
<SetPasswordForm className="max-w-xl"/>
)}
</div>

{socialstream.show && (
<div className="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
<ConnectedAccountsForm providers={socialstream.providers} connectedAccounts={socialstream.connectedAccounts} hasPassword={socialstream.hasPassword} />
<ConnectedAccountsForm
providers={socialstream.providers}
connectedAccounts={socialstream.connectedAccounts}
hasPassword={socialstream.hasPassword}
/>
</div>
)}

{socialstream.hasPassword && (
<div className="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
<DeleteUserForm className="max-w-xl" />
<DeleteUserForm className="max-w-xl"/>
</div>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { Head } from '@inertiajs/react';
export default function Edit({ auth, mustVerifyEmail, status, socialstream }) {
return (
<AuthenticatedLayout
user={auth.user}
header={<h2 className="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">Profile</h2>}
>
<Head title="Profile" />
Expand Down
65 changes: 34 additions & 31 deletions stubs/breeze/inertia-vue-ts/resources/js/Pages/Profile/Edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,50 @@ import UpdatePasswordForm from './Partials/UpdatePasswordForm.vue';
import UpdateProfileInformationForm from './Partials/UpdateProfileInformationForm.vue';
import {Head} from '@inertiajs/vue3';
import ConnectedAccountsForm from '@/Pages/Profile/Partials/ConnectedAccountsForm.vue';
import type { Socialstream } from '@/types';
import type {Socialstream} from '@/types';
defineProps<{
mustVerifyEmail?: boolean;
status?: string;
socialstream: Socialstream
mustVerifyEmail?: boolean;
status?: string;
socialstream: Socialstream
}>();
</script>

<template>
<Head title="Profile"/>
<Head title="Profile"/>

<AuthenticatedLayout>
<template #header>
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">Profile</h2>
</template>
<AuthenticatedLayout>
<template #header>
<h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">Profile</h2>
</template>

<div class="py-12">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8 space-y-6">
<div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
<UpdateProfileInformationForm
:must-verify-email="mustVerifyEmail"
:status="status"
class="max-w-xl"
/>
</div>
<div class="py-12">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8 space-y-6">
<div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
<UpdateProfileInformationForm
:must-verify-email="mustVerifyEmail"
:status="status"
class="max-w-xl"
/>
</div>

<div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
<UpdatePasswordForm v-if="socialstream.hasPassword" class="max-w-xl"/>
<SetPasswordForm v-else class="max-w-xl"/>
</div>
<div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
<UpdatePasswordForm v-if="socialstream.hasPassword" class="max-w-xl"/>
<SetPasswordForm v-else class="max-w-xl"/>
</div>

<div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
<ConnectedAccountsForm :connected-accounts="socialstream.connectedAccounts" :has-password="socialstream.hasPassword"
:providers="socialstream.providers"/>
</div>
<div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
<ConnectedAccountsForm
:connected-accounts="socialstream.connectedAccounts"
:has-password="socialstream.hasPassword"
:providers="socialstream.providers"
/>
</div>

<div v-if="socialstream.hasPassword" class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
<DeleteUserForm class="max-w-xl"/>
</div>
<div v-if="socialstream.hasPassword" class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
<DeleteUserForm class="max-w-xl"/>
</div>
</div>
</AuthenticatedLayout>
</div>
</div>
</AuthenticatedLayout>
</template>

0 comments on commit 36bf3aa

Please sign in to comment.