Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.x] fix removed auth props in Laravel Breeze support #371

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>