Update
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { type BreadcrumbItem, type SharedData } from '@/types';
|
||||
import { type BreadcrumbItem } from '@/types';
|
||||
import { Transition } from '@headlessui/react';
|
||||
import { Head, Link, useForm, usePage } from '@inertiajs/react';
|
||||
import { Head, Link, useForm } from '@inertiajs/react';
|
||||
import { FormEventHandler } from 'react';
|
||||
|
||||
import DeleteUser from '@/components/delete-user';
|
||||
@@ -11,6 +11,7 @@ import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import AppLayout from '@/layouts/app-layout';
|
||||
import SettingsLayout from '@/layouts/settings/layout';
|
||||
import useUserStore from '@/stores/UserStore';
|
||||
|
||||
const breadcrumbs: BreadcrumbItem[] = [
|
||||
{
|
||||
@@ -25,11 +26,11 @@ type ProfileForm = {
|
||||
}
|
||||
|
||||
export default function Profile({ mustVerifyEmail, status }: { mustVerifyEmail: boolean; status?: string }) {
|
||||
const { auth } = usePage<SharedData>().props;
|
||||
const { user } = useUserStore();
|
||||
|
||||
const { data, setData, patch, errors, processing, recentlySuccessful } = useForm<Required<ProfileForm>>({
|
||||
name: auth.user.name,
|
||||
email: auth.user.email,
|
||||
name: user?.name || '',
|
||||
email: user?.email || '',
|
||||
});
|
||||
|
||||
const submit: FormEventHandler = (e) => {
|
||||
@@ -82,7 +83,7 @@ export default function Profile({ mustVerifyEmail, status }: { mustVerifyEmail:
|
||||
<InputError className="mt-2" message={errors.email} />
|
||||
</div>
|
||||
|
||||
{mustVerifyEmail && auth.user.email_verified_at === null && (
|
||||
{mustVerifyEmail && user?.email_verified_at === null && (
|
||||
<div>
|
||||
<p className="text-muted-foreground -mt-4 text-sm">
|
||||
Your email address is unverified.{' '}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { type SharedData } from '@/types';
|
||||
import { Head, Link, usePage } from '@inertiajs/react';
|
||||
import { Head, Link } from '@inertiajs/react';
|
||||
import useUserStore from '@/stores/UserStore';
|
||||
|
||||
export default function Welcome() {
|
||||
const { auth } = usePage<SharedData>().props;
|
||||
const { user } = useUserStore();
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -13,7 +13,7 @@ export default function Welcome() {
|
||||
<div className="flex min-h-screen flex-col items-center bg-[#FDFDFC] p-6 text-[#1b1b18] lg:justify-center lg:p-8 dark:bg-[#0a0a0a]">
|
||||
<header className="mb-6 w-full max-w-[335px] text-sm not-has-[nav]:hidden lg:max-w-4xl">
|
||||
<nav className="flex items-center justify-end gap-4">
|
||||
{auth.user ? (
|
||||
{user ? (
|
||||
<Link
|
||||
href={route(config('platform.general.authed_route_redirect'))}
|
||||
className="inline-block rounded-sm border border-[#19140035] px-5 py-1.5 text-sm leading-normal text-[#1b1b18] hover:border-[#1915014a] dark:border-[#3E3E3A] dark:text-[#EDEDEC] dark:hover:border-[#62605b]"
|
||||
|
||||
Reference in New Issue
Block a user