From 978432f639fb31291e21d30aaaf99e2288e992e1 Mon Sep 17 00:00:00 2001 From: andrzej Date: Tue, 24 Sep 2024 13:32:26 +0200 Subject: [PATCH] make subs page responsive --- package-lock.json | 6 ++++ package.json | 1 + src/app/submission/columns.tsx | 59 +++++++++++++++++++++++++++------- src/app/submission/create.tsx | 6 +++- src/app/submission/page.tsx | 2 +- src/app/ui/titleContainer.tsx | 4 +-- 6 files changed, 63 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index 21fbc4c..95983ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,6 +28,7 @@ "clsx": "^2.1.1", "date-fns": "^3.6.0", "jose": "^5.8.0", + "lucide": "^0.445.0", "lucide-react": "^0.394.0", "next": "^14.2.13", "next-themes": "^0.3.0", @@ -6415,6 +6416,11 @@ "loose-envify": "cli.js" } }, + "node_modules/lucide": { + "version": "0.445.0", + "resolved": "https://registry.npmjs.org/lucide/-/lucide-0.445.0.tgz", + "integrity": "sha512-Xkaf7xwXnx2DQj6dHAAnEsL8LI0iSeqh1ObVr6CTw9eYLpRchfXHzB+VL6qypqAy18jZmCY1bu4U652dCTHC3Q==" + }, "node_modules/lucide-react": { "version": "0.394.0", "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.394.0.tgz", diff --git a/package.json b/package.json index fc966ac..644d84d 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "clsx": "^2.1.1", "date-fns": "^3.6.0", "jose": "^5.8.0", + "lucide": "^0.445.0", "lucide-react": "^0.394.0", "next": "^14.2.13", "next-themes": "^0.3.0", diff --git a/src/app/submission/columns.tsx b/src/app/submission/columns.tsx index c80c6d8..1016040 100644 --- a/src/app/submission/columns.tsx +++ b/src/app/submission/columns.tsx @@ -1,10 +1,11 @@ "use client" import { CellContext, ColumnDef, createColumnHelper } from "@tanstack/react-table" -import { ArrowUpDown } from "lucide-react" +import { ArrowUpDown, BookText, CalendarPlus, MessageCircleReply, NotepadText } from "lucide-react" import { Button } from "@/components/ui/button" import { SubComplete } from "./page" import { selectCol } from "app/ui/tables/selectColumn" import TitleContainer from "app/ui/titleContainer" +import { CalendarArrowUp } from "lucide" @@ -18,7 +19,12 @@ export const columns: ColumnDef[] = [ return "RECORD DELETED" }, id: "story", - header: "Story", + header: () => ( + <> + Story + + + ), cell: (props: CellContext) => ({props.getValue()}) }, { @@ -29,7 +35,12 @@ export const columns: ColumnDef[] = [ return "RECORD DELETED" }, id: "pub", - header: "Publication", + header: () => ( + <> + Publication + + + ), cell: (props: CellContext) => ({props.getValue()}) }, { @@ -39,16 +50,24 @@ export const columns: ColumnDef[] = [ return ( ) }, enableColumnFilter: false, sortingFn: "datetime", - cell: (props: CellContext) => (

{props.getValue().toLocaleDateString()}

) + cell: (props: CellContext) => ( +

{props.getValue().toLocaleDateString('ES', { + day: 'numeric', + month: 'numeric', + year: '2-digit' + })}

+ ) }, { accessorFn: row => row.responded ? new Date(row.responded) : null, @@ -57,16 +76,22 @@ export const columns: ColumnDef[] = [ return ( ) }, enableColumnFilter: false, sortingFn: "datetime", - cell: (props: CellContext) => (

{props.getValue()?.toLocaleDateString()}

) + cell: (props: CellContext) => (

{props.getValue()?.toLocaleDateString('ES', { + day: 'numeric', + month: 'numeric', + year: '2-digit' + })}

) }, { accessorFn: row => { @@ -76,8 +101,20 @@ export const columns: ColumnDef[] = [ return "RECORD DELETED" }, id: "response", - header: "Response", - cell: (props: CellContext) => (

{props.getValue()}

) + header: ({ column }) => { + return ( + + ) + }, + cell: (props: CellContext) => (

{props.getValue()}

) }, ] diff --git a/src/app/submission/create.tsx b/src/app/submission/create.tsx index 38b5816..59bfa95 100644 --- a/src/app/submission/create.tsx +++ b/src/app/submission/create.tsx @@ -6,6 +6,7 @@ import { Button } from "@/components/ui/button"; import { ComponentProps } from "react"; import { Pub, Response, Story } from "@prisma/client"; import SubmissionForm from "app/ui/forms/sub"; +import { Plus } from "lucide-react"; type CreateSubDefaults = { @@ -22,7 +23,10 @@ export default function CreateSubmissionDialog({ stories, pubs, responses, defau return ( - + diff --git a/src/app/submission/page.tsx b/src/app/submission/page.tsx index 2622dec..43ad6ee 100644 --- a/src/app/submission/page.tsx +++ b/src/app/submission/page.tsx @@ -18,7 +18,7 @@ export default async function Page() { const genres = await getGenres() return ( -
+
) { - let classes = "w-full text-left m-auto" + let classes = "w-full text-left m-auto h-fit flex align-center text-xs md:text-sm" if (children == "RECORD DELETED") { classes = classes + " text-destructive font-bold" } - return

{children}

+ return

{children}

}