From 23a850253b2c4139ef7179ec2bb7742e2bff6fda Mon Sep 17 00:00:00 2001 From: Max Leiter Date: Sun, 18 Dec 2022 01:14:46 -0800 Subject: [PATCH] File styling adjustments --- .../components/preview/preview.module.css | 9 ++ .../edit-document/document.module.css | 2 +- .../edit-document/index.tsx | 2 +- src/app/(posts)/new/components/new.tsx | 2 +- .../post/[id]/components/post-files/index.tsx | 8 +- .../view-document/document.module.css | 53 ++++-------- .../post-files/view-document/index.tsx | 83 +++++++++---------- src/app/(posts)/post/[id]/layout.module.css | 1 + src/app/components/card/card.module.css | 2 +- src/app/components/header/index.tsx | 1 - src/app/components/input/index.tsx | 13 ++- src/app/components/page/page.module.css | 1 - src/app/components/toasts/index.tsx | 1 + src/app/components/tooltip/tooltip.module.css | 8 +- src/app/layout.tsx | 25 ++++-- src/app/providers.tsx | 14 ++++ src/app/root-layout-wrapper.tsx | 21 ----- src/app/styles/markdown.css | 4 +- src/lib/server/prisma.ts | 20 ++++- src/package.json | 4 +- src/pnpm-lock.yaml | 13 +++ 21 files changed, 156 insertions(+), 131 deletions(-) create mode 100644 src/app/providers.tsx delete mode 100644 src/app/root-layout-wrapper.tsx diff --git a/src/app/(posts)/components/preview/preview.module.css b/src/app/(posts)/components/preview/preview.module.css index 924854e7..1fd9b2f9 100644 --- a/src/app/(posts)/components/preview/preview.module.css +++ b/src/app/(posts)/components/preview/preview.module.css @@ -1,3 +1,12 @@ +.markdownPreview { + padding: var(--gap-quarter); +} + +.markdownPreview p { + margin-top: var(--gap); + margin-bottom: var(--gap); +} + .markdownPreview pre { border-radius: 3px; font-family: "Courier New", Courier, monospace; diff --git a/src/app/(posts)/new/components/edit-document-list/edit-document/document.module.css b/src/app/(posts)/new/components/edit-document-list/edit-document/document.module.css index cbc50f95..75e1225b 100644 --- a/src/app/(posts)/new/components/edit-document-list/edit-document/document.module.css +++ b/src/app/(posts)/new/components/edit-document-list/edit-document/document.module.css @@ -8,7 +8,7 @@ background: #efefef; } -.descriptionContainer { +.documentContainer { display: flex; flex-direction: column; min-height: 400px; diff --git a/src/app/(posts)/new/components/edit-document-list/edit-document/index.tsx b/src/app/(posts)/new/components/edit-document-list/edit-document/index.tsx index 21ce7ac0..942d07b0 100644 --- a/src/app/(posts)/new/components/edit-document-list/edit-document/index.tsx +++ b/src/app/(posts)/new/components/edit-document-list/edit-document/index.tsx @@ -82,7 +82,7 @@ const Document = ({ /> )} -
+
+
{post.files?.map(({ id, content, title, html }) => ( ))} - +
) } diff --git a/src/app/(posts)/post/[id]/components/post-files/view-document/document.module.css b/src/app/(posts)/post/[id]/components/post-files/view-document/document.module.css index 866dec3e..132b0e25 100644 --- a/src/app/(posts)/post/[id]/components/post-files/view-document/document.module.css +++ b/src/app/(posts)/post/[id]/components/post-files/view-document/document.module.css @@ -1,47 +1,24 @@ -.card { - padding: var(--gap); - border: 1px solid var(--light-gray); - border-radius: var(--radius); +.card header { + display: flex; + align-items: center; + flex-direction: row; + justify-content: space-between; + height: 40px; + line-height: 40px; + padding: 0 16px; + background: var(--lighter-gray); + border-radius: 8px 8px 0px 0px; } -.descriptionContainer { +.documentContainer { display: flex; flex-direction: column; min-height: 400px; overflow: auto; -} - -.fileNameContainer { - font-family: var(--font-mono) !important; - border-radius: var(--radius) !important; - margin-bottom: var(--gap-half) !important; - width: 100% !important; -} - -.fileNameContainer span { - transition: background-color var(--transition) !important; - border-color: var(--light-gray) !important; -} - -.fileNameContainer span:target, -.fileNameContainer span:hover { - background-color: var(--lighter-gray) !important; -} - -.fileNameContainer > div { - /* Override geist-ui styling */ - margin: 0 !important; -} - -.actionWrapper { - position: relative; - z-index: 1; - padding-top: 4px; -} - -.actionWrapper .actions { - position: absolute; - right: 0; + padding: var(--gap); + border: 1px solid var(--lighter-gray); + border-top: none; + border-radius: 0px 0px 8px 8px; } .textarea { diff --git a/src/app/(posts)/post/[id]/components/post-files/view-document/index.tsx b/src/app/(posts)/post/[id]/components/post-files/view-document/index.tsx index 0eaea847..d8c93454 100644 --- a/src/app/(posts)/post/[id]/components/post-files/view-document/index.tsx +++ b/src/app/(posts)/post/[id]/components/post-files/view-document/index.tsx @@ -9,7 +9,6 @@ import Tooltip from "@components/tooltip" import Button from "@components/button" import ButtonGroup from "@components/button-group" import DocumentTabs from "app/(posts)/components/tabs" -import Input from "@components/input" import { Download, ExternalLink } from "react-feather" type SharedProps = { @@ -32,32 +31,30 @@ type Props = ( const DownloadButtons = ({ rawLink }: { rawLink?: string }) => { return ( -
- - - -
+ + + +