Skip to content

Commit

Permalink
feat: ✨ ensure dashboard get actual month to display data
Browse files Browse the repository at this point in the history
  • Loading branch information
neopromic committed Nov 13, 2024
1 parent 2220b45 commit 5f7fe91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/(authenticated)/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const Home = async ({ searchParams: { month = "1" } }: HomeProps) => {
const isValidMonth = monthNumber >= 1 && monthNumber <= 12;

if (!isValidMonth) {
redirect("/dashboard?month=1");
redirect(`/dashboard?month=${new Date().getMonth() + 1}`);
}

const dashboard = await GetDashboard(monthNumber);
Expand Down
4 changes: 2 additions & 2 deletions app/_components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Header = ({ isEnabled = true }: { isEnabled?: boolean }) => {
const navigation = [
{
label: "Dashboard",
href: "/dashboard",
href: `/dashboard?month=${new Date().getMonth() + 1}`,
},
{
label: "Transações",
Expand All @@ -26,7 +26,7 @@ const Header = ({ isEnabled = true }: { isEnabled?: boolean }) => {
if (!isEnabled) return null;

return (
<header className="sticky left-0 top-0 z-50 flex h-[72px] items-center justify-between border-b bg-background px-6">
<header className="sticky left-0 top-0 z-50 flex h-[72px] min-h-[72px] items-center justify-between border-b bg-background px-6">
<div className="flex items-center gap-8">
<Link href="/dashboard">
<Image src="/logo.svg" alt="logo" width={173} height={32} />
Expand Down

0 comments on commit 5f7fe91

Please sign in to comment.