Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/investment resizable layout #86

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions apps/www/app/(dashboard)/dashboard/investments/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { cookies } from "next/headers";
import Image from "next/image";
import { redirect } from "next/navigation";

import { InvestmentsDashboard } from "@/components/investments/components/investment-dashboard";
import { accounts, mails } from "@/components/investments/data";
Expand All @@ -11,7 +10,7 @@ export const metadata = {
};

export default async function DashboardPage() {
const layout = cookies().get("react-resizable-panels:layout");
const layout = cookies().get("react-resizable-panels:layout-investment");
const collapsed = cookies().get("react-resizable-panels:collapsed");

const defaultLayout = layout ? JSON.parse(layout.value) : undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ interface MailProps {
export function InvestmentsDashboard({
accounts,
mails,
defaultLayout = [265, 440, 400],
defaultLayout = [20, 40, 40],
defaultCollapsed = false,
navCollapsedSize,
}: MailProps) {
Expand All @@ -68,7 +68,7 @@ export function InvestmentsDashboard({
<ResizablePanelGroup
direction="horizontal"
onLayout={(sizes: number[]) => {
document.cookie = `react-resizable-panels:layout=${JSON.stringify(
document.cookie = `react-resizable-panels:layout-investment=${JSON.stringify(
sizes,
)}`;
}}
Expand Down
Loading