From ee31eb551110e884651aa866e941c836d01b2730 Mon Sep 17 00:00:00 2001 From: Ruben Date: Fri, 4 Apr 2025 18:15:58 +0100 Subject: [PATCH] style: organizations and stuffs --- src/app/admin/home/page.tsx | 2 +- src/app/admin/organizations/page.tsx | 161 +++++++++++++------------- src/app/globals.css | 17 ++- src/assets/css/admin.css | 25 +++- src/components/admin/sidebar.tsx | 2 +- src/components/admin/theme.tsx | 6 +- src/components/floatingLabelInput.tsx | 4 +- src/components/table/table.tsx | 6 +- 8 files changed, 125 insertions(+), 98 deletions(-) diff --git a/src/app/admin/home/page.tsx b/src/app/admin/home/page.tsx index c5a9149..3a84f65 100644 --- a/src/app/admin/home/page.tsx +++ b/src/app/admin/home/page.tsx @@ -192,7 +192,7 @@ export default function HomePage() { ] return ( -
+

Dernières organisations actives

diff --git a/src/app/admin/organizations/page.tsx b/src/app/admin/organizations/page.tsx index 4f273d3..b359c0a 100644 --- a/src/app/admin/organizations/page.tsx +++ b/src/app/admin/organizations/page.tsx @@ -170,12 +170,12 @@ export default function Organizations() { cell: ({ row }) => { const value = String(row.original.owner.first_name) + " " + String(row.original.owner.last_name) const initials = String(row.original.owner.first_name[0]) + String(row.original.owner.last_name[0]) - return( -
-
+ return ( +
+
{initials}
-

{value}

+

{value}

) } @@ -191,22 +191,21 @@ export default function Organizations() { const status = String(cell.getValue()) return (

{ - status === "active" ? "Actif" : - status === "inactive" ? "Inactif" : - status === "pending" ? "En attente" : - status === "blocked" ? "Bloquée" : - "" + status === "active" ? "Actif" : + status === "inactive" ? "Inactif" : + status === "pending" ? "En attente" : + status === "blocked" ? "Bloquée" : + "" }

) @@ -216,64 +215,64 @@ export default function Organizations() { id: "delete", cell: ({ row }) => { const company = row.original; - return ( -
{ mutate(id) }} - > + return ( +
{ mutate(id) }} + > - {/* Modal de suppression */} - { - if (!isOpen) { - setSelectedAdminId(null); - setOpenDeleteModal(false); - } + {/* Modal de suppression */} + { + if (!isOpen) { + setSelectedAdminId(null); + setOpenDeleteModal(false); + } + }} + trigger={ +
{ + setSelectedAdminId(company.id); + setOpenDeleteModal(true); }} - trigger={ -
+ Supprimer +
+ } + title="Supprimer une organisation" + content={ +
+

+ Voulez-vous vraiment supprimer l'organisation {row.original.name} ? +

+ +
+
- } - title="Supprimer une organisation" - content={ -
-

- Voulez-vous vraiment supprimer l'organisation {row.original.name} ? -

- -
- - -
-
- } - /> -
- ) + Annuler + + +
+
+ } + /> +
+ ) } } ] @@ -291,8 +290,8 @@ export default function Organizations() { .map((row) => row.original.id); return ( -
-
+
+
-

+ @@ -328,7 +327,7 @@ export default function Organizations() {

-
+
{/* Modal d'ajout */} - +
} /> diff --git a/src/app/globals.css b/src/app/globals.css index e50f67b..e67c59e 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -20,8 +20,9 @@ [ data-theme="dark"] { --background: #11111a; --foreground: #eeeeff; - --cinder: #999; - --bluegray: #eeeeff; + /* --secondary: #000; */ + --cinder: #444; + --bluegray: #246BFD55; } /* @media (prefers-color-scheme: dark) { @@ -53,7 +54,8 @@ a{ padding: 12px; border: 1px solid #d1d5dc; border-radius: 9999px; - color: black; + color: var(--foreground); + background-color: var(--background); &:focus { outline-color: none; @@ -84,6 +86,12 @@ a{ transform: translateY(-50%); } + +.btn-floating-right.select{ + position: relative!important; + right: 0px!important; +} + .btn-floating-left { position: absolute; left: 8px; @@ -221,7 +229,8 @@ input[type="checkbox"]:checked::before { display: flex; justify-content: center; align-items: center; - background-color: var(--bluegray); + color: #04060F; + background-color: #E9F0FF; z-index: 99; } .splash-screen p{ diff --git a/src/assets/css/admin.css b/src/assets/css/admin.css index 8f91ddb..2c72e31 100644 --- a/src/assets/css/admin.css +++ b/src/assets/css/admin.css @@ -181,11 +181,11 @@ th{ padding: 8px; height: 40px!important; } -th.bg-bluegray:first-of-type{ +th:first-of-type{ border-top-left-radius: 8px!important; } -th.bg-bluegray:last-of-type{ +th:last-of-type{ border-top-right-radius: 8px!important; } @@ -196,7 +196,7 @@ tbody tr { border-bottom: 1px solid var(--bluegray)!important; } tbody tr:hover{ - background-color: var(--cinder); + background-color: var(--bluegray); } tbody tr td:first-child { padding-left: 16px; @@ -249,6 +249,25 @@ a.disabled{ opacity: 40%; } +.home .pagination { + display: none!important; +} + + +.search-input{ + padding: 10px 40px; + width: max-content; + width: 300px; + min-width: max-content; + border: 1px solid var(--secondary); + border-radius: 100px; +} + + + + + + @media (max-width: 1070px) { .stats-container{ diff --git a/src/components/admin/sidebar.tsx b/src/components/admin/sidebar.tsx index 92eaf75..102747c 100644 --- a/src/components/admin/sidebar.tsx +++ b/src/components/admin/sidebar.tsx @@ -39,7 +39,7 @@ export default function Sidebar() {
handleMobileVisible()} className={`${mobileVisible ? "shifted" : ""} hamburger mobile`}> {/* Logo */} - +
diff --git a/src/components/admin/theme.tsx b/src/components/admin/theme.tsx index ea429c4..3438a95 100644 --- a/src/components/admin/theme.tsx +++ b/src/components/admin/theme.tsx @@ -8,7 +8,7 @@ export default function Theme() { useEffect(() => { if (typeof window !== "undefined") { - const savedTheme = localStorage.getItem("theme") || + const savedTheme = localStorage.getItem("privateDocsTheme") || (window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"); setTheme(savedTheme); @@ -19,7 +19,7 @@ export default function Theme() { const handleTheme = () => { const newTheme = theme === "light" ? "dark" : "light"; setTheme(newTheme); - localStorage.setItem("theme", newTheme); + localStorage.setItem("privateDocsTheme", newTheme); document.body.setAttribute("data-theme", newTheme); }; @@ -30,7 +30,7 @@ export default function Theme() { const handleChange = (e: MediaQueryListEvent) => { const newTheme = e.matches ? "dark" : "light"; setTheme(newTheme); - localStorage.setItem("theme", newTheme); + localStorage.setItem("privateDocsTheme", newTheme); document.body.setAttribute("data-theme", newTheme); }; diff --git a/src/components/floatingLabelInput.tsx b/src/components/floatingLabelInput.tsx index 37499f8..7cf0603 100644 --- a/src/components/floatingLabelInput.tsx +++ b/src/components/floatingLabelInput.tsx @@ -40,7 +40,7 @@ export default function FloatingLabelInput({ ))} - {button &&
{button}
} + {button &&
{button}
}
); @@ -91,7 +91,7 @@ export default function FloatingLabelInput({ ({
{render()} -
+
@@ -170,7 +170,7 @@ export default function Table({ -
+