From f7de6375210dd994e706ffd44749cde09700c7ce Mon Sep 17 00:00:00 2001
From: Manuel <30572287+manuel-rw@users.noreply.github.com>
Date: Mon, 6 Jan 2025 00:01:06 +0100
Subject: [PATCH] feat: use filled icon variants
---
.../nextjs/src/app/[locale]/manage/layout.tsx | 53 +++++++++++--------
.../src/components/layout/navigation.tsx | 9 ++--
packages/ui/index.ts | 3 +-
3 files changed, 37 insertions(+), 28 deletions(-)
diff --git a/apps/nextjs/src/app/[locale]/manage/layout.tsx b/apps/nextjs/src/app/[locale]/manage/layout.tsx
index 0613e46d6..fec8a264b 100644
--- a/apps/nextjs/src/app/[locale]/manage/layout.tsx
+++ b/apps/nextjs/src/app/[locale]/manage/layout.tsx
@@ -1,25 +1,26 @@
import type { PropsWithChildren } from "react";
import { AppShellMain } from "@mantine/core";
import {
+ IconAffiliateFilled,
IconBook2,
IconBox,
IconBrandDiscord,
IconBrandDocker,
IconBrandGithub,
+ IconBrandTablerFilled,
+ IconClipboardListFilled,
+ IconDirectionsFilled,
IconGitFork,
- IconHome,
- IconInfoSmall,
- IconLayoutDashboard,
- IconLogs,
+ IconHelpSquareRoundedFilled,
+ IconHomeFilled,
+ IconInfoSquareRoundedFilled,
+ IconLayoutDashboardFilled,
IconMailForward,
- IconPhoto,
- IconPlug,
- IconQuestionMark,
- IconReport,
+ IconPhotoFilled,
+ IconPointerFilled,
IconSearch,
- IconSettings,
- IconTool,
- IconUser,
+ IconSettingsFilled,
+ IconUserFilled,
IconUsers,
IconUsersGroup,
} from "@tabler/icons-react";
@@ -40,11 +41,11 @@ export default async function ManageLayout({ children }: PropsWithChildren) {
const navigationLinks: NavigationLink[] = [
{
label: t("items.home"),
- icon: IconHome,
+ icon: IconHomeFilled,
href: "/manage",
},
{
- icon: IconLayoutDashboard,
+ icon: IconLayoutDashboardFilled,
href: "/manage/boards",
label: t("items.boards"),
},
@@ -53,9 +54,12 @@ export default async function ManageLayout({ children }: PropsWithChildren) {
href: "/manage/apps",
label: t("items.apps"),
hidden: !session,
+ iconProps: {
+ strokeWidth: 2.5,
+ },
},
{
- icon: IconPlug,
+ icon: IconAffiliateFilled,
href: "/manage/integrations",
label: t("items.integrations"),
hidden: !session,
@@ -65,15 +69,18 @@ export default async function ManageLayout({ children }: PropsWithChildren) {
href: "/manage/search-engines",
label: t("items.searchEngies"),
hidden: !session,
+ iconProps: {
+ strokeWidth: 2.5,
+ },
},
{
- icon: IconPhoto,
+ icon: IconPhotoFilled,
href: "/manage/medias",
label: t("items.medias"),
hidden: !session,
},
{
- icon: IconUser,
+ icon: IconUserFilled,
label: t("items.users.label"),
hidden: !session?.user.permissions.includes("admin"),
items: [
@@ -97,7 +104,7 @@ export default async function ManageLayout({ children }: PropsWithChildren) {
},
{
label: t("items.tools.label"),
- icon: IconTool,
+ icon: IconPointerFilled,
// As permissions always include there children permissions, we can check other-view-logs as admin includes it
hidden: !session?.user.permissions.includes("other-view-logs"),
items: [
@@ -109,19 +116,19 @@ export default async function ManageLayout({ children }: PropsWithChildren) {
},
{
label: t("items.tools.items.api"),
- icon: IconPlug,
+ icon: IconDirectionsFilled,
href: "/manage/tools/api",
hidden: !session?.user.permissions.includes("admin"),
},
{
label: t("items.tools.items.logs"),
- icon: IconLogs,
+ icon: IconBrandTablerFilled,
href: "/manage/tools/logs",
hidden: !session?.user.permissions.includes("other-view-logs"),
},
{
label: t("items.tools.items.tasks"),
- icon: IconReport,
+ icon: IconClipboardListFilled,
href: "/manage/tools/tasks",
hidden: !session?.user.permissions.includes("admin"),
},
@@ -130,12 +137,12 @@ export default async function ManageLayout({ children }: PropsWithChildren) {
{
label: t("items.settings"),
href: "/manage/settings",
- icon: IconSettings,
+ icon: IconSettingsFilled,
hidden: !session?.user.permissions.includes("admin"),
},
{
label: t("items.help.label"),
- icon: IconQuestionMark,
+ icon: IconHelpSquareRoundedFilled,
items: [
{
label: t("items.help.items.documentation"),
@@ -165,7 +172,7 @@ export default async function ManageLayout({ children }: PropsWithChildren) {
},
{
label: t("items.about"),
- icon: IconInfoSmall,
+ icon: IconInfoSquareRoundedFilled,
href: "/manage/about",
},
];
diff --git a/apps/nextjs/src/components/layout/navigation.tsx b/apps/nextjs/src/components/layout/navigation.tsx
index 2ff624871..79a4466c3 100644
--- a/apps/nextjs/src/components/layout/navigation.tsx
+++ b/apps/nextjs/src/components/layout/navigation.tsx
@@ -1,7 +1,7 @@
import type { JSX } from "react";
import { AppShellNavbar, AppShellSection, ScrollArea } from "@mantine/core";
-import type { TablerIcon } from "@homarr/ui";
+import type { TablerIcon, TablerIconProps } from "@homarr/ui";
import type { ClientNavigationLink } from "./navigation-link";
import { CommonNavLink } from "./navigation-link";
@@ -27,8 +27,8 @@ export const MainNavigation = ({ headerSection, footerSection, links }: MainNavi
return null;
}
- const { icon: TablerIcon, ...props } = link;
- const Icon = ;
+ const { icon: TablerIcon, iconProps, ...props } = link;
+ const Icon = ;
let clientLink: ClientNavigationLink;
if ("items" in props) {
clientLink = {
@@ -38,7 +38,7 @@ export const MainNavigation = ({ headerSection, footerSection, links }: MainNavi
.map((item) => {
return {
...item,
- icon: ,
+ icon: ,
};
}),
} as ClientNavigationLink;
@@ -56,6 +56,7 @@ export const MainNavigation = ({ headerSection, footerSection, links }: MainNavi
interface CommonNavigationLinkProps {
label: string;
icon: TablerIcon;
+ iconProps?: TablerIconProps;
hidden?: boolean;
}
diff --git a/packages/ui/index.ts b/packages/ui/index.ts
index 5b2133dba..42b81d757 100644
--- a/packages/ui/index.ts
+++ b/packages/ui/index.ts
@@ -1,5 +1,6 @@
-import type { Icon123 } from "@tabler/icons-react";
+import type { Icon123, IconProps } from "@tabler/icons-react";
export * from "./src";
export type TablerIcon = typeof Icon123;
+export type TablerIconProps = IconProps;