-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: refactor to use lucide icons dynamically
- Loading branch information
1 parent
51e3f47
commit a581936
Showing
15 changed files
with
64 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ const nextConfig = { | |
}, | ||
], | ||
}, | ||
transpilePackages: ["lucide-react"], | ||
}; | ||
|
||
export default nextConfig; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/app/dashboard/(user-dashboard)/(user-metrics)/analytics/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export default function DashboardAnalytics() { | ||
return <div>REPORTS</div>; | ||
return <div>ANALYTICS</div>; | ||
} |
12 changes: 7 additions & 5 deletions
12
src/app/dashboard/(user-dashboard)/_components/overview-revenue/revenueData.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,35 @@ | ||
import type { LucideIconName } from "~/components/common/lucide-icon"; | ||
|
||
type CardData = { | ||
title: string; | ||
value: string; | ||
description: string; | ||
icon: string; | ||
icon: LucideIconName; | ||
}; | ||
|
||
export const revenueData: CardData[] = [ | ||
{ | ||
title: "Total Revenue", | ||
value: "$45,000.00", | ||
description: "+20% from last month", | ||
icon: `/admin-dashboard/icons/dollarSign.svg`, | ||
icon: "dollar-sign", | ||
}, | ||
{ | ||
title: "Subscriptions", | ||
value: "+2,350", | ||
description: "+150% from last month", | ||
icon: `/admin-dashboard/icons/userGroup.svg`, | ||
icon: "users", | ||
}, | ||
{ | ||
title: "Sales", | ||
value: "15,000", | ||
description: "+10% from last month", | ||
icon: `/admin-dashboard/icons/creditCard.svg`, | ||
icon: "credit-card", | ||
}, | ||
{ | ||
title: "Active Now", | ||
value: "574", | ||
description: "+201 since last hour", | ||
icon: `/admin-dashboard/icons/arrowRise.svg`, | ||
icon: "trending-up", | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,35 @@ | ||
import type { LucideIconName } from "~/components/common/lucide-icon"; | ||
|
||
type CardData = { | ||
title: string; | ||
value: string; | ||
description: string; | ||
icon: string; | ||
icon: LucideIconName; | ||
}; | ||
|
||
export const cardData: CardData[] = [ | ||
{ | ||
title: "Total Revenue", | ||
value: "$45,000.00", | ||
description: "+20% from last month", | ||
icon: `/admin-dashboard/icons/dollarSign.svg`, | ||
icon: "dollar-sign", | ||
}, | ||
{ | ||
title: "Total Users", | ||
value: "+4,000", | ||
description: "+10% from last month", | ||
icon: `/admin-dashboard/icons/user.svg`, | ||
icon: "user", | ||
}, | ||
{ | ||
title: "Total Products", | ||
value: "1,000", | ||
description: "+20% from last month", | ||
icon: `/admin-dashboard/icons/box.svg`, | ||
icon: "box", | ||
}, | ||
{ | ||
title: "Lifetime Sales", | ||
value: "$450,000.00", | ||
description: "+150% from last month", | ||
icon: `/admin-dashboard/icons/arrowUp.svg`, | ||
icon: "arrow-up-right", | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { LucideProps } from "lucide-react"; | ||
import dynamicIconImports from "lucide-react/dynamicIconImports"; | ||
import dynamic from "next/dynamic"; | ||
|
||
interface ILucideIcon { | ||
name: keyof typeof dynamicIconImports; | ||
} | ||
|
||
export type LucideIconName = ILucideIcon["name"]; | ||
|
||
interface IconProperties extends Omit<LucideProps, "name">, ILucideIcon {} | ||
|
||
const Icon = ({ name, ...properties }: IconProperties) => { | ||
const LucideIcon = dynamic(dynamicIconImports[name]); | ||
|
||
return <LucideIcon {...properties} />; | ||
}; | ||
|
||
export default Icon; |