From 72d0078d279ff8abdc98edafc7ab4a15a59af853 Mon Sep 17 00:00:00 2001 From: Matt Roberts Date: Thu, 19 Dec 2024 14:13:16 +0000 Subject: [PATCH 01/20] Changes to the post styling / layout --- public/assets/images/heroicons-thumbsup.svg | 3 ++ public/assets/styles/utility/display.scss | 8 +++ public/assets/styles/utility/text.scss | 6 +++ public/components/common/Moment.tsx | 12 +++-- public/pages/ShowPost/ShowPost.page.scss | 6 +-- public/pages/ShowPost/ShowPost.page.tsx | 49 ++++++++++++++----- .../pages/ShowPost/components/VotesPanel.tsx | 9 ++-- 7 files changed, 73 insertions(+), 20 deletions(-) create mode 100644 public/assets/images/heroicons-thumbsup.svg diff --git a/public/assets/images/heroicons-thumbsup.svg b/public/assets/images/heroicons-thumbsup.svg new file mode 100644 index 000000000..28a572046 --- /dev/null +++ b/public/assets/images/heroicons-thumbsup.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/assets/styles/utility/display.scss b/public/assets/styles/utility/display.scss index 51866812a..b424a7505 100644 --- a/public/assets/styles/utility/display.scss +++ b/public/assets/styles/utility/display.scss @@ -106,6 +106,10 @@ align-items: baseline; } +.flex-items-start { + align-items: start; +} + .justify-between { justify-content: space-between; } @@ -217,3 +221,7 @@ background-color: get("colors.gray.100"); } } + +.purple-border { + border-top: 4px solid get("colors.primary.base"); +} diff --git a/public/assets/styles/utility/text.scss b/public/assets/styles/utility/text.scss index 9cc2fc946..bd92062a4 100644 --- a/public/assets/styles/utility/text.scss +++ b/public/assets/styles/utility/text.scss @@ -9,6 +9,12 @@ pre:last-child { margin-bottom: 0; } +.text-large { + font-size: get("font.size.2xl"); + font-weight: get("font.weight.bold"); + letter-spacing: -1px; +} + .text-display2 { font-size: get("font.size.xl"); font-weight: get("font.weight.medium"); diff --git a/public/components/common/Moment.tsx b/public/components/common/Moment.tsx index 72c6089d7..d28122615 100644 --- a/public/components/common/Moment.tsx +++ b/public/components/common/Moment.tsx @@ -1,9 +1,10 @@ import React from "react" -import { formatDate, timeSince } from "@fider/services" +import { classSet, formatDate, timeSince } from "@fider/services" interface MomentText { locale: string date: Date | string + className?: string format?: "relative" | "full" | "short" | "date" } @@ -28,9 +29,14 @@ export const Moment = (props: MomentText) => { const tooltip = props.format === "short" ? formatDate(props.locale, props.date, "full") : undefined + const className = classSet({ + ...(props.className ? { [props.className]: true } : {}), + date: true, + }) + return ( - + {display} ) -} +} \ No newline at end of file diff --git a/public/pages/ShowPost/ShowPost.page.scss b/public/pages/ShowPost/ShowPost.page.scss index a23a0f93c..2e5e037bc 100644 --- a/public/pages/ShowPost/ShowPost.page.scss +++ b/public/pages/ShowPost/ShowPost.page.scss @@ -26,11 +26,11 @@ .p-show-post { display: grid; gap: spacing(4); - grid-template-columns: 1fr 3fr; + grid-template-columns: 3fr 1fr; grid-template-rows: auto; grid-template-areas: - "Action Main" - "Action Main"; + "Main Action" + "Main Action"; &__main-col { grid-area: Main; diff --git a/public/pages/ShowPost/ShowPost.page.tsx b/public/pages/ShowPost/ShowPost.page.tsx index a83fd6004..3ebc67ce6 100644 --- a/public/pages/ShowPost/ShowPost.page.tsx +++ b/public/pages/ShowPost/ShowPost.page.tsx @@ -6,7 +6,6 @@ import { Comment, Post, Tag, Vote, ImageUpload, CurrentUser } from "@fider/model import { actions, clearUrlHash, Failure, Fider, notify, timeAgo } from "@fider/services" import { - VoteCounter, ShowPostResponse, Button, UserName, @@ -20,6 +19,7 @@ import { Icon, Header, PoweredByFider, + Avatar, } from "@fider/components" import { ResponseForm } from "./components/ResponseForm" import { TagsPanel } from "./components/TagsPanel" @@ -30,7 +30,7 @@ import { VotesPanel } from "./components/VotesPanel" import IconX from "@fider/assets/images/heroicons-x.svg" import IconPencilAlt from "@fider/assets/images/heroicons-pencil-alt.svg" -import IconCheck from "@fider/assets/images/heroicons-check.svg" +import IconThumbsUp from "@fider/assets/images/heroicons-thumbsup.svg" import { HStack, VStack } from "@fider/components/layout" import { Trans } from "@lingui/macro" @@ -148,9 +148,9 @@ export default class ShowPostPage extends React.Component
- + - + {/* */}
{this.state.editMode ? ( @@ -158,20 +158,28 @@ export default class ShowPostPage extends React.Component ) : ( -

{this.props.post.title}

+

{this.props.post.title}

)} - + + + + + + + + + {/* Posted by · - + */}
- - + + {/* Description - + */} {this.state.editMode ? (