Initial
This commit is contained in:
@@ -3,7 +3,10 @@ import InputLabel from '@/Components/InputLabel';
|
||||
import PrimaryButton from '@/Components/PrimaryButton';
|
||||
import TextInput from '@/Components/TextInput';
|
||||
import GuestLayout from '@/Layouts/GuestLayout';
|
||||
import { Head, useForm } from '@inertiajs/react';
|
||||
import { Head, Link, useForm } from '@inertiajs/react';
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/Components/ui/card.jsx";
|
||||
import { Label } from "@/Components/ui/label.jsx";
|
||||
import Checkbox from "@/Components/Checkbox.jsx";
|
||||
|
||||
export default function ConfirmPassword() {
|
||||
const { data, setData, post, processing, errors, reset } = useForm({
|
||||
@@ -21,35 +24,34 @@ export default function ConfirmPassword() {
|
||||
return (
|
||||
<GuestLayout>
|
||||
<Head title="Confirm Password" />
|
||||
|
||||
<div className="mb-4 text-sm text-gray-600 dark:text-gray-400">
|
||||
This is a secure area of the application. Please confirm your
|
||||
password before continuing.
|
||||
<div className="flex flex-col gap-6">
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle className="text-2xl">Confirm Password</CardTitle>
|
||||
<CardDescription>
|
||||
This is a secure area of the application. Please confirm your
|
||||
password before continuing.
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<form onSubmit={ submit }>
|
||||
<div className="flex flex-col gap-6">
|
||||
<div className="grid gap-2">
|
||||
<div className="flex items-center">
|
||||
<Label htmlFor="password">Password</Label>
|
||||
</div>
|
||||
<TextInput id="password" type="password" name="password" value={ data.password }
|
||||
autoComplete="current-password"
|
||||
onChange={ (e) => setData('password', e.target.value) } />
|
||||
<InputError message={ errors.password } className="mt-2" />
|
||||
</div>
|
||||
<PrimaryButton type="submit" disabled={ processing }
|
||||
className="w-full">Confirm</PrimaryButton>
|
||||
</div>
|
||||
</form>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<form onSubmit={submit}>
|
||||
<div className="mt-4">
|
||||
<InputLabel htmlFor="password" value="Password" />
|
||||
|
||||
<TextInput
|
||||
id="password"
|
||||
type="password"
|
||||
name="password"
|
||||
value={data.password}
|
||||
className="mt-1 block w-full"
|
||||
isFocused={true}
|
||||
onChange={(e) => setData('password', e.target.value)}
|
||||
/>
|
||||
|
||||
<InputError message={errors.password} className="mt-2" />
|
||||
</div>
|
||||
|
||||
<div className="mt-4 flex items-center justify-end">
|
||||
<PrimaryButton className="ms-4" disabled={processing}>
|
||||
Confirm
|
||||
</PrimaryButton>
|
||||
</div>
|
||||
</form>
|
||||
</GuestLayout>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,10 @@ import InputError from '@/Components/InputError';
|
||||
import PrimaryButton from '@/Components/PrimaryButton';
|
||||
import TextInput from '@/Components/TextInput';
|
||||
import GuestLayout from '@/Layouts/GuestLayout';
|
||||
import { Head, useForm } from '@inertiajs/react';
|
||||
import { Head, Link, useForm } from '@inertiajs/react';
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/Components/ui/card.jsx";
|
||||
import { Label } from "@/Components/ui/label.jsx";
|
||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
|
||||
export default function ForgotPassword({ status }) {
|
||||
const { data, setData, post, processing, errors } = useForm({
|
||||
@@ -18,38 +21,47 @@ export default function ForgotPassword({ status }) {
|
||||
return (
|
||||
<GuestLayout>
|
||||
<Head title="Forgot Password" />
|
||||
|
||||
<div className="mb-4 text-sm text-gray-600 dark:text-gray-400">
|
||||
Forgot your password? No problem. Just let us know your email
|
||||
address and we will email you a password reset link that will
|
||||
allow you to choose a new one.
|
||||
<div className="flex flex-col gap-6">
|
||||
{ status && (<Alert>
|
||||
<AlertDescription>
|
||||
{ status }
|
||||
</AlertDescription>
|
||||
</Alert> ) }
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle className="text-2xl">Forgot Password</CardTitle>
|
||||
<CardDescription>
|
||||
Forgot your password? No problem. Just let us know your email
|
||||
address and we will email you a password reset link that will
|
||||
allow you to choose a new one.
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<form onSubmit={ submit }>
|
||||
<div className="flex flex-col gap-6">
|
||||
<div className="grid gap-2">
|
||||
<Label htmlFor="email">E-mail Address</Label>
|
||||
<TextInput type="email" id="email" placeholder="me@yumj.in" value={ data.email }
|
||||
onChange={ (e) => setData('email', e.target.value) } required />
|
||||
<InputError message={ errors.email } className="mt-2" />
|
||||
</div>
|
||||
<PrimaryButton type="submit" disabled={ processing }
|
||||
className="w-full">Email Password Reset Link</PrimaryButton>
|
||||
</div>
|
||||
<div className="mt-4 text-center text-sm">
|
||||
Return to
|
||||
<Link href={ route('login') } className="underline underline-offset-4">
|
||||
Login
|
||||
</Link>
|
||||
|
|
||||
<Link href={ route('register') } className="underline underline-offset-4">
|
||||
Sign up
|
||||
</Link>
|
||||
</div>
|
||||
</form>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
{status && (
|
||||
<div className="mb-4 text-sm font-medium text-green-600 dark:text-green-400">
|
||||
{status}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<form onSubmit={submit}>
|
||||
<TextInput
|
||||
id="email"
|
||||
type="email"
|
||||
name="email"
|
||||
value={data.email}
|
||||
className="mt-1 block w-full"
|
||||
isFocused={true}
|
||||
onChange={(e) => setData('email', e.target.value)}
|
||||
/>
|
||||
|
||||
<InputError message={errors.email} className="mt-2" />
|
||||
|
||||
<div className="mt-4 flex items-center justify-end">
|
||||
<PrimaryButton className="ms-4" disabled={processing}>
|
||||
Email Password Reset Link
|
||||
</PrimaryButton>
|
||||
</div>
|
||||
</form>
|
||||
</GuestLayout>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import Checkbox from '@/Components/Checkbox';
|
||||
import InputError from '@/Components/InputError';
|
||||
import InputLabel from '@/Components/InputLabel';
|
||||
import Checkbox from '@/Components/Checkbox';
|
||||
import PrimaryButton from '@/Components/PrimaryButton';
|
||||
import TextInput from '@/Components/TextInput';
|
||||
import GuestLayout from '@/Layouts/GuestLayout';
|
||||
import { Head, Link, useForm } from '@inertiajs/react';
|
||||
import { Label } from "@/components/ui/label"
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/Components/ui/card.jsx";
|
||||
import GuestLayout from "@/Layouts/GuestLayout.jsx";
|
||||
import { Alert, AlertDescription } from "@/Components/ui/alert.jsx";
|
||||
|
||||
export default function Login({ status, canResetPassword }) {
|
||||
const { data, setData, post, processing, errors, reset } = useForm({
|
||||
@@ -23,78 +25,69 @@ export default function Login({ status, canResetPassword }) {
|
||||
|
||||
return (
|
||||
<GuestLayout>
|
||||
<Head title="Log in" />
|
||||
|
||||
{status && (
|
||||
<div className="mb-4 text-sm font-medium text-green-600">
|
||||
{status}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<form onSubmit={submit}>
|
||||
<div>
|
||||
<InputLabel htmlFor="email" value="Email" />
|
||||
|
||||
<TextInput
|
||||
id="email"
|
||||
type="email"
|
||||
name="email"
|
||||
value={data.email}
|
||||
className="mt-1 block w-full"
|
||||
autoComplete="username"
|
||||
isFocused={true}
|
||||
onChange={(e) => setData('email', e.target.value)}
|
||||
/>
|
||||
|
||||
<InputError message={errors.email} className="mt-2" />
|
||||
</div>
|
||||
|
||||
<div className="mt-4">
|
||||
<InputLabel htmlFor="password" value="Password" />
|
||||
|
||||
<TextInput
|
||||
id="password"
|
||||
type="password"
|
||||
name="password"
|
||||
value={data.password}
|
||||
className="mt-1 block w-full"
|
||||
autoComplete="current-password"
|
||||
onChange={(e) => setData('password', e.target.value)}
|
||||
/>
|
||||
|
||||
<InputError message={errors.password} className="mt-2" />
|
||||
</div>
|
||||
|
||||
<div className="mt-4 block">
|
||||
<label className="flex items-center">
|
||||
<Checkbox
|
||||
name="remember"
|
||||
checked={data.remember}
|
||||
onChange={(e) =>
|
||||
setData('remember', e.target.checked)
|
||||
}
|
||||
/>
|
||||
<span className="ms-2 text-sm text-gray-600 dark:text-gray-400">
|
||||
Remember me
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div className="mt-4 flex items-center justify-end">
|
||||
{canResetPassword && (
|
||||
<Link
|
||||
href={route('password.request')}
|
||||
className="rounded-md text-sm text-gray-600 underline hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 dark:text-gray-400 dark:hover:text-gray-100 dark:focus:ring-offset-gray-800"
|
||||
>
|
||||
Forgot your password?
|
||||
</Link>
|
||||
)}
|
||||
|
||||
<PrimaryButton className="ms-4" disabled={processing}>
|
||||
Log in
|
||||
</PrimaryButton>
|
||||
</div>
|
||||
</form>
|
||||
<Head title="Login" />
|
||||
<div className="flex flex-col gap-6">
|
||||
{ status && (<Alert>
|
||||
<AlertDescription>
|
||||
{ status }
|
||||
</AlertDescription>
|
||||
</Alert> ) }
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle className="text-2xl">Login</CardTitle>
|
||||
<CardDescription>
|
||||
Enter your email below to login to your account
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<form onSubmit={ submit }>
|
||||
<div className="flex flex-col gap-6">
|
||||
<div className="grid gap-2">
|
||||
<Label htmlFor="email">E-mail Address</Label>
|
||||
<TextInput type="email" id="email" placeholder="me@yumj.in" value={ data.email }
|
||||
onChange={ (e) => setData('email', e.target.value) } required />
|
||||
<InputError message={ errors.email } className="mt-2" />
|
||||
</div>
|
||||
<div className="grid gap-2">
|
||||
<div className="flex items-center">
|
||||
<Label htmlFor="password">Password</Label>
|
||||
<Link href={ route('password.request') }
|
||||
className="ml-auto inline-block text-sm underline-offset-4 hover:underline">
|
||||
Forgot your password?
|
||||
</Link>
|
||||
</div>
|
||||
<TextInput id="password" type="password" name="password" value={ data.password }
|
||||
autoComplete="current-password"
|
||||
onChange={ (e) => setData('password', e.target.value) } />
|
||||
<InputError message={ errors.password } className="mt-2" />
|
||||
</div>
|
||||
<div className="grid gap-2">
|
||||
<div className="flex items-center space-x-2">
|
||||
<Checkbox
|
||||
id="remember"
|
||||
name="remember"
|
||||
checked={ data.remember }
|
||||
onChange={ (e) =>
|
||||
setData('remember', e.target.checked)
|
||||
}
|
||||
/>
|
||||
<label htmlFor="remember"
|
||||
className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70">Remember me</label>
|
||||
</div>
|
||||
</div>
|
||||
<PrimaryButton type="submit" disabled={ processing }
|
||||
className="w-full">Login</PrimaryButton>
|
||||
</div>
|
||||
<div className="mt-4 text-center text-sm">
|
||||
Don't have an account?
|
||||
<Link href={ route('register') } className="underline underline-offset-4">
|
||||
Sign up
|
||||
</Link>
|
||||
</div>
|
||||
</form>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
</GuestLayout>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import InputError from '@/Components/InputError';
|
||||
import InputLabel from '@/Components/InputLabel';
|
||||
import PrimaryButton from '@/Components/PrimaryButton';
|
||||
import TextInput from '@/Components/TextInput';
|
||||
import GuestLayout from '@/Layouts/GuestLayout';
|
||||
import { Head, Link, useForm } from '@inertiajs/react';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/Components/ui/card.jsx";
|
||||
import { Label } from "@/Components/ui/label.jsx";
|
||||
import Checkbox from "@/Components/Checkbox.jsx";
|
||||
|
||||
export default function Register() {
|
||||
const { data, setData, post, processing, errors, reset } = useForm({
|
||||
@@ -24,97 +26,56 @@ export default function Register() {
|
||||
return (
|
||||
<GuestLayout>
|
||||
<Head title="Register" />
|
||||
|
||||
<form onSubmit={submit}>
|
||||
<div>
|
||||
<InputLabel htmlFor="name" value="Name" />
|
||||
|
||||
<TextInput
|
||||
id="name"
|
||||
name="name"
|
||||
value={data.name}
|
||||
className="mt-1 block w-full"
|
||||
autoComplete="name"
|
||||
isFocused={true}
|
||||
onChange={(e) => setData('name', e.target.value)}
|
||||
required
|
||||
/>
|
||||
|
||||
<InputError message={errors.name} className="mt-2" />
|
||||
</div>
|
||||
|
||||
<div className="mt-4">
|
||||
<InputLabel htmlFor="email" value="Email" />
|
||||
|
||||
<TextInput
|
||||
id="email"
|
||||
type="email"
|
||||
name="email"
|
||||
value={data.email}
|
||||
className="mt-1 block w-full"
|
||||
autoComplete="username"
|
||||
onChange={(e) => setData('email', e.target.value)}
|
||||
required
|
||||
/>
|
||||
|
||||
<InputError message={errors.email} className="mt-2" />
|
||||
</div>
|
||||
|
||||
<div className="mt-4">
|
||||
<InputLabel htmlFor="password" value="Password" />
|
||||
|
||||
<TextInput
|
||||
id="password"
|
||||
type="password"
|
||||
name="password"
|
||||
value={data.password}
|
||||
className="mt-1 block w-full"
|
||||
autoComplete="new-password"
|
||||
onChange={(e) => setData('password', e.target.value)}
|
||||
required
|
||||
/>
|
||||
|
||||
<InputError message={errors.password} className="mt-2" />
|
||||
</div>
|
||||
|
||||
<div className="mt-4">
|
||||
<InputLabel
|
||||
htmlFor="password_confirmation"
|
||||
value="Confirm Password"
|
||||
/>
|
||||
|
||||
<TextInput
|
||||
id="password_confirmation"
|
||||
type="password"
|
||||
name="password_confirmation"
|
||||
value={data.password_confirmation}
|
||||
className="mt-1 block w-full"
|
||||
autoComplete="new-password"
|
||||
onChange={(e) =>
|
||||
setData('password_confirmation', e.target.value)
|
||||
}
|
||||
required
|
||||
/>
|
||||
|
||||
<InputError
|
||||
message={errors.password_confirmation}
|
||||
className="mt-2"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="mt-4 flex items-center justify-end">
|
||||
<Link
|
||||
href={route('login')}
|
||||
className="rounded-md text-sm text-gray-600 underline hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 dark:text-gray-400 dark:hover:text-gray-100 dark:focus:ring-offset-gray-800"
|
||||
>
|
||||
Already registered?
|
||||
</Link>
|
||||
|
||||
<PrimaryButton className="ms-4" disabled={processing}>
|
||||
Register
|
||||
</PrimaryButton>
|
||||
</div>
|
||||
</form>
|
||||
<div className="flex flex-col gap-6">
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle className="text-2xl">Register</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<form onSubmit={ submit }>
|
||||
<div className="flex flex-col gap-6">
|
||||
<div className="grid gap-2">
|
||||
<Label htmlFor="email">Username</Label>
|
||||
<TextInput id="name" placeholder="yumjin" value={ data.name }
|
||||
onChange={ (e) => setData('name', e.target.value) } required />
|
||||
<InputError message={ errors.name } className="mt-2" />
|
||||
</div>
|
||||
<div className="grid gap-2">
|
||||
<Label htmlFor="email">E-mail Address</Label>
|
||||
<TextInput type="email" id="email" placeholder="me@yumj.in" value={ data.email }
|
||||
onChange={ (e) => setData('email', e.target.value) } required />
|
||||
<InputError message={ errors.email } className="mt-2" />
|
||||
</div>
|
||||
<div className="grid gap-2">
|
||||
<div className="flex items-center">
|
||||
<Label htmlFor="password">Password</Label>
|
||||
</div>
|
||||
<TextInput id="password" type="password" name="password" value={ data.password }
|
||||
autoComplete="current-password"
|
||||
onChange={ (e) => setData('password', e.target.value) } />
|
||||
<InputError message={ errors.password } className="mt-2" />
|
||||
</div>
|
||||
<div className="grid gap-2">
|
||||
<div className="flex items-center">
|
||||
<Label htmlFor="password">Confirm Password</Label>
|
||||
</div>
|
||||
<TextInput id="password_confirmation" type="password" name="password_confirmation" value={ data.password_confirmation }
|
||||
autoComplete="current-password"
|
||||
onChange={ (e) => setData('password_confirmation', e.target.value) } />
|
||||
<InputError message={ errors.password_confirmation } className="mt-2" />
|
||||
</div>
|
||||
<PrimaryButton type="submit" disabled={ processing }
|
||||
className="w-full">Register</PrimaryButton>
|
||||
</div>
|
||||
<div className="mt-4 text-center text-sm">
|
||||
<Link href={ route('login') } className="underline underline-offset-4">
|
||||
Already registered?
|
||||
</Link>
|
||||
</div>
|
||||
</form>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
</GuestLayout>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import InputError from '@/Components/InputError';
|
||||
import InputLabel from '@/Components/InputLabel';
|
||||
import PrimaryButton from '@/Components/PrimaryButton';
|
||||
import TextInput from '@/Components/TextInput';
|
||||
import GuestLayout from '@/Layouts/GuestLayout';
|
||||
import { Head, useForm } from '@inertiajs/react';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/Components/ui/card.jsx";
|
||||
import { Label } from "@/Components/ui/label.jsx";
|
||||
|
||||
export default function ResetPassword({ token, email }) {
|
||||
const { data, setData, post, processing, errors, reset } = useForm({
|
||||
@@ -24,71 +25,43 @@ export default function ResetPassword({ token, email }) {
|
||||
return (
|
||||
<GuestLayout>
|
||||
<Head title="Reset Password" />
|
||||
|
||||
<form onSubmit={submit}>
|
||||
<div>
|
||||
<InputLabel htmlFor="email" value="Email" />
|
||||
|
||||
<TextInput
|
||||
id="email"
|
||||
type="email"
|
||||
name="email"
|
||||
value={data.email}
|
||||
className="mt-1 block w-full"
|
||||
autoComplete="username"
|
||||
onChange={(e) => setData('email', e.target.value)}
|
||||
/>
|
||||
|
||||
<InputError message={errors.email} className="mt-2" />
|
||||
</div>
|
||||
|
||||
<div className="mt-4">
|
||||
<InputLabel htmlFor="password" value="Password" />
|
||||
|
||||
<TextInput
|
||||
id="password"
|
||||
type="password"
|
||||
name="password"
|
||||
value={data.password}
|
||||
className="mt-1 block w-full"
|
||||
autoComplete="new-password"
|
||||
isFocused={true}
|
||||
onChange={(e) => setData('password', e.target.value)}
|
||||
/>
|
||||
|
||||
<InputError message={errors.password} className="mt-2" />
|
||||
</div>
|
||||
|
||||
<div className="mt-4">
|
||||
<InputLabel
|
||||
htmlFor="password_confirmation"
|
||||
value="Confirm Password"
|
||||
/>
|
||||
|
||||
<TextInput
|
||||
type="password"
|
||||
id="password_confirmation"
|
||||
name="password_confirmation"
|
||||
value={data.password_confirmation}
|
||||
className="mt-1 block w-full"
|
||||
autoComplete="new-password"
|
||||
onChange={(e) =>
|
||||
setData('password_confirmation', e.target.value)
|
||||
}
|
||||
/>
|
||||
|
||||
<InputError
|
||||
message={errors.password_confirmation}
|
||||
className="mt-2"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="mt-4 flex items-center justify-end">
|
||||
<PrimaryButton className="ms-4" disabled={processing}>
|
||||
Reset Password
|
||||
</PrimaryButton>
|
||||
</div>
|
||||
</form>
|
||||
<div className="flex flex-col gap-6">
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle className="text-2xl">Reset Password</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<form onSubmit={ submit }>
|
||||
<div className="flex flex-col gap-6">
|
||||
<div className="grid gap-2">
|
||||
<Label htmlFor="email">E-mail Address</Label>
|
||||
<TextInput type="email" id="email" placeholder="me@yumj.in" value={ data.email }
|
||||
onChange={ (e) => setData('email', e.target.value) } required />
|
||||
<InputError message={ errors.email } className="mt-2" />
|
||||
</div>
|
||||
<div className="grid gap-2">
|
||||
<div className="flex items-center">
|
||||
<Label htmlFor="password">Password</Label>
|
||||
</div>
|
||||
<TextInput id="password" type="password" name="password" value={ data.password }
|
||||
onChange={ (e) => setData('password', e.target.value) } />
|
||||
<InputError message={ errors.password } className="mt-2" />
|
||||
</div>
|
||||
<div className="grid gap-2">
|
||||
<div className="flex items-center">
|
||||
<Label htmlFor="password_confirmation">Password Confirmation</Label>
|
||||
</div>
|
||||
<TextInput id="password_confirmation" type="password" name="password_confirmation" value={ data.password_confirmation }
|
||||
onChange={ (e) => setData('password_confirmation', e.target.value) } />
|
||||
<InputError message={ errors.password_confirmation } className="mt-2" />
|
||||
</div>
|
||||
<PrimaryButton type="submit" disabled={ processing }
|
||||
className="w-full">Reset Password</PrimaryButton>
|
||||
</div>
|
||||
</form>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
</GuestLayout>
|
||||
);
|
||||
}
|
||||
|
||||
161
resources/js/Pages/Comic/Chapters.jsx
Normal file
161
resources/js/Pages/Comic/Chapters.jsx
Normal file
@@ -0,0 +1,161 @@
|
||||
import { useState } from 'react';
|
||||
import { Head, Link, router } from '@inertiajs/react';
|
||||
import { Moon, Plus, Star, ArrowDownNarrowWide, ArrowUpNarrowWide } from 'lucide-react';
|
||||
|
||||
import AppLayout from '@/Layouts/AppLayout.jsx';
|
||||
|
||||
import { BreadcrumbItem, BreadcrumbPage, BreadcrumbSeparator } from '@/components/ui/breadcrumb';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
||||
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
|
||||
import { useToast } from '@/hooks/use-toast';
|
||||
import { Badge } from "@/Components/ui/badge.jsx";
|
||||
|
||||
export default function Chapters({ auth, comic, chapters }) {
|
||||
|
||||
const [group, setGroup] = useState('default');
|
||||
const [favourites, setFavourites] = useState(auth.user.favourites);
|
||||
const [ascending, setAscending] = useState(true);
|
||||
|
||||
const { toast } = useToast();
|
||||
|
||||
const favouriteOnClickHandler = (pathword) => {
|
||||
axios.post(route('comics.postFavourite'), { pathword: pathword }).then(res => {
|
||||
setFavourites(res.data);
|
||||
});
|
||||
|
||||
toast({
|
||||
title: "All set",
|
||||
description: `${comic.comic.name} is now in / remove your favorite list.`,
|
||||
});
|
||||
}
|
||||
|
||||
const groupOnClickHandler = (pathword) => {
|
||||
router.get(`/comic/${ comic.comic.path_word }?group=${ pathword }`, {}, {
|
||||
only: ['chapters'],
|
||||
preserveState: true
|
||||
});
|
||||
setGroup(pathword);
|
||||
setAscending(true);
|
||||
}
|
||||
|
||||
const ComicChapterLink = (props) => {
|
||||
const isNew = Date.now() - Date.parse(props.datetime_created) < 6.048e+8;
|
||||
|
||||
return (
|
||||
<TooltipProvider>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<Button className="" size="sm" variant="outline" asChild>
|
||||
<Link className="relative" href={ `/comic/${ comic.comic.path_word }/${ props.uuid }` }>
|
||||
{ props.name }
|
||||
{ isNew && <Plus size={ 16 } className="text-xs absolute right-0 top-0" /> }
|
||||
</Link>
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>
|
||||
<p>Updated: { props.datetime_created }</p>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
);
|
||||
}
|
||||
|
||||
const toggleAscending = (e) => {
|
||||
setAscending(!ascending);
|
||||
|
||||
}
|
||||
|
||||
return (
|
||||
<AppLayout auth={ auth } header={
|
||||
<>
|
||||
<BreadcrumbSeparator />
|
||||
<BreadcrumbItem>
|
||||
<BreadcrumbPage>{ comic.comic.name }</BreadcrumbPage>
|
||||
</BreadcrumbItem>
|
||||
</>
|
||||
}>
|
||||
<Head>
|
||||
<title>{ comic.comic.name }</title>
|
||||
</Head>
|
||||
<div className="p-3 pt-1">
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle className="flex flex-row content-end items-center">
|
||||
<Button onClick={ () => favouriteOnClickHandler(comic.comic.path_word) } size="icon" variant="ghost">
|
||||
<Star fill={ favourites.includes(comic.comic.path_word) ? 'yellow': 'white' } />
|
||||
</Button>
|
||||
<span>{ comic.comic.name }</span>
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="flex justify-start justify-items-stretch content-start items-start gap-5 flex-wrap">
|
||||
<div className="basis-full lg:basis-2/12">
|
||||
<img className="block object-fill w-full" src={ "/image/" + btoa(comic.comic.cover) }
|
||||
alt={ comic.comic.name } />
|
||||
</div>
|
||||
<div className="basis-full lg:basis-9/12">
|
||||
<table className="table-fixed w-full text-sm">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td className="text-right w-24 pr-3">Alias</td>
|
||||
<td>{ comic.comic.alias }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td className="text-right pr-3">Category</td>
|
||||
<td>
|
||||
{ comic.comic.theme.map(t =>
|
||||
<Badge key={ t.path_word } className="m-2" variant="outline">
|
||||
<Link href={ route("comics.index", { tag: t.path_word }) }>{ t.name }</Link>
|
||||
</Badge>
|
||||
) }
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td className="text-right pr-3">Authors</td>
|
||||
<td>{ comic.comic.author.map(a => <Badge key={ a.path_word } className="m-2" variant="outline"><Link>{ a.name }</Link></Badge>) }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td className="text-right pr-3">Description</td>
|
||||
<td>{ comic.comic.brief }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td className="text-right pr-3">Updated At</td>
|
||||
<td>{ comic.comic.datetime_updated }</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</CardContent>
|
||||
<CardContent>
|
||||
<Tabs defaultValue={ group } className="w-full">
|
||||
<div className="flex">
|
||||
<TabsList className={ `grid w-full grid-cols-${ Object.entries(comic.groups).length } ` }>
|
||||
{ Object.entries(comic.groups).map((g, i) => (
|
||||
<TabsTrigger onClick={ () => groupOnClickHandler(g[1].path_word) }
|
||||
key={ g[1].path_word }
|
||||
value={ g[1].path_word }>
|
||||
{ g[1].name }
|
||||
</TabsTrigger>
|
||||
)) }
|
||||
</TabsList>
|
||||
<div>
|
||||
<Button variant="link" size="icon" onClick={ () => toggleAscending() }>
|
||||
{ ascending ? <ArrowDownNarrowWide /> : <ArrowUpNarrowWide /> }
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<TabsContent value={ group }>
|
||||
<div className="w-full grid grid-cols-1 md:grid-cols-2 lg:grid-cols-6 xl:grid-cols-12 gap-1">
|
||||
{ chapters.list.sort((a, b) => ascending ? (a.index - b.index) : (b.index - a.index)).map(c => (
|
||||
<ComicChapterLink key={ c.uuid } { ...c } />
|
||||
) ) }
|
||||
</div>
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
</AppLayout>
|
||||
);
|
||||
}
|
||||
89
resources/js/Pages/Comic/Favourites.jsx
Normal file
89
resources/js/Pages/Comic/Favourites.jsx
Normal file
@@ -0,0 +1,89 @@
|
||||
import { Head, Link, router } from '@inertiajs/react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import AppLayout from '@/Layouts/AppLayout.jsx';
|
||||
import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import { Star } from 'lucide-react';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
|
||||
import { BreadcrumbItem, BreadcrumbPage, BreadcrumbSeparator } from "@/components/ui/breadcrumb";
|
||||
import { useToast } from "@/hooks/use-toast.js";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function Favourites({ auth, favourites }) {
|
||||
|
||||
const { toast } = useToast();
|
||||
const [stateFavourites, setStateFavourites] = useState(favourites);
|
||||
|
||||
const favouriteOnClickHandler = (pathword) => {
|
||||
axios.post(route('comics.postFavourite'), { pathword: pathword }).then(res => {
|
||||
setStateFavourites(stateFavourites.filter(f => f.pathword !== pathword));
|
||||
console.log(stateFavourites);
|
||||
//setFavourites(res.data);
|
||||
});
|
||||
|
||||
toast({
|
||||
title: "All set",
|
||||
description: `The comic is now removed from your favorite list.`,
|
||||
});
|
||||
}
|
||||
|
||||
const FavouriteCard = (props) => {
|
||||
return (
|
||||
<Card>
|
||||
<CardContent className="flex gap-2">
|
||||
<div className="basis-1/4 pt-3">
|
||||
<div className="relative">
|
||||
<Link href={ `/comic/${ props.pathword }` }>
|
||||
<img className="block w-100 min-w-full object-fill" src={ "/image/" + btoa(props.cover) }
|
||||
alt={ props.name } />
|
||||
</Link>
|
||||
<Button className="absolute bottom-0 right-0"
|
||||
onClick={ () => favouriteOnClickHandler(props.pathword) } size="icon">
|
||||
<Star fill='yellow' />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div className="basis-3/4">
|
||||
<CardHeader>
|
||||
<CardTitle><Link href={ `/comic/${ props.pathword }` }>{ props.name }</Link></CardTitle>
|
||||
<div className="flex gap-2 items-end justify-between">
|
||||
<p>
|
||||
{ props.authors.map(a => <Badge key={ a.path_word } variant="outline"><Link>{ a.name }</Link></Badge>) }
|
||||
</p>
|
||||
<p className="text-right text-sm">
|
||||
Updated: { props.upstream_updated_at }
|
||||
</p>
|
||||
</div>
|
||||
<div className="pt-2">{ props.description }</div>
|
||||
</CardHeader>
|
||||
<CardFooter className="relative">
|
||||
<Button className="w-full" asChild>
|
||||
<Link href={ route('comics.read', [props.pathword, props.metadata.comic.last_chapter.uuid])}>
|
||||
Read [{ props.metadata.comic.last_chapter.name }]
|
||||
</Link>
|
||||
</Button>
|
||||
</CardFooter>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<AppLayout auth={ auth } header={
|
||||
<>
|
||||
<BreadcrumbSeparator />
|
||||
<BreadcrumbItem>
|
||||
<BreadcrumbPage>Favourites</BreadcrumbPage>
|
||||
</BreadcrumbItem>
|
||||
</>
|
||||
}>
|
||||
<Head>
|
||||
<title>Favourites</title>
|
||||
</Head>
|
||||
<div className="p-3 pt-1 grid lg:grid-cols-2 sm:grid-cols-1 gap-2">
|
||||
{ stateFavourites.map((favourite, i) => <FavouriteCard key={ i } {...favourite } /> ) }
|
||||
</div>
|
||||
</AppLayout>
|
||||
);
|
||||
}
|
||||
78
resources/js/Pages/Comic/Index.jsx
Normal file
78
resources/js/Pages/Comic/Index.jsx
Normal file
@@ -0,0 +1,78 @@
|
||||
import { useState } from 'react';
|
||||
import { Head, Link } from '@inertiajs/react';
|
||||
import { Star } from 'lucide-react';
|
||||
|
||||
import AppLayout from '@/Layouts/AppLayout.jsx';
|
||||
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import { Pagination, PaginationContent, PaginationItem, PaginationNext, PaginationPrevious } from '@/components/ui/pagination';
|
||||
import { useToast } from '@/hooks/use-toast.js';
|
||||
|
||||
export default function Index({ comics, offset, auth }) {
|
||||
|
||||
const url = new URL(window.location).searchParams;
|
||||
|
||||
const [favourites, setFavourites] = useState(auth.user.favourites);
|
||||
const { toast } = useToast();
|
||||
|
||||
const favouriteOnClickHandler = (pathword) => {
|
||||
axios.post(route('comics.postFavourite'), { pathword: pathword }).then(res => {
|
||||
setFavourites(res.data);
|
||||
});
|
||||
|
||||
toast({
|
||||
title: "All set",
|
||||
description: `${comics.list.filter(c => c.path_word === pathword)[0].name} is now in / remove your favorite list.`,
|
||||
});
|
||||
}
|
||||
|
||||
const ComicCard = (props) => (
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<div className="relative">
|
||||
<Link href={ `/comic/${ props.path_word }` }>
|
||||
<img className="block w-100 min-w-full object-fill" src={ "/image/" + btoa(props.cover) } alt={ props.name } />
|
||||
</Link>
|
||||
<Button className="absolute bottom-0 right-0" onClick={ () => favouriteOnClickHandler(props.path_word) } size="icon">
|
||||
<Star fill={ favourites.includes(props.path_word) ? 'yellow': '' } />
|
||||
</Button>
|
||||
</div>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<CardTitle><Link href={ `/comic/${ props.path_word }` }>{ props.name }</Link></CardTitle>
|
||||
<CardDescription className="pt-2">
|
||||
{ props.author.map(a => <Badge className="m-1" key={ a.path_word } variant="outline"><Link>{ a.name }</Link></Badge>) }
|
||||
</CardDescription>
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
|
||||
const ComicCards = (comics) => {
|
||||
return comics.list.map((comic, i) => <ComicCard key={ i } { ...comic } />);
|
||||
}
|
||||
|
||||
return (
|
||||
<AppLayout auth={ auth }>
|
||||
<Head>
|
||||
<title>Home</title>
|
||||
</Head>
|
||||
<div className="p-3 pt-1 grid lg:grid-cols-6 sm:grid-cols-2 gap-2">
|
||||
<ComicCards { ...comics } />
|
||||
</div>
|
||||
<Pagination className="justify-end pb-2">
|
||||
<PaginationContent>
|
||||
{ parseInt(offset) !== 0 &&
|
||||
<PaginationItem>
|
||||
<PaginationPrevious href={ `/?${url}` } only={['comics', 'offset']} headers={{ offset: parseInt(offset) - 30 }} />
|
||||
</PaginationItem>
|
||||
}
|
||||
<PaginationItem>
|
||||
<PaginationNext href={ `/?${url}` } only={['comics', 'offset']} headers={{ offset: parseInt(offset) + 30 }} />
|
||||
</PaginationItem>
|
||||
</PaginationContent>
|
||||
</Pagination>
|
||||
</AppLayout>
|
||||
);
|
||||
}
|
||||
291
resources/js/Pages/Comic/Read.jsx
Normal file
291
resources/js/Pages/Comic/Read.jsx
Normal file
@@ -0,0 +1,291 @@
|
||||
import { Head, Link, router } from '@inertiajs/react';
|
||||
import AppLayout from '@/Layouts/AppLayout.jsx';
|
||||
import React, { useEffect, useLayoutEffect, useRef, useState } from 'react';
|
||||
import { BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator } from "@/Components/ui/breadcrumb.jsx";
|
||||
import { Button } from "@/Components/ui/button.jsx";
|
||||
import { ChevronFirst, ChevronLast, Rows3, Settings } from "lucide-react";
|
||||
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from "@/components/ui/dialog";
|
||||
import PrimaryButton from "@/Components/PrimaryButton.jsx";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { Tooltip, TooltipProvider, TooltipTrigger } from "@radix-ui/react-tooltip";
|
||||
import { TooltipContent } from "@/Components/ui/tooltip.jsx";
|
||||
import { throttle } from "lodash";
|
||||
|
||||
export default function Read({ auth, comic, chapter }) {
|
||||
const [readingMode, setReadingMode] = useState('rtl'); // rtl, utd
|
||||
const [isTwoPagesPerScreen, setIsTwoPagePerScreen] = useState(false);
|
||||
const [currentImage, setCurrentImage] = useState(1);
|
||||
|
||||
const windowSize = useWindowSize();
|
||||
const ref = useRef();
|
||||
|
||||
const [divDimensions, setDivDimensions] = useState([0, 0]);
|
||||
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
function useWindowSize() {
|
||||
const [size, setSize] = useState([0, 0]);
|
||||
useLayoutEffect(() => {
|
||||
function updateSize() {
|
||||
setSize([window.innerWidth, window.innerHeight]);
|
||||
}
|
||||
|
||||
window.addEventListener('resize', updateSize);
|
||||
updateSize();
|
||||
return () => window.removeEventListener('resize', updateSize);
|
||||
}, []);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
const toggleReadingMode = (e) => {
|
||||
if (e) {
|
||||
setReadingMode('utd');
|
||||
} else {
|
||||
setReadingMode('rtl');
|
||||
}
|
||||
}
|
||||
|
||||
const setViewPort = (e) => {
|
||||
//console.log(e.target.childNodes);
|
||||
//console.log(e.target.naturalHeight);
|
||||
}
|
||||
|
||||
const ImageForComic = (img) => {
|
||||
const imgRef = useRef();
|
||||
|
||||
const resizeImage = () => {
|
||||
if (!imgRef.current || !ref.current) return;
|
||||
|
||||
const { naturalWidth, naturalHeight } = imgRef.current;
|
||||
const containerWidth = ref.current.clientWidth;
|
||||
const containerHeight = ref.current.clientHeight;
|
||||
|
||||
let width, height;
|
||||
|
||||
if (readingMode === "rtl") {
|
||||
// Scale for RTL mode
|
||||
const ratioWidth = naturalWidth / containerWidth;
|
||||
const ratioHeight = naturalHeight / containerHeight;
|
||||
const maxRatio = Math.max(ratioWidth, ratioHeight);
|
||||
width = naturalWidth / maxRatio;
|
||||
height = naturalHeight / maxRatio;
|
||||
} else if (readingMode === "utd") {
|
||||
// Scale for UTD mode
|
||||
const ratio = divDimensions[1] < divDimensions[0] ? 0.33 : 1; // Example logic
|
||||
const scaledWidth = containerWidth * ratio;
|
||||
const scaledRatio = naturalWidth / scaledWidth;
|
||||
width = naturalWidth / scaledRatio;
|
||||
height = naturalHeight / scaledRatio;
|
||||
}
|
||||
|
||||
// Apply dimensions directly
|
||||
imgRef.current.style.width = `${width}px`;
|
||||
imgRef.current.style.height = `${height}px`;
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
resizeImage();
|
||||
}, [readingMode, divDimensions]); // Recalculate when these dependencies change
|
||||
|
||||
const handleImageClick = (e) => {
|
||||
if (readingMode === "utd") return;
|
||||
|
||||
const bounds = imgRef.current.getBoundingClientRect();
|
||||
const percentage = (e.pageX - bounds.left) / imgRef.current.offsetWidth;
|
||||
|
||||
if (percentage < 0.45) {
|
||||
if (img.innerKey === 0 && chapter.chapter.prev) {
|
||||
router.visit(route('comics.read', [comic.comic.path_word, chapter.chapter.prev]));
|
||||
} else {
|
||||
document.getElementById(`image-${img.innerKey - 1}`)?.scrollIntoView();
|
||||
}
|
||||
} else if (percentage > 0.55) {
|
||||
if (img.innerKey >= chapter.sorted.length - 1 && chapter.chapter.next) {
|
||||
router.visit(route('comics.read', [comic.comic.path_word, chapter.chapter.next]));
|
||||
} else {
|
||||
document.getElementById(`image-${img.innerKey + 1}`)?.scrollIntoView();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return (<div className="basis-full">
|
||||
<img
|
||||
id={ `image-${img.innerKey}` }
|
||||
ref={ imgRef }
|
||||
className="m-auto comic-img"
|
||||
src={ `/image/${btoa(img.url)}` }
|
||||
onLoad={ resizeImage } // Resize image immediately on load
|
||||
onClick={ handleImageClick }
|
||||
alt={ comic.comic.name }
|
||||
/>
|
||||
</div>);
|
||||
}
|
||||
|
||||
const Toolbar = () => {
|
||||
return (
|
||||
<>
|
||||
<Dialog>
|
||||
<DialogTrigger>
|
||||
<TooltipProvider>
|
||||
<Tooltip>
|
||||
<TooltipTrigger>
|
||||
<Button variant="link" size="icon">
|
||||
<Settings />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>
|
||||
<p>Options</p>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
</DialogTrigger>
|
||||
<DialogContent className="max-w-[600px]">
|
||||
<DialogHeader>
|
||||
<DialogTitle>Options</DialogTitle>
|
||||
<DialogDescription>
|
||||
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<div className="space-y-4">
|
||||
<div className="flex flex-row items-center justify-between rounded-lg border p-3 shadow-sm">
|
||||
<div className="space-y-0.5">
|
||||
<label>Reading Mode</label>
|
||||
<p>Turn on for UTD mode</p>
|
||||
</div>
|
||||
<Switch defaultChecked={ readingMode === "utd" }
|
||||
onCheckedChange={ (e) => toggleReadingMode(e) } />
|
||||
</div>
|
||||
</div>
|
||||
<DialogFooter>
|
||||
<DialogClose asChild>
|
||||
<PrimaryButton>Done</PrimaryButton>
|
||||
</DialogClose>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
<TooltipProvider>
|
||||
<Tooltip>
|
||||
<TooltipTrigger>
|
||||
<Button variant="link" size="icon" asChild>
|
||||
<Link href={ route('comics.chapters', [comic.comic.path_word]) }>
|
||||
<Rows3 />
|
||||
</Link>
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>
|
||||
<p>Content Page</p>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
|
||||
{ chapter.chapter.prev && (
|
||||
<TooltipProvider>
|
||||
<Tooltip>
|
||||
<TooltipTrigger>
|
||||
<Button variant="link" size="icon" asChild>
|
||||
<Link href={ route('comics.read', [comic.comic.path_word, chapter.chapter.prev]) }>
|
||||
<ChevronFirst />
|
||||
</Link>
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>
|
||||
<p>Previous Chapter</p>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
) }
|
||||
|
||||
{ chapter.chapter.next && (
|
||||
<TooltipProvider>
|
||||
<Tooltip>
|
||||
<TooltipTrigger>
|
||||
<Button variant="link" size="icon" asChild>
|
||||
<Link href={ route('comics.read', [comic.comic.path_word, chapter.chapter.next]) }>
|
||||
<ChevronLast />
|
||||
</Link>
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>
|
||||
<p>Next Chapter</p>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
) }
|
||||
|
||||
<Button variant="ghost">
|
||||
{ currentImage } / { chapter.sorted.length }
|
||||
</Button>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
setDivDimensions([ref.current.clientWidth, ref.current.clientHeight]);
|
||||
}, [windowSize]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!ref.current) return;
|
||||
|
||||
const handleScroll = () => {
|
||||
const containerScrollTop = ref.current.scrollTop; // Current scroll position of the container
|
||||
const images = ref.current.querySelectorAll("img"); // Get all images
|
||||
|
||||
let visibleImageIndex = 0;
|
||||
|
||||
// Determine which image is visible based on scroll position
|
||||
images.forEach((image, index) => {
|
||||
const imageTop = image.offsetTop; // Distance from top of the container
|
||||
const imageBottom = imageTop + image.offsetHeight;
|
||||
|
||||
// Check if the image is in the visible area
|
||||
if (containerScrollTop + 80 >= imageTop && containerScrollTop < imageBottom) {
|
||||
visibleImageIndex = index;
|
||||
}
|
||||
});
|
||||
|
||||
// Update the current image index
|
||||
setCurrentImage(visibleImageIndex + 1);
|
||||
};
|
||||
|
||||
const throttledHandleScroll = throttle(handleScroll, 100); // Throttle for performance
|
||||
ref.current.addEventListener("scroll", throttledHandleScroll);
|
||||
|
||||
// Initial check for visible image
|
||||
handleScroll();
|
||||
|
||||
return () => {
|
||||
if (ref.current) {
|
||||
ref.current.removeEventListener("scroll", throttledHandleScroll);
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<AppLayout auth={ auth } header={
|
||||
<>
|
||||
<BreadcrumbSeparator />
|
||||
<BreadcrumbItem>
|
||||
<BreadcrumbLink asChild>
|
||||
<Link href={ route('comics.chapters', [comic.comic.path_word]) }>
|
||||
{ comic.comic.name }
|
||||
</Link>
|
||||
</BreadcrumbLink>
|
||||
</BreadcrumbItem>
|
||||
<BreadcrumbSeparator />
|
||||
<BreadcrumbItem>
|
||||
<BreadcrumbPage>{ chapter.chapter.name }</BreadcrumbPage>
|
||||
</BreadcrumbItem>
|
||||
</>
|
||||
} toolbar={ <Toolbar /> }>
|
||||
<Head>
|
||||
<title>{ chapter.chapter.name } - { comic.comic.name }</title>
|
||||
</Head>
|
||||
<div className="p-3 pt-1 pb-1 flex flex-wrap justify-center" id="mvp" ref={ ref }
|
||||
style={ { overflowAnchor: "none", height: "calc(100dvh - 90px)", overflowY: "scroll" } }>
|
||||
{ chapter.sorted.map((img, j) => <ImageForComic key={ j } innerKey={ j } { ...img } />) }
|
||||
</div>
|
||||
</AppLayout>
|
||||
);
|
||||
}
|
||||
@@ -1,39 +1,43 @@
|
||||
import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout';
|
||||
import { Head } from '@inertiajs/react';
|
||||
import DeleteUserForm from './Partials/DeleteUserForm';
|
||||
import UpdatePasswordForm from './Partials/UpdatePasswordForm';
|
||||
import UpdateProfileInformationForm from './Partials/UpdateProfileInformationForm';
|
||||
import AppLayout from "@/Layouts/AppLayout.jsx";
|
||||
import { BreadcrumbItem, BreadcrumbLink, BreadcrumbSeparator } from "@/Components/ui/breadcrumb.jsx";
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
|
||||
export default function Edit({ mustVerifyEmail, status }) {
|
||||
export default function Edit({ auth, mustVerifyEmail, status }) {
|
||||
return (
|
||||
<AuthenticatedLayout
|
||||
header={
|
||||
<h2 className="text-xl font-semibold leading-tight text-gray-800 dark:text-gray-200">
|
||||
Profile
|
||||
</h2>
|
||||
}
|
||||
>
|
||||
<AppLayout auth={ auth } header={
|
||||
<>
|
||||
<BreadcrumbSeparator />
|
||||
<BreadcrumbItem>
|
||||
<BreadcrumbLink>Profile</BreadcrumbLink>
|
||||
</BreadcrumbItem>
|
||||
</>
|
||||
}>
|
||||
<Head title="Profile" />
|
||||
|
||||
<div className="py-12">
|
||||
<div className="mx-auto max-w-7xl space-y-6 sm:px-6 lg:px-8">
|
||||
<div className="bg-white p-4 shadow sm:rounded-lg sm:p-8 dark:bg-gray-800">
|
||||
<div className="py-3">
|
||||
<Tabs defaultValue="profile" className="mx-auto max-w-7xl space-y-6 sm:px-6 lg:px-8">
|
||||
<TabsList className="grid w-full grid-cols-3">
|
||||
<TabsTrigger value="profile">Profile Information</TabsTrigger>
|
||||
<TabsTrigger value="password">Update Password</TabsTrigger>
|
||||
<TabsTrigger value="deleteAccount">Delete Account</TabsTrigger>
|
||||
</TabsList>
|
||||
<TabsContent value="profile">
|
||||
<UpdateProfileInformationForm
|
||||
mustVerifyEmail={mustVerifyEmail}
|
||||
status={status}
|
||||
className="max-w-xl"
|
||||
mustVerifyEmail={ mustVerifyEmail }
|
||||
status={ status }
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="bg-white p-4 shadow sm:rounded-lg sm:p-8 dark:bg-gray-800">
|
||||
<UpdatePasswordForm className="max-w-xl" />
|
||||
</div>
|
||||
|
||||
<div className="bg-white p-4 shadow sm:rounded-lg sm:p-8 dark:bg-gray-800">
|
||||
<DeleteUserForm className="max-w-xl" />
|
||||
</div>
|
||||
</div>
|
||||
</TabsContent>
|
||||
<TabsContent value="password">
|
||||
<UpdatePasswordForm />
|
||||
</TabsContent>
|
||||
<TabsContent value="deleteAccount">
|
||||
<DeleteUserForm />
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
</div>
|
||||
</AuthenticatedLayout>
|
||||
</AppLayout>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
import DangerButton from '@/Components/DangerButton';
|
||||
import InputError from '@/Components/InputError';
|
||||
import InputLabel from '@/Components/InputLabel';
|
||||
import Modal from '@/Components/Modal';
|
||||
import SecondaryButton from '@/Components/SecondaryButton';
|
||||
import TextInput from '@/Components/TextInput';
|
||||
import { useForm } from '@inertiajs/react';
|
||||
import { useRef, useState } from 'react';
|
||||
import {
|
||||
Dialog, DialogClose,
|
||||
DialogContent,
|
||||
DialogDescription, DialogFooter,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
DialogTrigger,
|
||||
} from "@/components/ui/dialog"
|
||||
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/Components/ui/card.jsx";
|
||||
|
||||
export default function DeleteUserForm({ className = '' }) {
|
||||
const [confirmingUserDeletion, setConfirmingUserDeletion] = useState(false);
|
||||
const passwordInput = useRef();
|
||||
|
||||
const {
|
||||
@@ -23,98 +29,57 @@ export default function DeleteUserForm({ className = '' }) {
|
||||
password: '',
|
||||
});
|
||||
|
||||
const confirmUserDeletion = () => {
|
||||
setConfirmingUserDeletion(true);
|
||||
};
|
||||
|
||||
const deleteUser = (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
destroy(route('profile.destroy'), {
|
||||
preserveScroll: true,
|
||||
onSuccess: () => closeModal(),
|
||||
onError: () => passwordInput.current.focus(),
|
||||
onFinish: () => reset(),
|
||||
});
|
||||
};
|
||||
|
||||
const closeModal = () => {
|
||||
setConfirmingUserDeletion(false);
|
||||
|
||||
clearErrors();
|
||||
reset();
|
||||
};
|
||||
|
||||
return (
|
||||
<section className={`space-y-6 ${className}`}>
|
||||
<header>
|
||||
<h2 className="text-lg font-medium text-gray-900 dark:text-gray-100">
|
||||
Delete Account
|
||||
</h2>
|
||||
|
||||
<p className="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
||||
Once your account is deleted, all of its resources and data
|
||||
will be permanently deleted. Before deleting your account,
|
||||
please download any data or information that you wish to
|
||||
retain.
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<DangerButton onClick={confirmUserDeletion}>
|
||||
Delete Account
|
||||
</DangerButton>
|
||||
|
||||
<Modal show={confirmingUserDeletion} onClose={closeModal}>
|
||||
<form onSubmit={deleteUser} className="p-6">
|
||||
<h2 className="text-lg font-medium text-gray-900 dark:text-gray-100">
|
||||
Are you sure you want to delete your account?
|
||||
</h2>
|
||||
|
||||
<p className="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
||||
Once your account is deleted, all of its resources and
|
||||
data will be permanently deleted. Please enter your
|
||||
password to confirm you would like to permanently delete
|
||||
your account.
|
||||
</p>
|
||||
|
||||
<div className="mt-6">
|
||||
<InputLabel
|
||||
htmlFor="password"
|
||||
value="Password"
|
||||
className="sr-only"
|
||||
/>
|
||||
|
||||
<TextInput
|
||||
id="password"
|
||||
type="password"
|
||||
name="password"
|
||||
ref={passwordInput}
|
||||
value={data.password}
|
||||
onChange={(e) =>
|
||||
setData('password', e.target.value)
|
||||
}
|
||||
className="mt-1 block w-3/4"
|
||||
isFocused
|
||||
placeholder="Password"
|
||||
/>
|
||||
|
||||
<InputError
|
||||
message={errors.password}
|
||||
className="mt-2"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="mt-6 flex justify-end">
|
||||
<SecondaryButton onClick={closeModal}>
|
||||
Cancel
|
||||
</SecondaryButton>
|
||||
|
||||
<DangerButton className="ms-3" disabled={processing}>
|
||||
Delete Account
|
||||
</DangerButton>
|
||||
</div>
|
||||
</form>
|
||||
</Modal>
|
||||
</section>
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Delete Account</CardTitle>
|
||||
<CardDescription className="pt-3">Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account,please download any data or information that you wish to retain.</CardDescription>
|
||||
</CardHeader>
|
||||
<CardFooter>
|
||||
<Dialog>
|
||||
<form onSubmit={ deleteUser }>
|
||||
<DialogTrigger asChild>
|
||||
<DangerButton>Delete Account</DangerButton>
|
||||
</DialogTrigger>
|
||||
<DialogContent className="max-w-[800px]">
|
||||
<DialogHeader>
|
||||
<DialogTitle>Are you sure you want to delete your account?</DialogTitle>
|
||||
<DialogDescription className="pt-3">
|
||||
Once your account is deleted, all of its resources and
|
||||
data will be permanently deleted. Please enter your
|
||||
password to confirm you would like to permanently delete
|
||||
your account.
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<div className="items-center gap-4">
|
||||
<TextInput id="password" type="password" name="password" ref={ passwordInput }
|
||||
value={ data.password }
|
||||
onChange={ (e) => setData('password', e.target.value) }
|
||||
className="mt-1 block w-full" isFocused placeholder="Password" />
|
||||
<InputError essage={ errors.password } className="mt-2" />
|
||||
</div>
|
||||
<DialogFooter className="mt-6 flex justify-end">
|
||||
<DialogClose asChild>
|
||||
<SecondaryButton>Cancel</SecondaryButton>
|
||||
</DialogClose>
|
||||
<DangerButton className="ms-3" onClick={ (e) => deleteUser(e) }>
|
||||
Delete Account
|
||||
</DangerButton>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</form>
|
||||
</Dialog>
|
||||
</CardFooter>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import TextInput from '@/Components/TextInput';
|
||||
import { Transition } from '@headlessui/react';
|
||||
import { useForm } from '@inertiajs/react';
|
||||
import { useRef } from 'react';
|
||||
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/Components/ui/card.jsx";
|
||||
|
||||
export default function UpdatePasswordForm({ className = '' }) {
|
||||
const passwordInput = useRef();
|
||||
@@ -45,98 +46,68 @@ export default function UpdatePasswordForm({ className = '' }) {
|
||||
};
|
||||
|
||||
return (
|
||||
<section className={className}>
|
||||
<header>
|
||||
<h2 className="text-lg font-medium text-gray-900 dark:text-gray-100">
|
||||
Update Password
|
||||
</h2>
|
||||
|
||||
<p className="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
||||
Ensure your account is using a long, random password to stay
|
||||
secure.
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<form onSubmit={updatePassword} className="mt-6 space-y-6">
|
||||
<div>
|
||||
<InputLabel
|
||||
htmlFor="current_password"
|
||||
value="Current Password"
|
||||
/>
|
||||
|
||||
<TextInput
|
||||
id="current_password"
|
||||
ref={currentPasswordInput}
|
||||
value={data.current_password}
|
||||
onChange={(e) =>
|
||||
setData('current_password', e.target.value)
|
||||
}
|
||||
type="password"
|
||||
className="mt-1 block w-full"
|
||||
autoComplete="current-password"
|
||||
/>
|
||||
|
||||
<InputError
|
||||
message={errors.current_password}
|
||||
className="mt-2"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<InputLabel htmlFor="password" value="New Password" />
|
||||
|
||||
<TextInput
|
||||
id="password"
|
||||
ref={passwordInput}
|
||||
value={data.password}
|
||||
onChange={(e) => setData('password', e.target.value)}
|
||||
type="password"
|
||||
className="mt-1 block w-full"
|
||||
autoComplete="new-password"
|
||||
/>
|
||||
|
||||
<InputError message={errors.password} className="mt-2" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<InputLabel
|
||||
htmlFor="password_confirmation"
|
||||
value="Confirm Password"
|
||||
/>
|
||||
|
||||
<TextInput
|
||||
id="password_confirmation"
|
||||
value={data.password_confirmation}
|
||||
onChange={(e) =>
|
||||
setData('password_confirmation', e.target.value)
|
||||
}
|
||||
type="password"
|
||||
className="mt-1 block w-full"
|
||||
autoComplete="new-password"
|
||||
/>
|
||||
|
||||
<InputError
|
||||
message={errors.password_confirmation}
|
||||
className="mt-2"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-4">
|
||||
<PrimaryButton disabled={processing}>Save</PrimaryButton>
|
||||
|
||||
<Card>
|
||||
<form onSubmit={ updatePassword }>
|
||||
<CardHeader>
|
||||
<CardTitle>Update Password</CardTitle>
|
||||
<CardDescription>Ensure your account is using a long, random password to stay secure.</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="grid w-full items-center gap-4">
|
||||
<div className="flex flex-col space-y-1.5">
|
||||
<InputLabel htmlFor="current_password" value="Current Password" />
|
||||
<TextInput
|
||||
id="current_password"
|
||||
ref={ currentPasswordInput }
|
||||
value={ data.current_password }
|
||||
onChange={ (e) =>
|
||||
setData('current_password', e.target.value)
|
||||
}
|
||||
type="password"
|
||||
className="mt-1 block w-full" />
|
||||
</div>
|
||||
<InputError className="mt-2" message={ errors.current_password } />
|
||||
</div>
|
||||
<div className="grid w-full items-center gap-4 pt-3">
|
||||
<div className="flex flex-col space-y-1.5">
|
||||
<InputLabel htmlFor="password" value="New Password" />
|
||||
<TextInput
|
||||
id="password"
|
||||
ref={ passwordInput }
|
||||
value={ data.password }
|
||||
onChange={ (e) => setData('password', e.target.value) }
|
||||
type="password"
|
||||
className="mt-1 block w-full" />
|
||||
</div>
|
||||
<InputError className="mt-2" message={ errors.password } />
|
||||
</div>
|
||||
<div className="grid w-full items-center gap-4 pt-3">
|
||||
<div className="flex flex-col space-y-1.5">
|
||||
<InputLabel htmlFor="password_confirmation" value="Confirm Password" />
|
||||
<TextInput
|
||||
id="password_confirmation"
|
||||
value={ data.password_confirmation }
|
||||
onChange={ (e) =>
|
||||
setData('password_confirmation', e.target.value)
|
||||
}
|
||||
type="password"
|
||||
className="mt-1 block w-full" />
|
||||
</div>
|
||||
<InputError className="mt-2" message={ errors.password_confirmation } />
|
||||
</div>
|
||||
</CardContent>
|
||||
<CardFooter>
|
||||
<PrimaryButton disabled={ processing }>Save</PrimaryButton>
|
||||
<Transition
|
||||
show={recentlySuccessful}
|
||||
show={ recentlySuccessful }
|
||||
enter="transition ease-in-out"
|
||||
enterFrom="opacity-0"
|
||||
leave="transition ease-in-out"
|
||||
leaveTo="opacity-0"
|
||||
>
|
||||
<p className="text-sm text-gray-600 dark:text-gray-400">
|
||||
Saved.
|
||||
</p>
|
||||
leaveTo="opacity-0">
|
||||
<p className="text-sm text-gray-600 dark:text-gray-400">Saved.</p>
|
||||
</Transition>
|
||||
</div>
|
||||
</CardFooter>
|
||||
</form>
|
||||
</section>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,14 @@ import PrimaryButton from '@/Components/PrimaryButton';
|
||||
import TextInput from '@/Components/TextInput';
|
||||
import { Transition } from '@headlessui/react';
|
||||
import { Link, useForm, usePage } from '@inertiajs/react';
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardFooter,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
|
||||
export default function UpdateProfileInformation({
|
||||
mustVerifyEmail,
|
||||
@@ -25,89 +33,74 @@ export default function UpdateProfileInformation({
|
||||
};
|
||||
|
||||
return (
|
||||
<section className={className}>
|
||||
<header>
|
||||
<h2 className="text-lg font-medium text-gray-900 dark:text-gray-100">
|
||||
Profile Information
|
||||
</h2>
|
||||
|
||||
<p className="mt-1 text-sm text-gray-600 dark:text-gray-400">
|
||||
Update your account's profile information and email address.
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<form onSubmit={submit} className="mt-6 space-y-6">
|
||||
<div>
|
||||
<InputLabel htmlFor="name" value="Name" />
|
||||
|
||||
<TextInput
|
||||
id="name"
|
||||
className="mt-1 block w-full"
|
||||
value={data.name}
|
||||
onChange={(e) => setData('name', e.target.value)}
|
||||
required
|
||||
isFocused
|
||||
autoComplete="name"
|
||||
/>
|
||||
|
||||
<InputError className="mt-2" message={errors.name} />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<InputLabel htmlFor="email" value="Email" />
|
||||
|
||||
<TextInput
|
||||
id="email"
|
||||
type="email"
|
||||
className="mt-1 block w-full"
|
||||
value={data.email}
|
||||
onChange={(e) => setData('email', e.target.value)}
|
||||
required
|
||||
autoComplete="username"
|
||||
/>
|
||||
|
||||
<InputError className="mt-2" message={errors.email} />
|
||||
</div>
|
||||
|
||||
{mustVerifyEmail && user.email_verified_at === null && (
|
||||
<div>
|
||||
<p className="mt-2 text-sm text-gray-800 dark:text-gray-200">
|
||||
Your email address is unverified.
|
||||
<Link
|
||||
href={route('verification.send')}
|
||||
method="post"
|
||||
as="button"
|
||||
className="rounded-md text-sm text-gray-600 underline hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 dark:text-gray-400 dark:hover:text-gray-100 dark:focus:ring-offset-gray-800"
|
||||
>
|
||||
Click here to re-send the verification email.
|
||||
</Link>
|
||||
</p>
|
||||
|
||||
{status === 'verification-link-sent' && (
|
||||
<div className="mt-2 text-sm font-medium text-green-600 dark:text-green-400">
|
||||
A new verification link has been sent to your
|
||||
email address.
|
||||
</div>
|
||||
)}
|
||||
<Card>
|
||||
<form onSubmit={ submit }>
|
||||
<CardHeader>
|
||||
<CardTitle>Profile Information</CardTitle>
|
||||
<CardDescription>Update your account's profile information and email address.</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="grid w-full items-center gap-4">
|
||||
<div className="flex flex-col space-y-1.5">
|
||||
<InputLabel htmlFor="name" value="Name" />
|
||||
<TextInput
|
||||
id="name"
|
||||
className="mt-1 block w-full"
|
||||
value={ data.name }
|
||||
onChange={ (e) => setData('name', e.target.value) } />
|
||||
</div>
|
||||
<InputError className="mt-2" message={ errors.name } />
|
||||
</div>
|
||||
<div className="grid w-full items-center gap-4 pt-3">
|
||||
<div className="flex flex-col space-y-1.5">
|
||||
<InputLabel htmlFor="email" value="Email" />
|
||||
<TextInput
|
||||
id="email"
|
||||
type="email"
|
||||
className="mt-1 block w-full"
|
||||
value={ data.email }
|
||||
onChange={ (e) => setData('email', e.target.value) }
|
||||
required />
|
||||
</div>
|
||||
<InputError className="mt-2" message={ errors.email } />
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="flex items-center gap-4">
|
||||
<PrimaryButton disabled={processing}>Save</PrimaryButton>
|
||||
{ mustVerifyEmail && user.email_verified_at === null && (
|
||||
<div className="grid w-full items-center gap-4 pt-3">
|
||||
<div className="flex flex-col space-y-1.5">
|
||||
<p className="mt-2 text-sm text-gray-800 dark:text-gray-200">
|
||||
Your email address is unverified.
|
||||
<Link
|
||||
href={ route('verification.send') }
|
||||
method="post"
|
||||
as="button"
|
||||
className="rounded-md text-sm text-gray-600 underline hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 dark:text-gray-400 dark:hover:text-gray-100 dark:focus:ring-offset-gray-800">
|
||||
Click here to re-send the verification email.
|
||||
</Link>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{ status === 'verification-link-sent' && (
|
||||
<div className="mt-2 text-sm font-medium text-green-600 dark:text-green-400">
|
||||
A new verification link has been sent to your
|
||||
email address.
|
||||
</div>
|
||||
) }
|
||||
</div>
|
||||
) }
|
||||
</CardContent>
|
||||
<CardFooter>
|
||||
<PrimaryButton disabled={ processing }>Save</PrimaryButton>
|
||||
<Transition
|
||||
show={recentlySuccessful}
|
||||
show={ recentlySuccessful }
|
||||
enter="transition ease-in-out"
|
||||
enterFrom="opacity-0"
|
||||
leave="transition ease-in-out"
|
||||
leaveTo="opacity-0"
|
||||
>
|
||||
<p className="text-sm text-gray-600 dark:text-gray-400">
|
||||
Saved.
|
||||
</p>
|
||||
leaveTo="opacity-0">
|
||||
<p className="text-sm text-gray-600 dark:text-gray-400">Saved.</p>
|
||||
</Transition>
|
||||
</div>
|
||||
</CardFooter>
|
||||
</form>
|
||||
</section>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user