From 86dcfed6a2de07b879900a91d6a3ad1911ef4cce Mon Sep 17 00:00:00 2001 From: Max Leiter Date: Mon, 5 Jun 2023 02:00:33 -0700 Subject: [PATCH] progress --- .../(drift)/(posts)/new/components/new.tsx | 105 +++++++++--------- .../(posts)/new/components/post.module.css | 3 - src/app/components/header/index.tsx | 54 +++------ src/app/components/post-list/list-item.tsx | 57 +++++----- src/app/components/scroll-to-top/index.tsx | 6 +- 5 files changed, 102 insertions(+), 123 deletions(-) diff --git a/src/app/(drift)/(posts)/new/components/new.tsx b/src/app/(drift)/(posts)/new/components/new.tsx index 58d6f33b..cee5cea1 100644 --- a/src/app/(drift)/(posts)/new/components/new.tsx +++ b/src/app/(drift)/(posts)/new/components/new.tsx @@ -255,27 +255,24 @@ function Post({ /> -
- -
+
+ + } timeInputLabel="Time:" dateFormat="MM/dd/yyyy h:mm aa" - className={styles.datePicker} clearButtonTitle={"Clear"} // TODO: investigate why this causes margin shift if true enableTabLoop={false} minDate={new Date()} + className="max-w-[200px] flex-1" /> - - onSubmit("unlisted")} - > - {isSubmitting ? : "Create Unlisted"} - - onSubmit("private")} - > - Create Private - - onSubmit("public")} - > - Create Public - - onSubmit("protected")} - > - Create with Password - - -
+ + + onSubmit("unlisted")} + > + {isSubmitting ? : "Create Unlisted"} + + onSubmit("private")} + > + Create Private + + onSubmit("public")} + > + Create Public + + onSubmit("protected")} + > + Create with Password + +
setMounted(true), []) const toggleTheme = () => { setTheme(resolvedTheme === "dark" ? "light" : "dark") } @@ -118,42 +116,22 @@ export default function Header() { Settings {isAdmin && Admin} - {isAuthenticated === true && ( - Sign Out - )} - {isAuthenticated === false && ( - Sign In - )} - {/* {!mounted && ( - } - value="dark" - href="" - key="theme" - /> - )} - {mounted && ( - {resolvedTheme === "dark" ? : } - } - value="dark" - onClick={() => { - setTheme(resolvedTheme === "dark" ? "light" : "dark") - }} - key="theme" - /> - )} */} - {mounted && isAuthenticated !== undefined && ( - - {resolvedTheme === "dark" ? "Light" : "Dark"} - + {isAuthenticated !== undefined && ( + <> + {isAuthenticated === true && ( + Sign Out + )} + {isAuthenticated === false && ( + Sign In + )} + + {resolvedTheme === "dark" ? "Light" : "Dark"} + + )} diff --git a/src/app/components/post-list/list-item.tsx b/src/app/components/post-list/list-item.tsx index 61a2de21..4f225e3c 100644 --- a/src/app/components/post-list/list-item.tsx +++ b/src/app/components/post-list/list-item.tsx @@ -17,6 +17,7 @@ import { } from "@components/card" import { Button } from "@components/button" import { + ArrowUpCircle, Code, Database, Edit, @@ -26,7 +27,11 @@ import { Trash } from "react-feather" import { codeFileExtensions } from "@lib/constants" -import { DropdownMenu, DropdownMenuItem, DropdownMenuTrigger } from "@components/dropdown-menu" +import { + DropdownMenu, + DropdownMenuItem, + DropdownMenuTrigger +} from "@components/dropdown-menu" import { DropdownMenuContent } from "@radix-ui/react-dropdown-menu" // TODO: isOwner should default to false so this can be used generically @@ -104,40 +109,40 @@ const ListItem = ({ - + - + { editACopy() }} + className="cursor-pointer bg-background" > - Edit a copy + Edit a copy + {isOwner && ( + { + deletePost() + }} + className="cursor-pointer bg-background" + > + + Delete + + )} + {post.parentId && ( + { + viewParentClick() + }} + > + + View parent + + )} - {post.parentId && ( - - - - {isOwner && ( - - - - )} ) : null} diff --git a/src/app/components/scroll-to-top/index.tsx b/src/app/components/scroll-to-top/index.tsx index 78ab78c0..63c3d707 100644 --- a/src/app/components/scroll-to-top/index.tsx +++ b/src/app/components/scroll-to-top/index.tsx @@ -39,8 +39,10 @@ const ScrollToTop = () => {
)