Skip to content

Commit 55ea4b2

Browse files
committed
Merge branch 'main' of github.com:techdiary-dev/techdiary.dev into shoaibsharif/tags
2 parents bcd2798 + 741dbc2 commit 55ea4b2

File tree

5 files changed

+16
-10
lines changed

5 files changed

+16
-10
lines changed

src/app/dashboard/_components/ArticleList.tsx renamed to src/app/dashboard/_components/DashboardArticleList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { addDays, differenceInHours } from "date-fns";
3030
import { TrashIcon } from "lucide-react";
3131
import Link from "next/link";
3232

33-
const ArticleList = () => {
33+
const DashboardArticleList = () => {
3434
const { _t } = useTranslation();
3535
const queryClient = useQueryClient();
3636
const appConfirm = useAppConfirm();
@@ -299,4 +299,4 @@ const ArticleList = () => {
299299
);
300300
};
301301

302-
export default ArticleList;
302+
export default DashboardArticleList;

src/app/dashboard/layout.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,19 @@ const layout: React.FC<PropsWithChildren> = async ({ children }) => {
1919
const session = await sessionActions.getSession();
2020

2121
const cookieStore = await cookies();
22-
const defaultOpen = cookieStore.get("sidebar_state")?.value === "true";
22+
23+
const getSidebarOpenState = () => {
24+
const isOpen = cookieStore.get("sidebar_state")?.value;
25+
if (!isOpen) return true;
26+
return cookieStore.get("sidebar_state")?.value === "true";
27+
};
2328

2429
if (!session?.user) {
2530
redirect(`/login?next=${currentPath}`);
2631
}
2732

2833
return (
29-
<SidebarProvider defaultOpen={defaultOpen}>
34+
<SidebarProvider defaultOpen={getSidebarOpenState()}>
3035
<DashboardScaffold>{children}</DashboardScaffold>
3136
</SidebarProvider>
3237
);

src/app/dashboard/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import ArticleList from "./_components/ArticleList";
1+
import DashboardArticleList from "./_components/DashboardArticleList";
22
import MatrixReport from "./_components/MatrixReport";
33
// import ViewsChart from "./_components/ViewsChart";
44

@@ -7,7 +7,7 @@ const page = () => {
77
<>
88
{/* <ViewsChart /> */}
99
<MatrixReport />
10-
<ArticleList />
10+
<DashboardArticleList />
1111
</>
1212
);
1313
};

src/backend/services/article.actions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@ export async function myArticles(
501501
"handle",
502502
"created_at",
503503
"is_published",
504+
"delete_scheduled_at",
504505
"approved_at",
505506
],
506507
limit: input.limit,

src/components/ui/sidebar.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
"use client";
22

3+
import * as React from "react";
34
import { Slot } from "@radix-ui/react-slot";
4-
import { VariantProps, cva } from "class-variance-authority";
5+
import { cva, VariantProps } from "class-variance-authority";
56
import { PanelLeftIcon } from "lucide-react";
6-
import * as React from "react";
77

8+
import { useIsMobile } from "@/hooks/use-mobile";
9+
import { cn } from "@/lib/utils";
810
import { Button } from "@/components/ui/button";
911
import { Input } from "@/components/ui/input";
1012
import { Separator } from "@/components/ui/separator";
@@ -22,8 +24,6 @@ import {
2224
TooltipProvider,
2325
TooltipTrigger,
2426
} from "@/components/ui/tooltip";
25-
import { useIsMobile } from "@/hooks/use-mobile";
26-
import { cn } from "@/lib/utils";
2727

2828
const SIDEBAR_COOKIE_NAME = "sidebar_state";
2929
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;

0 commit comments

Comments
 (0)