diff --git a/client/app/(posts)/components/file-dropdown/dropdown.module.css b/client/app/(posts)/components/file-dropdown/dropdown.module.css index dbb061a7..9d2f48ae 100644 --- a/client/app/(posts)/components/file-dropdown/dropdown.module.css +++ b/client/app/(posts)/components/file-dropdown/dropdown.module.css @@ -59,14 +59,10 @@ margin: 0; } -.cardContent { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - padding: var(--gap-half); - padding-top: 200px; +.chevron { + transition: transform 0.2s ease-in-out; } -@media screen and (max-width: 82rem) { +[data-state="open"] .chevron { + transform: rotate(180deg); } diff --git a/client/app/(posts)/components/file-dropdown/index.tsx b/client/app/(posts)/components/file-dropdown/index.tsx index f1a77399..d7c3e3b8 100644 --- a/client/app/(posts)/components/file-dropdown/index.tsx +++ b/client/app/(posts)/components/file-dropdown/index.tsx @@ -49,8 +49,11 @@ const FileDropdown = ({ files }: { files: File[] }) => { return ( - -
+ +
diff --git a/client/app/(posts)/expired/page.tsx b/client/app/(posts)/expired/page.tsx index 4073102a..6932f718 100644 --- a/client/app/(posts)/expired/page.tsx +++ b/client/app/(posts)/expired/page.tsx @@ -1,11 +1,11 @@ "use client" -import { Note, Text } from "@geist-ui/core/dist" +import Note from "@components/note" export default function ExpiredPage() { return ( - -

Error: The Drift you're trying to view has expired.

+ + Error: The Drift you're trying to view has expired. ) } diff --git a/client/app/(posts)/new/components/description/index.tsx b/client/app/(posts)/new/components/description/index.tsx index f902d076..ac77bbf6 100644 --- a/client/app/(posts)/new/components/description/index.tsx +++ b/client/app/(posts)/new/components/description/index.tsx @@ -23,4 +23,4 @@ const Description = ({ onChange, description }: props) => { ) } -export default memo(Description) +export default Description diff --git a/client/app/(posts)/new/components/edit-document-list/edit-document/formatting-icons/formatting-icons.module.css b/client/app/(posts)/new/components/edit-document-list/edit-document/formatting-icons/formatting-icons.module.css index ed21f5cf..5a602add 100644 --- a/client/app/(posts)/new/components/edit-document-list/edit-document/formatting-icons/formatting-icons.module.css +++ b/client/app/(posts)/new/components/edit-document-list/edit-document/formatting-icons/formatting-icons.module.css @@ -6,9 +6,17 @@ .actionWrapper .actions { position: absolute; right: 0; - top: 4px; + top: -34px; } +/* small screens, top: 0 */ +@media (max-width: 767px) { + .actionWrapper .actions { + top: 0; + } +} + + @media (max-width: 768px) { .actionWrapper .actions { position: relative; diff --git a/client/app/(posts)/new/components/edit-document-list/index.tsx b/client/app/(posts)/new/components/edit-document-list/index.tsx index 55af34b3..812fd967 100644 --- a/client/app/(posts)/new/components/edit-document-list/index.tsx +++ b/client/app/(posts)/new/components/edit-document-list/index.tsx @@ -41,4 +41,4 @@ const DocumentList = ({ ) } -export default memo(DocumentList) +export default DocumentList diff --git a/client/app/(posts)/new/components/new.tsx b/client/app/(posts)/new/components/new.tsx index ece32280..91a89939 100644 --- a/client/app/(posts)/new/components/new.tsx +++ b/client/app/(posts)/new/components/new.tsx @@ -164,13 +164,18 @@ const Post = ({ const onChangeExpiration = (date: Date) => setExpiresAt(date) - const onChangeTitle = (e: ChangeEvent) => { + const onChangeTitle = useCallback((e: ChangeEvent) => { + e.preventDefault() setTitle(e.target.value) - } + }, []) - const onChangeDescription = (e: ChangeEvent) => { - setDescription(e.target.value) - } + const onChangeDescription = useCallback( + (e: ChangeEvent) => { + e.preventDefault() + setDescription(e.target.value) + }, + [] + ) const updateDocTitle = (i: number) => (title: string) => { setDocs((docs) => diff --git a/client/app/(posts)/new/components/title/index.tsx b/client/app/(posts)/new/components/title/index.tsx index 838b5d69..c74bf193 100644 --- a/client/app/(posts)/new/components/title/index.tsx +++ b/client/app/(posts)/new/components/title/index.tsx @@ -1,4 +1,4 @@ -import type { ChangeEvent } from "react" +import { ChangeEvent, memo } from "react" import Input from "@components/input" import styles from "./title.module.css" @@ -37,4 +37,4 @@ const Title = ({ onChange, title }: props) => { ) } -export default Title +export default memo(Title) diff --git a/client/app/(posts)/post/[id]/components/post-page/view-document/document.module.css b/client/app/(posts)/post/[id]/components/post-page/view-document/document.module.css index 77b3d5e1..55fa9025 100644 --- a/client/app/(posts)/post/[id]/components/post-page/view-document/document.module.css +++ b/client/app/(posts)/post/[id]/components/post-page/view-document/document.module.css @@ -37,6 +37,7 @@ .actionWrapper { position: relative; z-index: 1; + padding-top: 4px; } .actionWrapper .actions { diff --git a/client/app/(posts)/post/[id]/page.tsx b/client/app/(posts)/post/[id]/page.tsx index 4a7be05c..83fe1d1f 100644 --- a/client/app/(posts)/post/[id]/page.tsx +++ b/client/app/(posts)/post/[id]/page.tsx @@ -1,5 +1,5 @@ import PostPage from "app/(posts)/post/[id]/components/post-page" -import { notFound } from "next/navigation" +import { notFound, redirect } from "next/navigation" import { getPostById, Post } from "@lib/server/prisma" import { getCurrentUser } from "@lib/server/session" @@ -57,7 +57,7 @@ const getPost = async (id: string) => { if (post.expiresAt && !isAuthorOrAdmin) { const expirationDate = new Date(post.expiresAt) if (expirationDate < new Date()) { - return notFound() + return redirect("/expired") } } diff --git a/client/app/components/error/index.tsx b/client/app/components/error/index.tsx deleted file mode 100644 index a2b7b72e..00000000 --- a/client/app/components/error/index.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { Page } from "@geist-ui/core/dist" - -const Error = ({ status }: { status: number }) => { - return ( - - {status === 404 ? ( -

This page cannot be found.

- ) : ( -
-

An error occurred: {status}

-
- )} -
- ) -} - -export default Error diff --git a/client/app/components/note/index.tsx b/client/app/components/note/index.tsx index 7223f5c0..0279fb8e 100644 --- a/client/app/components/note/index.tsx +++ b/client/app/components/note/index.tsx @@ -9,7 +9,6 @@ const Note = ({ children: React.ReactNode } & React.ComponentProps<"div">) => (
- {type}: {children}
) diff --git a/client/app/components/note/note.module.css b/client/app/components/note/note.module.css index 0928af3c..7cec86b2 100644 --- a/client/app/components/note/note.module.css +++ b/client/app/components/note/note.module.css @@ -1,5 +1,4 @@ .note { - font-size: 0.8em; color: var(--fg); margin: 0; padding: var(--gap); @@ -20,8 +19,14 @@ background: #f33; } +[data-theme="light"] .warning, +[data-theme="light"] .error { + color: var(--bg); +} + .type { color: var(--fg); margin-right: 0.5em; + font-size: initial; text-transform: capitalize; } diff --git a/client/app/components/tooltip/index.tsx b/client/app/components/tooltip/index.tsx index 837d3a07..03eadae3 100644 --- a/client/app/components/tooltip/index.tsx +++ b/client/app/components/tooltip/index.tsx @@ -1,6 +1,6 @@ import Card from "@components/card" import * as RadixTooltip from "@radix-ui/react-tooltip" -import "./tooltip.css" +import styles from "./tooltip.module.css" const Tooltip = ({ children, @@ -17,9 +17,8 @@ const Tooltip = ({ {children} - - {content} + {content} ) diff --git a/client/app/components/tooltip/tooltip.css b/client/app/components/tooltip/tooltip.css deleted file mode 100644 index 20e10803..00000000 --- a/client/app/components/tooltip/tooltip.css +++ /dev/null @@ -1,10 +0,0 @@ - -.tooltip { - /* animate */ - animation: fadein 300ms; -} - -@keyframes fadein { - from { opacity: 0; } - to { opacity: 1; } -} diff --git a/client/app/components/tooltip/tooltip.module.css b/client/app/components/tooltip/tooltip.module.css new file mode 100644 index 00000000..39d6d8b2 --- /dev/null +++ b/client/app/components/tooltip/tooltip.module.css @@ -0,0 +1,24 @@ +.tooltip { + animation: fadein 300ms; +} + +[data-side='top'] .tooltip{ + margin-bottom: var(--gap); +} + +.tooltip[data-side='bottom'] { + margin-top: var(--gap); +} + +.tooltip[data-side='left'] { + margin-right: var(--gap); +} + +.tooltip[data-side='right'] { + margin-left: var(--gap); +} + +@keyframes fadein { + from { opacity: 0; } + to { opacity: 1; } +} diff --git a/client/app/settings/components/sections/profile.tsx b/client/app/settings/components/sections/profile.tsx index b0a96f59..1ef38191 100644 --- a/client/app/settings/components/sections/profile.tsx +++ b/client/app/settings/components/sections/profile.tsx @@ -1,6 +1,9 @@ "use client" -import { Note, Input, Textarea, Button, useToasts } from "@geist-ui/core/dist" +import Button from "@components/button" +import Input from "@components/input" +import Note from "@components/note" +import { useToasts } from "@geist-ui/core/dist" import { User } from "next-auth" import { useState } from "react" @@ -57,7 +60,7 @@ const Profile = ({ user }: { user: User }) => { return ( <> - + This information will be publicly available on your profile
{ {
-