From 5f4749ebb35405a2b179ebfece15a374ee554ee6 Mon Sep 17 00:00:00 2001 From: Max Leiter Date: Sat, 12 Nov 2022 18:39:03 -0800 Subject: [PATCH] radix tooltip, move header to layout --- client/app/(auth)/components/index.tsx | 6 +- client/app/(auth)/signin/page.tsx | 7 +- client/app/(auth)/signup/page.tsx | 8 +- .../edit-document/formatting-icons/index.tsx | 5 +- client/app/(posts)/new/from/[id]/page.tsx | 7 +- client/app/(posts)/new/page.tsx | 7 +- .../post-page/view-document/index.tsx | 6 +- client/app/(posts)/post/[id]/page.tsx | 21 +- .../badges/created-ago-badge/index.tsx | 7 +- .../badges/expiration-badge/index.tsx | 10 +- .../badges/visibility-control/index.tsx | 1 - .../app/components/header/header.module.css | 1 + client/app/components/page-wrapper.tsx | 30 -- client/app/components/post-list/index.tsx | 6 +- client/app/components/post-list/list-item.tsx | 8 +- client/app/components/scroll-to-top/index.tsx | 6 +- client/app/components/tooltip/index.tsx | 32 ++ client/app/components/tooltip/tooltip.css | 10 + client/app/layout.tsx | 5 +- client/app/mine/page.tsx | 7 +- client/app/page.tsx | 12 +- client/app/root-layout-wrapper.tsx | 41 +- client/app/settings/page.tsx | 35 +- client/lib/render-markdown.tsx | 185 ------- client/lib/server/prisma.ts | 16 +- client/middleware.ts | 1 + client/next.config.mjs | 4 + client/package.json | 4 +- client/pnpm-lock.yaml | 455 +++++++++++++++++- 29 files changed, 603 insertions(+), 340 deletions(-) delete mode 100644 client/app/components/page-wrapper.tsx create mode 100644 client/app/components/tooltip/index.tsx create mode 100644 client/app/components/tooltip/tooltip.css delete mode 100644 client/lib/render-markdown.tsx diff --git a/client/app/(auth)/components/index.tsx b/client/app/(auth)/components/index.tsx index 8bf68664..1110a99c 100644 --- a/client/app/(auth)/components/index.tsx +++ b/client/app/(auth)/components/index.tsx @@ -1,15 +1,11 @@ "use client" -import { FormEvent, useState } from "react" +import { useState } from "react" import styles from "./auth.module.css" -import { useRouter } from "next/navigation" import Link from "../../components/link" import { Button, Input, Note } from "@geist-ui/core/dist" import { signIn } from "next-auth/react" import { Github as GithubIcon } from "@geist-ui/icons" -const NO_EMPTY_SPACE_REGEX = /^\S*$/ -const ERROR_MESSAGE = - "Provide a non empty username and a password with at least 6 characters" const Auth = ({ page, diff --git a/client/app/(auth)/signin/page.tsx b/client/app/(auth)/signin/page.tsx index bbf85e98..a8ac70fc 100644 --- a/client/app/(auth)/signin/page.tsx +++ b/client/app/(auth)/signin/page.tsx @@ -1,10 +1,5 @@ import Auth from "../components" -import PageWrapper from "@components/page-wrapper" export default function SignInPage() { - return ( - - - - ) + return () } diff --git a/client/app/(auth)/signup/page.tsx b/client/app/(auth)/signup/page.tsx index 16bf9ebf..c7e6a786 100644 --- a/client/app/(auth)/signup/page.tsx +++ b/client/app/(auth)/signup/page.tsx @@ -1,7 +1,5 @@ import Auth from "../components" -import Header from "@components/header" import { getRequiresPasscode } from "pages/api/auth/requires-passcode" -import PageWrapper from "@components/page-wrapper" const getPasscode = async () => { return await getRequiresPasscode() @@ -9,9 +7,5 @@ const getPasscode = async () => { export default async function SignUpPage() { const requiresPasscode = await getPasscode() - return ( - - - - ) + return () } diff --git a/client/app/(posts)/new/components/edit-document-list/edit-document/formatting-icons/index.tsx b/client/app/(posts)/new/components/edit-document-list/edit-document/formatting-icons/index.tsx index 26631b1b..737c5564 100644 --- a/client/app/(posts)/new/components/edit-document-list/edit-document/formatting-icons/index.tsx +++ b/client/app/(posts)/new/components/edit-document-list/edit-document/formatting-icons/index.tsx @@ -7,8 +7,9 @@ import List from "@geist-ui/icons/list" import ImageIcon from "@geist-ui/icons/image" import { RefObject, useMemo } from "react" import styles from "../document.module.css" -import { Button, ButtonGroup, Tooltip } from "@geist-ui/core/dist" +import { Button, ButtonGroup } from "@geist-ui/core/dist" import { TextareaMarkdownRef } from "textarea-markdown-editor" +import Tooltip from "@components/tooltip" // TODO: clean up @@ -64,7 +65,7 @@ const FormattingIcons = ({ {formattingActions.map(({ icon, name, action }) => (