mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 14:06:15 +00:00
fix demo
This commit is contained in:
@ -77,6 +77,7 @@ public function share(Request $request): array
|
|||||||
...$data,
|
...$data,
|
||||||
'name' => config('app.name'),
|
'name' => config('app.name'),
|
||||||
'version' => config('app.version'),
|
'version' => config('app.version'),
|
||||||
|
'demo' => config('app.demo'),
|
||||||
'quote' => ['message' => trim($message), 'author' => trim($author)],
|
'quote' => ['message' => trim($message), 'author' => trim($author)],
|
||||||
'auth' => [
|
'auth' => [
|
||||||
'user' => $user,
|
'user' => $user,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Head, useForm } from '@inertiajs/react';
|
import { Head, useForm, usePage } from '@inertiajs/react';
|
||||||
import { LoaderCircle } from 'lucide-react';
|
import { LoaderCircle } from 'lucide-react';
|
||||||
import { FormEventHandler } from 'react';
|
import { FormEventHandler } from 'react';
|
||||||
|
|
||||||
@ -9,6 +9,7 @@ import { Checkbox } from '@/components/ui/checkbox';
|
|||||||
import { Input } from '@/components/ui/input';
|
import { Input } from '@/components/ui/input';
|
||||||
import { Label } from '@/components/ui/label';
|
import { Label } from '@/components/ui/label';
|
||||||
import AuthLayout from '@/layouts/auth/layout';
|
import AuthLayout from '@/layouts/auth/layout';
|
||||||
|
import { SharedData } from '@/types';
|
||||||
|
|
||||||
type LoginForm = {
|
type LoginForm = {
|
||||||
email: string;
|
email: string;
|
||||||
@ -22,9 +23,11 @@ interface LoginProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function Login({ status, canResetPassword }: LoginProps) {
|
export default function Login({ status, canResetPassword }: LoginProps) {
|
||||||
|
const page = usePage<SharedData>();
|
||||||
|
|
||||||
const { data, setData, post, processing, errors, reset } = useForm<Required<LoginForm>>({
|
const { data, setData, post, processing, errors, reset } = useForm<Required<LoginForm>>({
|
||||||
email: '',
|
email: page.props.demo ? 'demo@vitodeploy.com' : '',
|
||||||
password: '',
|
password: page.props.demo ? 'password' : '',
|
||||||
remember: false,
|
remember: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
1
resources/js/types/index.d.ts
vendored
1
resources/js/types/index.d.ts
vendored
@ -105,6 +105,7 @@ export interface Configs {
|
|||||||
export interface SharedData {
|
export interface SharedData {
|
||||||
name: string;
|
name: string;
|
||||||
version: string;
|
version: string;
|
||||||
|
demo: boolean;
|
||||||
quote: { message: string; author: string };
|
quote: { message: string; author: string };
|
||||||
auth: Auth;
|
auth: Auth;
|
||||||
ziggy: Config & { location: string };
|
ziggy: Config & { location: string };
|
||||||
|
Reference in New Issue
Block a user