feat: add responsive icon class for better image scaling in admin pages
This commit is contained in:
parent
ca8d95f3a3
commit
58f065598f
@ -193,7 +193,7 @@ export default function Admins() {
|
|||||||
width={24}
|
width={24}
|
||||||
height={24}
|
height={24}
|
||||||
src={icons.editIcon}
|
src={icons.editIcon}
|
||||||
className="cursor-pointer"
|
className="cursor-pointer responsive-icon"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@ -258,7 +258,7 @@ export default function Admins() {
|
|||||||
<Image
|
<Image
|
||||||
alt="Supprimer"
|
alt="Supprimer"
|
||||||
src={icons.trash}
|
src={icons.trash}
|
||||||
className="cursor-pointer"
|
className="cursor-pointer responsive-icon"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,6 +17,7 @@ export default function HomePage () {
|
|||||||
const {data: session, status} = useSession()
|
const {data: session, status} = useSession()
|
||||||
const queryClient = useQueryClient()
|
const queryClient = useQueryClient()
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
|
const [selectedId, setSelectedId] = useState<string | null>(null);
|
||||||
|
|
||||||
console.log("Session = ", session)
|
console.log("Session = ", session)
|
||||||
|
|
||||||
@ -128,43 +129,55 @@ export default function HomePage () {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "delete",
|
id: "delete",
|
||||||
cell: ({ cell }) => {
|
cell: ({ row }) => {
|
||||||
const id = String(cell.row.original.id)
|
const id = String(row.original.id);
|
||||||
return (
|
return (
|
||||||
<div className="relative p-2 cursor-pointer"
|
<div className="relative p-2 cursor-pointer">
|
||||||
// onClick={() => { mutate(id) }}
|
|
||||||
>
|
|
||||||
<Modal
|
<Modal
|
||||||
open={open}
|
open={selectedId === id}
|
||||||
onOpenChange={(isOpen) => {
|
onOpenChange={(isOpen) => {
|
||||||
if (!isOpen) {
|
if (!isOpen) {
|
||||||
setOpen(isOpen)
|
setSelectedId(null);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
trigger={
|
trigger={
|
||||||
<div onClick={() => setOpen(true)}>
|
<div
|
||||||
<Image alt="" src={icons.trash} className="absolute right-2 top-[-50%] transform translate-middle-y hover:text-blue-500" />
|
onClick={() => {
|
||||||
|
setSelectedId(id);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Image
|
||||||
|
alt=""
|
||||||
|
src={icons.trash}
|
||||||
|
className="cursor-pointer responsive-icon"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
title={
|
title={
|
||||||
<p className="font-bold text-3xl">Supprimer une organisation</p>
|
<p className="font-bold text-3xl">
|
||||||
|
Supprimer cette organisation
|
||||||
|
</p>
|
||||||
}
|
}
|
||||||
content={
|
content={
|
||||||
<div>
|
<div>
|
||||||
<p className="text-center">Voulez-vous vraiment supprimer cette organisation ?</p>
|
<p className="text-center">
|
||||||
|
Voulez-vous vraiment supprimer cette organisation ?
|
||||||
|
</p>
|
||||||
|
|
||||||
<div className="grid grid-cols-2 gap-3 mt-3">
|
<div className="grid grid-cols-2 gap-3 mt-3">
|
||||||
<button
|
<button
|
||||||
className="bg-blue-100 text-blue-600 py-2 px-4 text-lg rounded-full text-center hover:bg-blue-200"
|
className="bg-blue-100 text-blue-600 py-2 px-4 text-lg rounded-full text-center hover:bg-blue-200"
|
||||||
onClick={() => { setOpen(false) }}
|
onClick={() => {
|
||||||
|
setSelectedId(null);
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
Annuler
|
Annuler
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
className="bg-red-500 text-white py-2 px-4 text-lg rounded-full text-center hover:bg-red-600"
|
className="bg-red-500 text-white py-2 px-4 text-lg rounded-full text-center hover:bg-red-600"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
mutate(id)
|
mutate(id);
|
||||||
setOpen(false)
|
setSelectedId(null);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Supprimer
|
Supprimer
|
||||||
@ -174,9 +187,9 @@ export default function HomePage () {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
return(
|
return(
|
||||||
|
|||||||
@ -99,10 +99,11 @@ export default function Table<TData, TValue>({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<div>
|
<div className="w-full">
|
||||||
{render()}
|
{render()}
|
||||||
|
|
||||||
<div className="rounded-lg border border-gray-200 w-auto">
|
<div className="rounded-lg border border-gray-200 w-auto">
|
||||||
|
<div className="overflow-x-auto">
|
||||||
<table className="w-full overflow-x-auto rounded-lg">
|
<table className="w-full overflow-x-auto rounded-lg">
|
||||||
<thead className="h-10">
|
<thead className="h-10">
|
||||||
{table.getHeaderGroups().map((headerGroup) => (
|
{table.getHeaderGroups().map((headerGroup) => (
|
||||||
@ -172,6 +173,7 @@ export default function Table<TData, TValue>({
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center justify-end space-x-2 py-4">
|
<div className="flex items-center justify-end space-x-2 py-4">
|
||||||
<button
|
<button
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user