Skip to content

Commit 0656fd2

Browse files
committed
Remove unneeded Lucide icons
1 parent 4899632 commit 0656fd2

2 files changed

Lines changed: 17 additions & 13 deletions

File tree

docs/templates/components/account-settings.mdx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,9 @@ full: true
4242
{
4343
name: "icon",
4444
type: "React.ReactNode",
45-
description: "The icon component for the item. Only used if iconName is not provided.",
45+
description: "The icon component for the item.",
4646
optional: true
4747
},
48-
{
49-
name: "iconName",
50-
type: "string",
51-
description: "The name of the Lucide icon to be used for the item. Only used if icon is not provided.",
52-
optional: true
53-
}
5448
]
5549
}
5650
]}
@@ -67,7 +61,7 @@ export default function MyAccountPage() {
6761
fullPage={true}
6862
extraItems={[{
6963
title: 'Custom Section',
70-
iconName: "Settings",
64+
icon: <SettingsIcon />,
7165
content: <CustomContent />,
7266
subpath: '/custom',
7367
}]}

packages/template/src/components-page/account-settings.tsx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client';
22

33
import { Skeleton, Typography } from '@stackframe/stack-ui';
4-
import { icons } from 'lucide-react';
4+
import { Contact, ShieldCheck, Bell, Monitor, Key, Settings, CirclePlus } from 'lucide-react';
55
import React, { Suspense } from "react";
66
import { useStackApp, useUser } from '..';
77
import { MaybeFullPage } from "../components/elements/maybe-full-page";
@@ -17,8 +17,18 @@ import { SettingsPage } from './account-settings/settings/settings-page';
1717
import { TeamCreationPage } from './account-settings/teams/team-creation-page';
1818
import { TeamPage } from './account-settings/teams/team-page';
1919

20-
const Icon = ({ name }: { name: keyof typeof icons }) => {
21-
const LucideIcon = icons[name];
20+
const iconMap = {
21+
Contact,
22+
ShieldCheck,
23+
Bell,
24+
Monitor,
25+
Key,
26+
Settings,
27+
CirclePlus
28+
} as const;
29+
30+
const Icon = ({ name }: { name: keyof typeof iconMap }) => {
31+
const LucideIcon = iconMap[name];
2232
return <LucideIcon className="mr-2 h-4 w-4"/>;
2333
};
2434

@@ -31,7 +41,7 @@ export function AccountSettings(props: {
3141
} & ({
3242
icon?: React.ReactNode,
3343
} | {
34-
iconName?: keyof typeof icons,
44+
iconName?: keyof typeof iconMap,
3545
}))[],
3646
mockUser?: {
3747
displayName?: string,
@@ -140,7 +150,7 @@ export function AccountSettings(props: {
140150
type: 'item',
141151
id: item.id,
142152
icon: (() => {
143-
const iconName = (item as any).iconName as keyof typeof icons | undefined;
153+
const iconName = (item as any).iconName as keyof typeof iconMap | undefined;
144154
if (iconName) {
145155
return <Icon name={iconName}/>;
146156
} else if ((item as any).icon) {

0 commit comments

Comments
 (0)