Commit a152fff4 by Ivan

fix: fix images

parent 5c787d05
......@@ -124,6 +124,7 @@ export default function ImageUploadForm({
id="file-upload"
name="file"
type="file"
accept="image/*"
className="sr-only"
onChange={handleFileChange}
/>
......
......@@ -5,7 +5,8 @@ import { forwardRef } from 'react';
// Convert to forwardRef to allow the IntersectionObserver to work
export const ComImageCard = forwardRef(({ image, path, showUserName = false}, ref) => {
return (
<div
<Link
href={`${path}/${image.id}`}
ref={ref}
className="bg-white overflow-hidden shadow rounded-lg flex flex-col"
>
......@@ -51,6 +52,6 @@ export const ComImageCard = forwardRef(({ image, path, showUserName = false}, re
</span>
</div>
</div>
</div>
</Link>
);
});
\ No newline at end of file
......@@ -359,7 +359,7 @@ export default function ComTagsIndex({
<button
type="submit"
disabled={editProcessing}
className="inline-flex justify-center w-full rounded-md border border-transparent shadow-sm px-4 py-2 bg-indigo-600 text-base font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:text-sm disabled:opacity-50"
className="inline-flex mb-2 justify-center w-full rounded-md border border-transparent shadow-sm px-4 py-2 bg-indigo-600 text-base font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:text-sm disabled:opacity-50"
>
更新
</button>
......
......@@ -71,7 +71,7 @@ export default function Layout({ children, user, title }) {
</DropdownMenu.Trigger>
<DropdownMenu.Portal>
<DropdownMenu.Content
className="min-w-[220px] bg-white rounded-md p-1 shadow-lg"
className="min-w-[220px] bg-white rounded-md p-1 shadow-lg z-50"
sideOffset={5}
>
<DropdownMenu.Item className="text-sm text-gray-700 px-4 py-2 rounded hover:bg-gray-100">
......
import { Head, useForm } from '@inertiajs/react'
import { Head, useForm, router } from '@inertiajs/react'
import Layout from '../../Layout'
import ImageUploadForm from '../../../components/ImageUploadForm'
......@@ -8,7 +8,7 @@ export default function AdminImagesEdit({ image, tags, auth }) {
? image.tags.map(tag => tag.id)
: []
const { data, setData, patch, processing, errors } = useForm({
const { data, setData, processing, errors } = useForm({
title: image.title || '',
status: image.status,
tag_ids: initialTagIds,
......@@ -16,7 +16,7 @@ export default function AdminImagesEdit({ image, tags, auth }) {
const handleSubmit = (e) => {
e.preventDefault()
patch(`/admin/images/${image.id}`)
router.patch(`/admin/images/${image.id}`, { image: data })
}
return (
......
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