style: closest to pixel-perfect
This commit is contained in:
parent
e56b346c8b
commit
015094e9c5
@ -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 responsive-icon"
|
className="cursor-pointer responsive-icon mr-1"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@ -227,13 +227,15 @@ export default function Admins() {
|
|||||||
submit={updateMutation.mutate}
|
submit={updateMutation.mutate}
|
||||||
schema={adminSchema}
|
schema={adminSchema}
|
||||||
child={
|
child={
|
||||||
<button
|
<div className="flex justify-center">
|
||||||
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={updateMutation.isPending}
|
disabled={updateMutation.isPending}
|
||||||
className={`${updateMutation.isPending ? "btn-auth-loading" : "btn-auth"} mt-4 cursor-pointer`}
|
className={`${updateMutation.isPending ? "btn-auth-loading" : "btn-auth"} cta modal-cta mt-4 cursor-pointer`}
|
||||||
>
|
>
|
||||||
{updateMutation.isPending ? "En cours..." : "Modifier"}
|
{updateMutation.isPending ? "En cours..." : "Modifier"}
|
||||||
</button>
|
</button>
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
@ -321,8 +323,9 @@ export default function Admins() {
|
|||||||
|
|
||||||
<DropdownMenu.Root>
|
<DropdownMenu.Root>
|
||||||
<DropdownMenu.Trigger asChild>
|
<DropdownMenu.Trigger asChild>
|
||||||
<p className="cursor-pointer rounded-full bg-gray-300 text-gray-500 p-2">
|
<p className="cta cancel flex gap-2">
|
||||||
Sélectionner une action
|
Sélectionner une action
|
||||||
|
<Image src={icons.arrowDown} alt="arrow down" />
|
||||||
</p>
|
</p>
|
||||||
</DropdownMenu.Trigger>
|
</DropdownMenu.Trigger>
|
||||||
|
|
||||||
@ -355,7 +358,7 @@ export default function Admins() {
|
|||||||
trigger={
|
trigger={
|
||||||
<div
|
<div
|
||||||
onClick={() => setOpenModal(true)}
|
onClick={() => setOpenModal(true)}
|
||||||
className="cursor-pointer p-3 bg-blue-600 text-white rounded-full"
|
className="cta"
|
||||||
>
|
>
|
||||||
Ajouter un admin
|
Ajouter un admin
|
||||||
</div>
|
</div>
|
||||||
@ -385,13 +388,15 @@ export default function Admins() {
|
|||||||
submit={createMutation.mutate}
|
submit={createMutation.mutate}
|
||||||
schema={adminSchema}
|
schema={adminSchema}
|
||||||
child={
|
child={
|
||||||
|
<div className="flex justify-center">
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={createMutation.isPending}
|
disabled={createMutation.isPending}
|
||||||
className={`${createMutation.isPending ? "btn-auth-loading" : "btn-auth"} mt-4 cursor-pointer`}
|
className={`${createMutation.isPending ? "btn-auth-loading" : "btn-auth"} cta modal-cta mt-4 cursor-pointer`}
|
||||||
>
|
>
|
||||||
{createMutation.isPending ? "Création de l'admin..." : "Créer le compte"}
|
{createMutation.isPending ? "Création de l'admin..." : "Créer le compte"}
|
||||||
</button>
|
</button>
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|||||||
@ -161,12 +161,12 @@ export default function HomePage () {
|
|||||||
content={
|
content={
|
||||||
<div>
|
<div>
|
||||||
<p className="text-center">
|
<p className="text-center">
|
||||||
Voulez-vous vraiment supprimer cette organisation ?
|
Voulez-vous vraiment supprimer l'organisation <span className="font-bold">{row.original.name}</span> ?
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div className="grid grid-cols-2 gap-3 mt-3">
|
<div className="flex justify-between w-full pt-6 r-gap-24">
|
||||||
<button
|
<button
|
||||||
className="bg-blue-100 text-blue-600 py-2 px-4 text-lg rounded-full text-center hover:bg-blue-200"
|
className="cta modal-cta cancel"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setSelectedId(null);
|
setSelectedId(null);
|
||||||
}}
|
}}
|
||||||
@ -174,7 +174,7 @@ export default function HomePage () {
|
|||||||
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="cta modal-cta danger"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
mutate(id);
|
mutate(id);
|
||||||
setSelectedId(null);
|
setSelectedId(null);
|
||||||
|
|||||||
@ -118,7 +118,7 @@ export default function Profile() {
|
|||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
<div className="r-flex p-[32px] r-gap-24">
|
<div className="r-flex p-[32px] r-gap-24">
|
||||||
<div className="admin-infos r-flex flex-wrap justifyc-center lg:justifyc-start ">
|
<div className="admin-infos r-flex flex-wrap justifyy-center lg:justifyy-start ">
|
||||||
<div className="r-flex-between items-center w-max">
|
<div className="r-flex-between items-center w-max">
|
||||||
<div className="icon-rounded">
|
<div className="icon-rounded">
|
||||||
<Image src={icons.userGroupBlue} alt="Documents" />
|
<Image src={icons.userGroupBlue} alt="Documents" />
|
||||||
|
|||||||
@ -16,6 +16,7 @@ import { companySchema } from "#/schema";
|
|||||||
import { Admin, Company } from "#/types";
|
import { Admin, Company } from "#/types";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
|
||||||
|
|
||||||
export default function Organizations() {
|
export default function Organizations() {
|
||||||
const { data: session, status } = useSession();
|
const { data: session, status } = useSession();
|
||||||
const [openModal, setOpenModal] = useState(false);
|
const [openModal, setOpenModal] = useState(false);
|
||||||
@ -192,10 +193,10 @@ export default function Organizations() {
|
|||||||
<p
|
<p
|
||||||
className={`rounded-full px-2 py-1 font-medium text-sm w-20 h-6 text-center
|
className={`rounded-full px-2 py-1 font-medium text-sm w-20 h-6 text-center
|
||||||
${
|
${
|
||||||
status === "active" ? "bg-[#ECF9E8] text-[#49C91E]" :
|
status === "active" ? "font-medium w-[80px] h-[24px] bg-[#ECF9E8] text-[#49C91E]" :
|
||||||
status === "inactive" ? "bg-[#E7EBF3] text-[#9FA8BC]" :
|
status === "inactive" ? "font-medium w-[80px] h-[24px] bg-[#E7EBF3] text-[#9FA8BC]" :
|
||||||
status === "pending" ? "bg-[#EAF7FC] text-[#30B2EA]" :
|
status === "pending" ? "font-medium w-[80px] h-[24px] bg-[#EAF7FC] text-[#30B2EA]" :
|
||||||
status === "blocked" ? "bg-[#FDEBE8] text-[#F33F19]" :
|
status === "blocked" ? "font-medium w-[80px] h-[24px] bg-[#FDEBE8] text-[#F33F19]" :
|
||||||
""
|
""
|
||||||
}
|
}
|
||||||
`}
|
`}
|
||||||
@ -246,19 +247,22 @@ export default function Organizations() {
|
|||||||
title="Supprimer une organisation"
|
title="Supprimer une organisation"
|
||||||
content={
|
content={
|
||||||
<div>
|
<div>
|
||||||
<p className="text-center">Voulez-vous vraiment supprimer cette organisation ?</p>
|
<p className="text-center">
|
||||||
<div className="grid grid-cols-2 gap-3 mt-3">
|
Voulez-vous vraiment supprimer l'organisation <span className="font-bold">{row.original.name}</span> ?
|
||||||
<button
|
</p>
|
||||||
className="bg-blue-100 text-blue-600 py-2 px-4 rounded-full cursor-pointer"
|
|
||||||
onClick={() => {
|
<div className="flex justify-between w-full pt-6 r-gap-24">
|
||||||
|
<button
|
||||||
|
className="cta modal-cta cancel"
|
||||||
|
onClick={() => {
|
||||||
setOpenDeleteModal(false);
|
setOpenDeleteModal(false);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Annuler
|
Annuler
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
className="bg-red-500 text-white py-2 px-4 rounded-full hover:bg-red-600 cursor-pointer"
|
className="cta modal-cta danger"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
deleteMutation.mutate(company.id);
|
deleteMutation.mutate(company.id);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -302,15 +306,16 @@ export default function Organizations() {
|
|||||||
|
|
||||||
<DropdownMenu.Root>
|
<DropdownMenu.Root>
|
||||||
<DropdownMenu.Trigger asChild>
|
<DropdownMenu.Trigger asChild>
|
||||||
<p className="cursor-pointer rounded-full bg-gray-300 text-gray-500 p-2">
|
<p className="cta cancel flex gap-2">
|
||||||
Sélectionner une action
|
Sélectionner une action
|
||||||
|
<Image src={icons.arrowDown} alt="arrow down" />
|
||||||
</p>
|
</p>
|
||||||
</DropdownMenu.Trigger>
|
</DropdownMenu.Trigger>
|
||||||
|
|
||||||
<DropdownMenu.Portal>
|
<DropdownMenu.Portal>
|
||||||
<DropdownMenu.Content
|
<DropdownMenu.Content
|
||||||
className="min-w-[150px] shadow-sm bg-white rounded-md p-1"
|
className="min-w-[150px] shadow-sm bg-white rounded-md p-1 w-full"
|
||||||
sideOffset={5}
|
sideOffset={0} side="bottom" align="end"
|
||||||
>
|
>
|
||||||
<DropdownMenu.Item
|
<DropdownMenu.Item
|
||||||
onClick={() => bulkDeleteMutation.mutate(selectedIds)}
|
onClick={() => bulkDeleteMutation.mutate(selectedIds)}
|
||||||
@ -336,7 +341,7 @@ export default function Organizations() {
|
|||||||
trigger={
|
trigger={
|
||||||
<div
|
<div
|
||||||
onClick={() => setOpenModal(true)}
|
onClick={() => setOpenModal(true)}
|
||||||
className="cursor-pointer p-3 bg-blue-600 text-white rounded-full"
|
className="cta"
|
||||||
>
|
>
|
||||||
Ajouter une organisation
|
Ajouter une organisation
|
||||||
</div>
|
</div>
|
||||||
@ -380,13 +385,15 @@ export default function Organizations() {
|
|||||||
submit={createMutation.mutate} // Le type est maintenant compatible
|
submit={createMutation.mutate} // Le type est maintenant compatible
|
||||||
schema={companySchema}
|
schema={companySchema}
|
||||||
child={
|
child={
|
||||||
|
<div className="flex justify-center">
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={createMutation.isPending}
|
disabled={createMutation.isPending}
|
||||||
className={`${createMutation.isPending ? "btn-auth-loading" : "btn-auth"} mt-4 cursor-pointer`}
|
className={`${createMutation.isPending ? "btn-auth-loading" : "btn-auth"} cta modal-cta mt-4 cursor-pointer`}
|
||||||
>
|
>
|
||||||
{createMutation.isPending ? "En cours..." : "Créer l'organisation"}
|
{createMutation.isPending ? "En cours..." : "Ajouter une organisation"}
|
||||||
</button>
|
</button>
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|||||||
@ -102,6 +102,8 @@ body {
|
|||||||
|
|
||||||
.cta{
|
.cta{
|
||||||
padding: 10px 24px;
|
padding: 10px 24px;
|
||||||
|
width: max-content;
|
||||||
|
height: max-content;
|
||||||
color: white;
|
color: white;
|
||||||
background-color: var(--primary);
|
background-color: var(--primary);
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
@ -109,6 +111,12 @@ body {
|
|||||||
border: 1px solid var(--primary);
|
border: 1px solid var(--primary);
|
||||||
border-radius: 100px;
|
border-radius: 100px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
text-wrap: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cta.modal-cta{
|
||||||
|
width: 240px;
|
||||||
|
height: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cta.cancel{
|
.cta.cancel{
|
||||||
@ -138,6 +146,42 @@ hr{
|
|||||||
color: var(--gray);
|
color: var(--gray);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input[type="checkbox"] {
|
||||||
|
appearance: none;
|
||||||
|
-webkit-appearance: none;
|
||||||
|
-moz-appearance: none;
|
||||||
|
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
border: 1px solid var(--secondary) !important;
|
||||||
|
border-radius: 6px !important;
|
||||||
|
background-color: transparent;
|
||||||
|
cursor: pointer;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
input[type="checkbox"]:checked {
|
||||||
|
background-color: var(--primary);
|
||||||
|
border-color: var(--primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
input[type="checkbox"]:checked::before {
|
||||||
|
content: "✔";
|
||||||
|
font-size: 18px;
|
||||||
|
color: white;
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-input{
|
||||||
|
width: 490px;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Scroll Bar */
|
/* Scroll Bar */
|
||||||
|
|||||||
3
src/assets/icons/chevron-down.svg
Normal file
3
src/assets/icons/chevron-down.svg
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<svg width="10" height="6" viewBox="0 0 10 6" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M1 1L5 5L9 1" stroke="#9FA8BC" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 207 B |
@ -42,6 +42,7 @@ import moonIcon from "./moon.svg"
|
|||||||
import trash from "./trash.svg"
|
import trash from "./trash.svg"
|
||||||
import mailIcon from "./sms.svg"
|
import mailIcon from "./sms.svg"
|
||||||
import personalCard from "./personalcard.svg"
|
import personalCard from "./personalcard.svg"
|
||||||
|
import arrowDown from "#/assets/icons/chevron-down.svg"
|
||||||
|
|
||||||
|
|
||||||
export const icons = {
|
export const icons = {
|
||||||
@ -88,7 +89,9 @@ export const icons = {
|
|||||||
moonIcon,
|
moonIcon,
|
||||||
trash,
|
trash,
|
||||||
mailIcon,
|
mailIcon,
|
||||||
personalCard
|
personalCard,
|
||||||
|
arrowDown
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@ export default function FloatingLabelInput({
|
|||||||
return (
|
return (
|
||||||
<div className="relative w-full">
|
<div className="relative w-full">
|
||||||
<select
|
<select
|
||||||
className="input-form focus:ring-2 focus:ring-blue-500 outline-none"
|
className="input-form modal-input focus:ring-2 focus:ring-blue-500 outline-none"
|
||||||
name={name}
|
name={name}
|
||||||
defaultValue={defaultValue}
|
defaultValue={defaultValue}
|
||||||
>
|
>
|
||||||
@ -91,12 +91,12 @@ export default function FloatingLabelInput({
|
|||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
className="focus:ring-2 focus:ring-blue-500 outline-none px-10 py-3 w-full text-black border border-[#d1d5dc] rounded-full"
|
className="focus:ring-2 focus:ring-blue-500 outline-none px-10 py-2 w-full text-black border border-[#d1d5dc] rounded-full"
|
||||||
name={name}
|
name={name}
|
||||||
defaultValue={defaultValue}
|
defaultValue={defaultValue}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
/>
|
/>
|
||||||
{button && <div className="btn-floating-right">{button}</div>}
|
{button && <div className="btn-floating-right mr-1 ">{button}</div>}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ export default function FloatingLabelInput({
|
|||||||
<input
|
<input
|
||||||
type={type}
|
type={type}
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
className="input-form focus:ring-2 focus:ring-blue-500 outline-none"
|
className="input-form modal-input focus:ring-2 focus:ring-blue-500 outline-none"
|
||||||
name={name}
|
name={name}
|
||||||
defaultValue={defaultValue}
|
defaultValue={defaultValue}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
import * as Dialog from "@radix-ui/react-dialog";
|
import * as Dialog from "@radix-ui/react-dialog";
|
||||||
import { ReactNode } from "react";
|
import { ReactNode } from "react";
|
||||||
|
import { icons } from "#/assets/icons"
|
||||||
|
import Image from "next/image";
|
||||||
|
|
||||||
export function Modal({
|
export function Modal({
|
||||||
trigger,
|
trigger,
|
||||||
@ -21,21 +23,21 @@ export function Modal({
|
|||||||
</Dialog.Trigger>
|
</Dialog.Trigger>
|
||||||
<Dialog.Portal>
|
<Dialog.Portal>
|
||||||
<Dialog.Overlay className="fixed inset-0 bg-black/25 z-40" />
|
<Dialog.Overlay className="fixed inset-0 bg-black/25 z-40" />
|
||||||
<Dialog.Content className="fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-full max-w-md bg-white rounded-lg shadow-xl z-50 p-6"
|
<Dialog.Content className="fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-max flex flex-col gap-10 bg-white rounded-lg shadow-xl z-50 px-16 py-12"
|
||||||
// onPointerDownOutside={(e) => e.preventDefault()}
|
// onPointerDownOutside={(e) => e.preventDefault()}
|
||||||
>
|
>
|
||||||
<Dialog.Title className="text-xl font-bold text-center my-4">
|
<Dialog.Title className="text-xl font-bold text-center text-[30px] ">
|
||||||
{title}
|
{title}
|
||||||
</Dialog.Title>
|
</Dialog.Title>
|
||||||
|
|
||||||
<div className=" justify-center">
|
<div className="flex gap-5 justify-center">
|
||||||
{content}
|
{content}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="absolute top-4 right-4 text-gray-500 hover:text-gray-700 cursor-pointer"
|
<div className="absolute top-5 right-5 text-gray-500 hover:text-gray-700 cursor-pointer"
|
||||||
onClick={() => {onOpenChange?.(false)}}
|
onClick={() => {onOpenChange?.(false)}}
|
||||||
>
|
>
|
||||||
X
|
<Image src={icons.crossIcon} alt="fermer"/>
|
||||||
</div>
|
</div>
|
||||||
</Dialog.Content>
|
</Dialog.Content>
|
||||||
</Dialog.Portal>
|
</Dialog.Portal>
|
||||||
|
|||||||
@ -177,7 +177,7 @@ export default function Table<TData, TValue>({
|
|||||||
|
|
||||||
<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
|
||||||
className="bg-gray-100 shadow-xs hover:bg-gray-300 px-3 py-1 rounded w-9 h-9"
|
className="hover:bg-gray-300 cursor-pointer px-3 py-1 rounded w-9 h-9"
|
||||||
onClick={() => table.previousPage()}
|
onClick={() => table.previousPage()}
|
||||||
disabled={!table.getCanPreviousPage()}
|
disabled={!table.getCanPreviousPage()}
|
||||||
>
|
>
|
||||||
@ -192,7 +192,7 @@ export default function Table<TData, TValue>({
|
|||||||
"px-3 py-1 rounded w-9 h-9",
|
"px-3 py-1 rounded w-9 h-9",
|
||||||
pageNumber === currentPage
|
pageNumber === currentPage
|
||||||
? "bg-[#E9F0FF] text-blue-400"
|
? "bg-[#E9F0FF] text-blue-400"
|
||||||
: "bg-gray-100 hover:bg-gray-300"
|
: "hover:bg-gray-300 cursor-pointer"
|
||||||
)}
|
)}
|
||||||
onClick={() => table.setPageIndex(pageNumber - 1)}
|
onClick={() => table.setPageIndex(pageNumber - 1)}
|
||||||
>
|
>
|
||||||
@ -202,7 +202,7 @@ export default function Table<TData, TValue>({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
className="w-9 h-9 bg-gray-100 shadow-xs hover:bg-gray-300 hover:text-black px-3 py-1 rounded"
|
className="w-9 h-9 hover:bg-gray-300 cursor-pointer hover:text-black px-3 py-1 rounded"
|
||||||
onClick={() => table.nextPage()}
|
onClick={() => table.nextPage()}
|
||||||
disabled={!table.getCanNextPage()}
|
disabled={!table.getCanNextPage()}
|
||||||
>
|
>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user