Commit 5495beb5 by Ivan

fix: fix layout

parent fff3f6c5
...@@ -3,7 +3,7 @@ import Layout from './Layout' ...@@ -3,7 +3,7 @@ import Layout from './Layout'
export default function Home({ auth, featured_images = [] }) { export default function Home({ auth, featured_images = [] }) {
return ( return (
<Layout user={auth.user}> <Layout user={auth}>
<Head title="Welcome" /> <Head title="Welcome" />
<div className="relative bg-white overflow-hidden"> <div className="relative bg-white overflow-hidden">
...@@ -32,7 +32,7 @@ export default function Home({ auth, featured_images = [] }) { ...@@ -32,7 +32,7 @@ export default function Home({ auth, featured_images = [] }) {
Organize with tags, search with ease, and collaborate with others. Organize with tags, search with ease, and collaborate with others.
</p> </p>
<div className="mt-5 sm:mt-8 sm:flex sm:justify-center lg:justify-start"> <div className="mt-5 sm:mt-8 sm:flex sm:justify-center lg:justify-start">
{auth.user ? ( {auth ? (
<div className="rounded-md shadow"> <div className="rounded-md shadow">
<Link <Link
href="/images" href="/images"
...@@ -222,7 +222,7 @@ export default function Home({ auth, featured_images = [] }) { ...@@ -222,7 +222,7 @@ export default function Home({ auth, featured_images = [] }) {
<span className="block text-indigo-600">Create your account today.</span> <span className="block text-indigo-600">Create your account today.</span>
</h2> </h2>
<div className="mt-8 flex lg:mt-0 lg:flex-shrink-0"> <div className="mt-8 flex lg:mt-0 lg:flex-shrink-0">
{auth.user ? ( {auth ? (
<div className="inline-flex rounded-md shadow"> <div className="inline-flex rounded-md shadow">
<Link <Link
href="/images/new" href="/images/new"
......
...@@ -33,7 +33,7 @@ export default function Layout({ children, user, title }) { ...@@ -33,7 +33,7 @@ export default function Layout({ children, user, title }) {
)} )}
{user?.roles.includes('admin') && ( {user?.roles.includes('admin') && (
<Link <Link
href="/admin" href="/admin/images"
className="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium" className="border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium"
> >
管理员 管理员
...@@ -156,7 +156,7 @@ export default function Layout({ children, user, title }) { ...@@ -156,7 +156,7 @@ export default function Layout({ children, user, title }) {
)} )}
{user?.roles?.includes('admin') && ( {user?.roles?.includes('admin') && (
<Link <Link
href="/admin" href="/admin/images"
className="border-transparent text-gray-500 hover:bg-gray-50 hover:border-gray-300 hover:text-gray-700 block pl-3 pr-4 py-2 border-l-4 text-base font-medium" className="border-transparent text-gray-500 hover:bg-gray-50 hover:border-gray-300 hover:text-gray-700 block pl-3 pr-4 py-2 border-l-4 text-base font-medium"
> >
管理员 管理员
......
...@@ -4,7 +4,7 @@ import { Link } from '@inertiajs/react' ...@@ -4,7 +4,7 @@ import { Link } from '@inertiajs/react'
export default function AdminDashboard({ stats, auth }) { export default function AdminDashboard({ stats, auth }) {
return ( return (
<Layout user={auth.user}> <Layout user={auth}>
<Head title="Admin Dashboard" /> <Head title="Admin Dashboard" />
<div className="bg-white shadow overflow-hidden sm:rounded-lg"> <div className="bg-white shadow overflow-hidden sm:rounded-lg">
<div className="px-4 py-5 sm:px-6"> <div className="px-4 py-5 sm:px-6">
......
...@@ -4,7 +4,7 @@ import ComImageIndex from '../../../components/images/ComImageIndex' ...@@ -4,7 +4,7 @@ import ComImageIndex from '../../../components/images/ComImageIndex'
export default function AdminImagesIndex({ auth, images, pagination, filters }) { export default function AdminImagesIndex({ auth, images, pagination, filters }) {
return ( return (
<Layout user={auth.user}> <Layout user={auth}>
<Head title="图片管理" /> <Head title="图片管理" />
<ComImageIndex <ComImageIndex
auth={auth} auth={auth}
......
...@@ -4,7 +4,7 @@ import ComTagsIndex from '../../../components/tags/ComTagsIndex' ...@@ -4,7 +4,7 @@ import ComTagsIndex from '../../../components/tags/ComTagsIndex'
export default function AdminTagsIndex({ tags, auth, errors = {} }) { export default function AdminTagsIndex({ tags, auth, errors = {} }) {
return ( return (
<Layout user={auth.user}> <Layout user={auth}>
<Head title="标签管理" /> <Head title="标签管理" />
<ComTagsIndex <ComTagsIndex
title="标签管理" title="标签管理"
......
...@@ -4,7 +4,7 @@ import ComImageIndex from '../../../../components/images/ComImageIndex' ...@@ -4,7 +4,7 @@ import ComImageIndex from '../../../../components/images/ComImageIndex'
export default function TagsImagesIndex({ auth, tag, images, pagination, filters }) { export default function TagsImagesIndex({ auth, tag, images, pagination, filters }) {
return ( return (
<Layout user={auth.user}> <Layout user={auth}>
<Head title={`${tag.name} - 标签图片`} /> <Head title={`${tag.name} - 标签图片`} />
<ComImageIndex <ComImageIndex
auth={auth} auth={auth}
......
...@@ -31,7 +31,7 @@ export default function New({ auth, tag, errors = {} }) { ...@@ -31,7 +31,7 @@ export default function New({ auth, tag, errors = {} }) {
} }
return ( return (
<Layout user={auth.user}> <Layout user={auth}>
<Head title={`添加图片到标签: ${tag.name}`} /> <Head title={`添加图片到标签: ${tag.name}`} />
<div className="bg-white shadow overflow-hidden sm:rounded-lg"> <div className="bg-white shadow overflow-hidden sm:rounded-lg">
<div className="px-4 py-5 sm:px-6"> <div className="px-4 py-5 sm:px-6">
......
...@@ -60,7 +60,7 @@ export default function AdminUsersIndex({ users, auth, errors = {} }) { ...@@ -60,7 +60,7 @@ export default function AdminUsersIndex({ users, auth, errors = {} }) {
} }
return ( return (
<Layout user={auth.user}> <Layout user={auth}>
<Head title="Admin - Manage Users" /> <Head title="Admin - Manage Users" />
<div className="bg-white shadow overflow-hidden sm:rounded-lg"> <div className="bg-white shadow overflow-hidden sm:rounded-lg">
<div className="px-4 py-5 sm:px-6 flex justify-between items-center"> <div className="px-4 py-5 sm:px-6 flex justify-between items-center">
...@@ -160,7 +160,7 @@ export default function AdminUsersIndex({ users, auth, errors = {} }) { ...@@ -160,7 +160,7 @@ export default function AdminUsersIndex({ users, auth, errors = {} }) {
> >
Edit Edit
</button> </button>
{user.id !== auth.user.id && ( {user.id !== auth.id && (
<Link <Link
href={`/admin/users/${user.id}`} href={`/admin/users/${user.id}`}
method="delete" method="delete"
......
...@@ -4,7 +4,7 @@ import ComImageEdit from '../../components/images/ComImageEdit' ...@@ -4,7 +4,7 @@ import ComImageEdit from '../../components/images/ComImageEdit'
export default function Edit({ image, tags, auth, errors = {} }) { export default function Edit({ image, tags, auth, errors = {} }) {
return ( return (
<Layout user={auth.user}> <Layout user={auth}>
<Head title={`Edit ${image.title}`} /> <Head title={`Edit ${image.title}`} />
<ComImageEdit <ComImageEdit
image={image} image={image}
......
...@@ -32,7 +32,7 @@ export default function New({ auth, errors = {} }) { ...@@ -32,7 +32,7 @@ export default function New({ auth, errors = {} }) {
} }
return ( return (
<Layout user={auth.user}> <Layout user={auth}>
<Head title="上传新图片" /> <Head title="上传新图片" />
<div className="bg-white shadow overflow-hidden sm:rounded-lg"> <div className="bg-white shadow overflow-hidden sm:rounded-lg">
<div className="px-4 py-5 sm:px-6"> <div className="px-4 py-5 sm:px-6">
......
...@@ -37,7 +37,7 @@ export default function Search({ images, filters, tags, auth }) { ...@@ -37,7 +37,7 @@ export default function Search({ images, filters, tags, auth }) {
} }
return ( return (
<Layout user={auth.user}> <Layout user={auth}>
<Head title="Search Images" /> <Head title="Search Images" />
<div className="bg-white shadow overflow-hidden sm:rounded-lg"> <div className="bg-white shadow overflow-hidden sm:rounded-lg">
<div className="px-4 py-5 sm:px-6"> <div className="px-4 py-5 sm:px-6">
......
...@@ -6,8 +6,8 @@ import * as Tabs from '@radix-ui/react-tabs' ...@@ -6,8 +6,8 @@ import * as Tabs from '@radix-ui/react-tabs'
export default function ProfileShow({ auth, user_stats, errors = {} }) { export default function ProfileShow({ auth, user_stats, errors = {} }) {
const { data, setData, patch, processing, reset } = useForm({ const { data, setData, patch, processing, reset } = useForm({
name: auth.user.name || '', name: auth.name || '',
email_address: auth.user.email_address || '', email_address: auth.email_address || '',
current_password: '', current_password: '',
password: '', password: '',
password_confirmation: '', password_confirmation: '',
...@@ -23,7 +23,7 @@ export default function ProfileShow({ auth, user_stats, errors = {} }) { ...@@ -23,7 +23,7 @@ export default function ProfileShow({ auth, user_stats, errors = {} }) {
} }
return ( return (
<Layout user={auth.user}> <Layout user={auth}>
<Head title="My Profile" /> <Head title="My Profile" />
<Tabs.Root defaultValue="profile" className="bg-white shadow overflow-hidden sm:rounded-lg"> <Tabs.Root defaultValue="profile" className="bg-white shadow overflow-hidden sm:rounded-lg">
...@@ -182,7 +182,7 @@ export default function ProfileShow({ auth, user_stats, errors = {} }) { ...@@ -182,7 +182,7 @@ export default function ProfileShow({ auth, user_stats, errors = {} }) {
<div className="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6"> <div className="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
<dt className="text-sm font-medium text-gray-500">Account created</dt> <dt className="text-sm font-medium text-gray-500">Account created</dt>
<dd className="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2"> <dd className="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
{new Date(auth.user.created_at).toLocaleDateString()} {new Date(auth.created_at).toLocaleDateString()}
</dd> </dd>
</div> </div>
<div className="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6"> <div className="py-4 sm:py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
......
...@@ -28,7 +28,7 @@ export default function SessionsIndex({ auth, sessions, flash }) { ...@@ -28,7 +28,7 @@ export default function SessionsIndex({ auth, sessions, flash }) {
} }
return ( return (
<Layout user={auth.user}> <Layout user={auth}>
<Head title="Active Sessions" /> <Head title="Active Sessions" />
<div className="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8"> <div className="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">
......
...@@ -20,7 +20,7 @@ export default function SessionsSecurity({ auth, security_settings, flash }) { ...@@ -20,7 +20,7 @@ export default function SessionsSecurity({ auth, security_settings, flash }) {
} }
return ( return (
<Layout user={auth.user}> <Layout user={auth}>
<Head title="Session Security" /> <Head title="Session Security" />
<div className="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8"> <div className="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">
......
...@@ -15,7 +15,7 @@ export default function TagsEdit({ tag, auth, errors = {} }) { ...@@ -15,7 +15,7 @@ export default function TagsEdit({ tag, auth, errors = {} }) {
} }
return ( return (
<Layout user={auth.user}> <Layout user={auth}>
<Head title="Edit Tag" /> <Head title="Edit Tag" />
<div className="max-w-2xl mx-auto py-6 sm:px-6 lg:px-8"> <div className="max-w-2xl mx-auto py-6 sm:px-6 lg:px-8">
<div className="bg-white shadow overflow-hidden sm:rounded-lg"> <div className="bg-white shadow overflow-hidden sm:rounded-lg">
......
...@@ -4,7 +4,7 @@ import ComTagsIndex from '../../components/tags/ComTagsIndex' ...@@ -4,7 +4,7 @@ import ComTagsIndex from '../../components/tags/ComTagsIndex'
export default function TagsIndex({ tags, auth }) { export default function TagsIndex({ tags, auth }) {
return ( return (
<Layout user={auth.user}> <Layout user={auth}>
<Head title="Tags" /> <Head title="Tags" />
<ComTagsIndex <ComTagsIndex
title="Tags" title="Tags"
......
...@@ -15,7 +15,7 @@ export default function TagsNew({ auth, errors = {} }) { ...@@ -15,7 +15,7 @@ export default function TagsNew({ auth, errors = {} }) {
} }
return ( return (
<Layout user={auth.user}> <Layout user={auth}>
<Head title="Create New Tag" /> <Head title="Create New Tag" />
<div className="max-w-2xl mx-auto py-6 sm:px-6 lg:px-8"> <div className="max-w-2xl mx-auto py-6 sm:px-6 lg:px-8">
<div className="bg-white shadow overflow-hidden sm:rounded-lg"> <div className="bg-white shadow overflow-hidden sm:rounded-lg">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment