refactor: Remove unused ui parts
This commit is contained in:
parent
75b1671982
commit
0d18a63956
@ -1,6 +1,4 @@
|
|||||||
import { DocumentIcon } from "@/app/components/icons/document";
|
|
||||||
import HomeIcon from "@/app/components/icons/home";
|
import HomeIcon from "@/app/components/icons/home";
|
||||||
import { UserIcon } from "@/app/components/icons/user";
|
|
||||||
import { usePathname } from "next/navigation";
|
import { usePathname } from "next/navigation";
|
||||||
import { useRef } from "react";
|
import { useRef } from "react";
|
||||||
|
|
||||||
@ -23,15 +21,9 @@ export default function navLinkPersonalVM() {
|
|||||||
// Depending on the size of the application, this would be stored in a database.
|
// Depending on the size of the application, this would be stored in a database.
|
||||||
const links = useRef<LinkItem[]>([
|
const links = useRef<LinkItem[]>([
|
||||||
{ name: "Home", href: "/dashboard", icon: HomeIcon },
|
{ name: "Home", href: "/dashboard", icon: HomeIcon },
|
||||||
{
|
|
||||||
name: "Invoices",
|
|
||||||
href: "/dashboard/invoices",
|
|
||||||
icon: DocumentIcon,
|
|
||||||
},
|
|
||||||
{ name: "Customers", href: "/dashboard/customers", icon: UserIcon },
|
|
||||||
]).current;
|
]).current;
|
||||||
return {
|
return {
|
||||||
links,
|
links,
|
||||||
isLinkActive: (link: LinkItem) => pathname === link.href,
|
isLinkActive: (link: LinkItem) => pathname.includes(link.href),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -2,27 +2,13 @@ import {
|
|||||||
LatestInvoicesSkeleton,
|
LatestInvoicesSkeleton,
|
||||||
RevenueChartSkeleton,
|
RevenueChartSkeleton,
|
||||||
} from "@/app/[lang]/dashboard/components/server/skeletons";
|
} from "@/app/[lang]/dashboard/components/server/skeletons";
|
||||||
import CardWrapper from "@/app/[lang]/dashboard/components/server/cards";
|
|
||||||
import RevenueChart from "@/app/[lang]/dashboard/components/server/revenue-chart";
|
import RevenueChart from "@/app/[lang]/dashboard/components/server/revenue-chart";
|
||||||
import { Suspense } from "react";
|
import { Suspense } from "react";
|
||||||
import { getServerTranslation, LANGS } from "@/bootstrap/i18n/i18n";
|
|
||||||
import langKey from "@/bootstrap/i18n/dictionaries/lang-key";
|
|
||||||
import LatestInvoices from "@/app/[lang]/dashboard/components/server/latest-invoices";
|
import LatestInvoices from "@/app/[lang]/dashboard/components/server/latest-invoices";
|
||||||
|
|
||||||
export default async function Dashboard(props: {
|
export default async function Dashboard() {
|
||||||
params: Promise<{ lang: LANGS }>;
|
|
||||||
}) {
|
|
||||||
const { params } = props;
|
|
||||||
const { lang } = await params;
|
|
||||||
const { t } = await getServerTranslation(lang);
|
|
||||||
return (
|
return (
|
||||||
<main>
|
<main>
|
||||||
<h1 className="mb-4 text-xl md:text-2xl">
|
|
||||||
{t(langKey.global.dashboard)}
|
|
||||||
</h1>
|
|
||||||
<div className="grid gap-6 sm:grid-cols-2 lg:grid-cols-4">
|
|
||||||
<CardWrapper />
|
|
||||||
</div>
|
|
||||||
<div className="mt-6 grid grid-cols-1 gap-6 md:grid-cols-4 lg:grid-cols-8">
|
<div className="mt-6 grid grid-cols-1 gap-6 md:grid-cols-4 lg:grid-cols-8">
|
||||||
<Suspense fallback={<RevenueChartSkeleton />}>
|
<Suspense fallback={<RevenueChartSkeleton />}>
|
||||||
<RevenueChart />
|
<RevenueChart />
|
||||||
|
@ -21,9 +21,7 @@ export default class CreateRandomInvoiceButtonVM extends BaseVM<ButtonVm> {
|
|||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
this.createInvoice = this.di.resolve(
|
this.createInvoice = this.di.resolve(createInvoiceController.name);
|
||||||
createInvoiceController.prototype.name,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
useVM(): ButtonVm {
|
useVM(): ButtonVm {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user