Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

More UI work on the show post page.

Matt Roberts5bb0f8ebd651
diff --git a/locale/de/client.json b/locale/de/client.json
index 5e53ace21..df8ef8689 100644
--- a/locale/de/client.json
+++ b/locale/de/client.json
@@ -149,6 +149,7 @@
"showpost.notificationspanel.message.unsubscribed": "Sie erhalten keine Benachrichtigungen über diesen Beitrag.",
"showpost.postsearch.numofvotes": "{0} Stimmen",
"showpost.postsearch.query.placeholder": "Originalbeitrag suchen...",
+ "showpost.response.date": "",
"showpost.responseform.message.mergedvotes": "Stimmen aus diesem Beitrag werden mit den Stimmen vom ursprünglichen Beitrag zusammengeführt.",
"showpost.responseform.text.placeholder": "Was passiert in diesem Beitrag? Lassen Sie Ihre Benutzer wissen, was Ihre Pläne sind...",
"showpost.votespanel.more": "+{extraVotesCount} mehr",
diff --git a/locale/el/client.json b/locale/el/client.json
index 78aa771f5..86e6dff4d 100644
--- a/locale/el/client.json
+++ b/locale/el/client.json
@@ -149,6 +149,7 @@
"showpost.notificationspanel.message.unsubscribed": "Δεν θα λάβετε καμία ειδοποίηση σχετικά με αυτή τη δημοσίευση.",
"showpost.postsearch.numofvotes": "{0} Ψήφοι",
"showpost.postsearch.query.placeholder": "Αναζήτηση αρχικής ανάρτησης...",
+ "showpost.response.date": "",
"showpost.responseform.message.mergedvotes": "Οι ψήφοι από αυτό το post θα συγχωνευτούν στο αρχικό post.",
"showpost.responseform.text.placeholder": "Τι συμβαίνει με αυτή την ανάρτηση; Αφήστε τους χρήστες σας να γνωρίζουν ποια είναι τα σχέδιά σας...",
"showpost.votespanel.more": "+{extraVotesCount} περισσότερα",
diff --git a/locale/en/client.json b/locale/en/client.json
index 84d0e73fb..14407e41e 100644
--- a/locale/en/client.json
+++ b/locale/en/client.json
@@ -149,6 +149,7 @@
"showpost.notificationspanel.message.unsubscribed": "You'll not receive any notification about this post.",
"showpost.postsearch.numofvotes": "{0} votes",
"showpost.postsearch.query.placeholder": "Search original post...",
+ "showpost.response.date": "Status changed to {status} on {statusDate}",
"showpost.responseform.message.mergedvotes": "Votes from this post will be merged into original post.",
"showpost.responseform.text.placeholder": "What's going on with this post? Let your users know what are your plans...",
"showpost.votespanel.more": "+{extraVotesCount} more",
diff --git a/locale/es-ES/client.json b/locale/es-ES/client.json
index d7ef35157..5c44f7980 100644
--- a/locale/es-ES/client.json
+++ b/locale/es-ES/client.json
@@ -149,6 +149,7 @@
"showpost.notificationspanel.message.unsubscribed": "No recibirás ninguna notificación sobre este evento.",
"showpost.postsearch.numofvotes": "{0} votos",
"showpost.postsearch.query.placeholder": "Buscar publicación original...",
+ "showpost.response.date": "",
"showpost.responseform.message.mergedvotes": "Los votos de esta publicación se fusionarán en la publicación original.",
"showpost.responseform.text.placeholder": "¿Qué está pasando con esta publicación? Dile a tus usuarios cuáles son tus planes...",
"showpost.votespanel.more": "+{extraVotesCount} más",
diff --git a/locale/fr/client.json b/locale/fr/client.json
index 2c697b28b..47865e649 100644
--- a/locale/fr/client.json
+++ b/locale/fr/client.json
@@ -149,6 +149,7 @@
"showpost.notificationspanel.message.unsubscribed": "Vous ne recevrez aucune notification à propos de ce message.",
"showpost.postsearch.numofvotes": "{0} votes",
"showpost.postsearch.query.placeholder": "Rechercher le message original...",
+ "showpost.response.date": "",
"showpost.responseform.message.mergedvotes": "Les votes de ce message seront fusionnés dans le message original.",
"showpost.responseform.text.placeholder": "Que se passe-t-il avec ce message ? Faites savoir à vos utilisateurs quels sont vos plans...",
"showpost.votespanel.more": "+{extraVotesCount} de plus",
diff --git a/locale/it/client.json b/locale/it/client.json
index 0714e6b60..3f1f87b31 100644
--- a/locale/it/client.json
+++ b/locale/it/client.json
@@ -149,6 +149,7 @@
"showpost.notificationspanel.message.unsubscribed": "Non riceverai alcuna notifica su questo post.",
"showpost.postsearch.numofvotes": "{0} votes",
"showpost.postsearch.query.placeholder": "Cerca post originale...",
+ "showpost.response.date": "",
"showpost.responseform.message.mergedvotes": "I voti di questo post saranno uniti al post originale.",
"showpost.responseform.text.placeholder": "Cosa succede con questo post? Fate sapere ai vostri utenti quali sono i vostri piani...",
"showpost.votespanel.more": "+{extraVotesCount} di più",
diff --git a/locale/nl/client.json b/locale/nl/client.json
index 77827a9dc..7bfeb774a 100644
--- a/locale/nl/client.json
+++ b/locale/nl/client.json
@@ -149,6 +149,7 @@
"showpost.notificationspanel.message.unsubscribed": "Je ontvangt geen meldingen over dit bericht.",
"showpost.postsearch.numofvotes": "{0} stemmen",
"showpost.postsearch.query.placeholder": "Zoek origineel bericht...",
+ "showpost.response.date": "",
"showpost.responseform.message.mergedvotes": "Stemmen van dit bericht zullen worden samengevoegd met het originele bericht.",
"showpost.responseform.text.placeholder": "Wat gebeurt er met dit bericht? Laat je gebruikers weten wat je plannen zijn...",
"showpost.votespanel.more": "+{extraVotesCount} meer",
diff --git a/locale/pl/client.json b/locale/pl/client.json
index 22a91174c..70ab186c2 100644
--- a/locale/pl/client.json
+++ b/locale/pl/client.json
@@ -149,6 +149,7 @@
"showpost.notificationspanel.message.unsubscribed": "Nie będziesz otrzymywał żadnych powiadomień o o tym poście.",
"showpost.postsearch.numofvotes": "{0} głosów",
"showpost.postsearch.query.placeholder": "Szukaj oryginalnego posta...",
+ "showpost.response.date": "",
"showpost.responseform.message.mergedvotes": "Głosy z tego posta zostaną scalone z oryginalnym postem.",
"showpost.responseform.text.placeholder": "Co się dzieje w temacie tego posta? Daj swoim użytkownikom znać o swoich planach...",
"showpost.votespanel.more": "+{extraVotesCount} więcej",
diff --git a/locale/pt-BR/client.json b/locale/pt-BR/client.json
index 55ea8ce5f..fe94e2e91 100644
--- a/locale/pt-BR/client.json
+++ b/locale/pt-BR/client.json
@@ -149,6 +149,7 @@
"showpost.notificationspanel.message.unsubscribed": "Você não receberá nenhuma notificação sobre esta postagem.",
"showpost.postsearch.numofvotes": "{0} votos",
"showpost.postsearch.query.placeholder": "Procurar postagem original...",
+ "showpost.response.date": "",
"showpost.responseform.message.mergedvotes": "Votos desta publicação serão mesclados na postagem original.",
"showpost.responseform.text.placeholder": "O que está acontecendo com esta postagem? Informe seus usuários quais são os seus planos...",
"showpost.votespanel.more": "+{extraVotesCount} mais",
diff --git a/locale/ru/client.json b/locale/ru/client.json
index dd94ed2ed..8024d048a 100644
--- a/locale/ru/client.json
+++ b/locale/ru/client.json
@@ -149,6 +149,7 @@
"showpost.notificationspanel.message.unsubscribed": "Вы не подписаны на уведомления об активности в этом посте.",
"showpost.postsearch.numofvotes": "{0} голосов",
"showpost.postsearch.query.placeholder": "Выберите оригинальный пост...",
+ "showpost.response.date": "",
"showpost.responseform.message.mergedvotes": "Голоса этого поста будут прибавлены к голосам оригинального поста.",
"showpost.responseform.text.placeholder": "Что произойдёт с этим предложением? Дайте людям знать о ваших планах...",
"showpost.votespanel.more": "и ещё {extraVotesCount}",
diff --git a/locale/sk/client.json b/locale/sk/client.json
index b9d59d137..9ffdb21e2 100644
--- a/locale/sk/client.json
+++ b/locale/sk/client.json
@@ -149,6 +149,7 @@
"showpost.notificationspanel.message.unsubscribed": "Na tento príspevok nedostanete žiadne upozornenie.",
"showpost.postsearch.numofvotes": "{0} hlasov",
"showpost.postsearch.query.placeholder": "Hľadať pôvodný príspevok...",
+ "showpost.response.date": "",
"showpost.responseform.message.mergedvotes": "Hlasy z tohto príspevku budú zlúčené do pôvodného príspevku.",
"showpost.responseform.text.placeholder": "Čo sa deje s týmto príspevkom? Dajte svojim používateľom vedieť, aké máte plány...",
"showpost.votespanel.more": "+{extraVotesCount} viac",
diff --git a/locale/sv-SE/client.json b/locale/sv-SE/client.json
index fa2de6203..6b1cd39de 100644
--- a/locale/sv-SE/client.json
+++ b/locale/sv-SE/client.json
@@ -149,6 +149,7 @@
"showpost.notificationspanel.message.unsubscribed": "Du får inte aviseringar för det här inlägget.",
"showpost.postsearch.numofvotes": "{0} röster",
"showpost.postsearch.query.placeholder": "Sök i ursprungliga inlägget...",
+ "showpost.response.date": "",
"showpost.responseform.message.mergedvotes": "Röster från det här inlägget kommer att flyttas till det ursprungliga inlägget.",
"showpost.responseform.text.placeholder": "Vad händer med det här inlägget? Låt dina användare veta vad du planerar...",
"showpost.votespanel.more": "+{extraVotesCount} ytterligare",
diff --git a/locale/tr/client.json b/locale/tr/client.json
index 6c1ff5507..4894a3605 100644
--- a/locale/tr/client.json
+++ b/locale/tr/client.json
@@ -149,6 +149,7 @@
"showpost.notificationspanel.message.unsubscribed": "Bu öneri hakkında bildirim almayacaksınız.",
"showpost.postsearch.numofvotes": "{0} oy",
"showpost.postsearch.query.placeholder": "Orijinal öneri ara...",
+ "showpost.response.date": "",
"showpost.responseform.message.mergedvotes": "Bu önerideki yorumlar orijinal öneriye dahil edilecek.",
"showpost.responseform.text.placeholder": "Bu öneriye neler oluyor? Kullanıcılara planlarınız hakkında bilgi verin...",
"showpost.votespanel.more": "+{extraVotesCount} daha",
diff --git a/locale/zh-CN/client.json b/locale/zh-CN/client.json
index 5f1294875..b7bec69e8 100644
--- a/locale/zh-CN/client.json
+++ b/locale/zh-CN/client.json
@@ -149,6 +149,7 @@
"showpost.notificationspanel.message.unsubscribed": "您将不会收到有关此帖子的任何通知.",
"showpost.postsearch.numofvotes": "{0} 投票",
"showpost.postsearch.query.placeholder": "搜索原始帖子...",
+ "showpost.response.date": "",
"showpost.responseform.message.mergedvotes": "此帖子的投票将合并到原始帖子中.",
"showpost.responseform.text.placeholder": "这篇文章怎么了?让你的用户知道你的计划是什么...",
"showpost.votespanel.more": "+{extraVotesCount} 更多",
diff --git a/public/assets/images/heroicons-inbox.svg b/public/assets/images/heroicons-inbox.svg
new file mode 100644
index 000000000..7174d15b1
--- /dev/null
+++ b/public/assets/images/heroicons-inbox.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M9 3.75H6.912a2.25 2.25 0 0 0-2.15 1.588L2.35 13.177a2.25 2.25 0 0 0-.1.661V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18v-4.162c0-.224-.034-.447-.1-.661L19.24 5.338a2.25 2.25 0 0 0-2.15-1.588H15M2.25 13.5h3.86a2.25 2.25 0 0 1 2.012 1.244l.256.512a2.25 2.25 0 0 0 2.013 1.244h3.218a2.25 2.25 0 0 0 2.013-1.244l.256-.512a2.25 2.25 0 0 1 2.013-1.244h3.859M12 3v8.25m0 0-3-3m3 3 3-3" />
+</svg>
diff --git a/public/assets/images/heroicons-smile.svg b/public/assets/images/heroicons-smile.svg
new file mode 100644
index 000000000..4da5866a4
--- /dev/null
+++ b/public/assets/images/heroicons-smile.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M15.182 15.182a4.5 4.5 0 0 1-6.364 0M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0ZM9.75 9.75c0 .414-.168.75-.375.75S9 10.164 9 9.75 9.168 9 9.375 9s.375.336.375.75Zm-.375 0h.008v.015h-.008V9.75Zm5.625 0c0 .414-.168.75-.375.75s-.375-.336-.375-.75.168-.75.375-.75.375.336.375.75Zm-.375 0h.008v.015h-.008V9.75Z" />
+</svg>
diff --git a/public/assets/images/heroicons-star.svg b/public/assets/images/heroicons-star.svg
new file mode 100644
index 000000000..a3e370c51
--- /dev/null
+++ b/public/assets/images/heroicons-star.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M11.48 3.499a.562.562 0 0 1 1.04 0l2.125 5.111a.563.563 0 0 0 .475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 0 0-.182.557l1.285 5.385a.562.562 0 0 1-.84.61l-4.725-2.885a.562.562 0 0 0-.586 0L6.982 20.54a.562.562 0 0 1-.84-.61l1.285-5.386a.562.562 0 0 0-.182-.557l-4.204-3.602a.562.562 0 0 1 .321-.988l5.518-.442a.563.563 0 0 0 .475-.345L11.48 3.5Z" />
+</svg>
diff --git a/public/assets/images/heroicons-thumbsdown.svg b/public/assets/images/heroicons-thumbsdown.svg
new file mode 100644
index 000000000..38432cce6
--- /dev/null
+++ b/public/assets/images/heroicons-thumbsdown.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
+ <path stroke-linecap="round" stroke-linejoin="round" d="M7.498 15.25H4.372c-1.026 0-1.945-.694-2.054-1.715a12.137 12.137 0 0 1-.068-1.285c0-2.848.992-5.464 2.649-7.521C5.287 4.247 5.886 4 6.504 4h4.016a4.5 4.5 0 0 1 1.423.23l3.114 1.04a4.5 4.5 0 0 0 1.423.23h1.294M7.498 15.25c.618 0 .991.724.725 1.282A7.471 7.471 0 0 0 7.5 19.75 2.25 2.25 0 0 0 9.75 22a.75.75 0 0 0 .75-.75v-.633c0-.573.11-1.14.322-1.672.304-.76.93-1.33 1.653-1.715a9.04 9.04 0 0 0 2.86-2.4c.498-.634 1.226-1.08 2.032-1.08h.384m-10.253 1.5H9.7m8.075-9.75c.01.05.027.1.05.148.593 1.2.925 2.55.925 3.977 0 1.487-.36 2.89-.999 4.125m.023-8.25c-.076-.365.183-.75.575-.75h.908c.889 0 1.713.518 1.972 1.368.339 1.11.521 2.287.521 3.507 0 1.553-.295 3.036-.831 4.398-.306.774-1.086 1.227-1.918 1.227h-1.053c-.472 0-.745-.556-.5-.96a8.95 8.95 0 0 0 .303-.54" />
+</svg>
diff --git a/public/assets/styles/utility/display.scss b/public/assets/styles/utility/display.scss
index b424a7505..70738cc13 100644
--- a/public/assets/styles/utility/display.scss
+++ b/public/assets/styles/utility/display.scss
@@ -207,8 +207,11 @@
border: 1px solid transparent;
}
-.border-2 {
- border: 2px solid transparent;
+
+@each $i in 2, 3, 4, 6 {
+ .border-#{$i} {
+ border: #{$i}px solid transparent;
+ }
}
.clickable {
@@ -222,6 +225,3 @@
}
}
-.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 4d5527a70..cf6acbc31 100644
--- a/public/assets/styles/utility/text.scss
+++ b/public/assets/styles/utility/text.scss
@@ -54,6 +54,10 @@ pre:last-child {
font-size: get("font.size.sm");
}
+.text-lg {
+ font-size: get("font.size.lg");
+}
+
.text-category {
font-size: get("font.size.xs");
font-weight: get("font.weight.semibold");
diff --git a/public/assets/styles/variables/_colors.scss b/public/assets/styles/variables/_colors.scss
index 3bb92364f..6358a60cd 100644
--- a/public/assets/styles/variables/_colors.scss
+++ b/public/assets/styles/variables/_colors.scss
@@ -1,14 +1,14 @@
$colors: (
"gray": (
- "100": #FCFAFA,
- "200": #EEEBEB,
- "300": #E0DCDD,
- "400": #D2CDCF,
- "500": #C4BEC0,
- "600": #9D9598,
- "700": #756E71,
- "800": #4E474B,
- "900": #262225,
+ "900": #111827,
+ "800": #1f2937,
+ "700": #374151,
+ "600": #4b5563,
+ "500": #6b7280,
+ "400": #9ca3af,
+ "300": #d1d5db,
+ "200": #e5e7eb,
+ "100": #f3f4f6,
"50": #f9fafb,
),
"green": (
@@ -37,13 +37,13 @@ $colors: (
"50": #fffbeb,
),
"blue": (
- "100": #F2F2FF,
- "200": #C2C4FF,
- "300": #909BFD,
- "400": #5E76F7,
- "500": #2D57ED,
- "600": #0F3EBB,
- "700": #03308A,
+ "100": #f2f2ff,
+ "200": #c2c4ff,
+ "300": #909bfd,
+ "400": #5e76f7,
+ "500": #2d57ed,
+ "600": #0f3ebb,
+ "700": #03308a,
"800": #002358,
"900": #001126,
"50": #f0f9ff,
@@ -61,9 +61,10 @@ $colors: (
"50": #fef2f2,
),
"primary": (
- "light": var(--primary-color-light, #C2C4FF),
- "base": var(--primary-color, #2D57ED),
- "dark": var(--primary-color-dark, #03308A),
+ "light": var(--primary-color-light, #c2c4ff),
+ "base": var(--primary-color, #2d57ed),
+ "dark": var(--primary-color-dark, #03308a),
),
"white": #fff,
-);
\ No newline at end of file
+);
+
diff --git a/public/components/ShowPostResponse.tsx b/public/components/ShowPostResponse.tsx
index 50db95462..065b0d093 100644
--- a/public/components/ShowPostResponse.tsx
+++ b/public/components/ShowPostResponse.tsx
@@ -2,56 +2,98 @@ import React from "react"
import { PostResponse, PostStatus } from "@fider/models"
import { Icon, Markdown } from "@fider/components"
import HeroIconDuplicate from "@fider/assets/images/heroicons-duplicate.svg"
+import HeroIconSmile from "@fider/assets/images/heroicons-smile.svg"
+import HeroIconStar from "@fider/assets/images/heroicons-star.svg"
+import HeroIconThumbsUp from "@fider/assets/images/heroicons-thumbsup.svg"
+import HeroIconInbox from "@fider/assets/images/heroicons-inbox.svg"
+import { t } from "@lingui/macro"
+
import { HStack } from "./layout"
+import { timeSince } from "@fider/services"
-const DuplicateDetails = (props: PostResponseProps): JSX.Element | null => {
- if (!props.response) {
- return null
- }
+// const DuplicateDetails = (props: PostResponseProps): JSX.Element | null => {
+// if (!props.response) {
+// return null
+// }
- const original = props.response.original
- if (!original) {
- return null
- }
+// const original = props.response.original
+// if (!original) {
+// return null
+// }
- return (
- <HStack>
- <Icon sprite={HeroIconDuplicate} className="h-6 text-gray-500" />
- <a className="text-link" href={`/posts/${original.number}/${original.slug}`}>
- {original.title}
- </a>
- </HStack>
- )
-}
+// return (
+// <HStack>
+// <Icon sprite={HeroIconDuplicate} className="h-6 text-gray-500" />
+// <a className="text-link" href={`/posts/${original.number}/${original.slug}`}>
+// {original.title}
+// </a>
+// </HStack>
+// )
+// }
interface PostResponseProps {
status: string
response: PostResponse | null
}
-const StatusDetails = (props: PostResponseProps): JSX.Element | null => {
- if (!props.response || !props.response.text) {
+export const ResponseDetails = (props: PostResponseProps): JSX.Element | null => {
+ const status = PostStatus.Get(props.status)
+ const id = `enum.poststatus.${status.value}`
+ const statusLabel = t({ id, message: status.title })
+
+ if (!props.response || status === PostStatus.Open) {
return null
}
+ const title = t({
+ id: "showpost.response.date",
+ message: "Status changed to {status} on {statusDate}",
+ values: { status: statusLabel, statusDate: timeSince("en", new Date(), props.response.respondedAt, "date") },
+ })
+
return (
- <div className="content">
- <Markdown text={props.response.text} style="full" />
+ <div className="bg-blue-50 p-2 border border-blue-200 rounded">
+ <div>{title}</div>
+ {props.response?.text && status !== PostStatus.Duplicate && (
+ <div className="content pt-1">
+ <Markdown text={props.response.text} style="full" />
+ </div>
+ )}
+
+ {status === PostStatus.Duplicate && props.response.original && (
+ <div className="content pt-1">
+ <a className="text-link" href={`/posts/${props.response.original.number}/${props.response.original.slug}`}>
+ {props.response.original.title}
+ </a>
+ </div>
+ )}
</div>
)
}
-export const ShowPostResponse = (props: PostResponseProps): JSX.Element | null => {
- const status = PostStatus.Get(props.status)
-
- if (props.response && (status.show || props.response.text)) {
- return (
- <div>
- {status.show && <div className={`p-2 text-white text-center text-semibold c-status-bg--${status.value}`}>{status.title}</div>}
- <div className="pt-2">{status === PostStatus.Duplicate ? DuplicateDetails(props) : StatusDetails(props)}</div>
- </div>
- )
+const getStatusIcon = (status: PostStatus): SpriteSymbol => {
+ switch (status) {
+ case PostStatus.Duplicate:
+ return HeroIconDuplicate
+ case PostStatus.Completed:
+ return HeroIconStar
+ case PostStatus.Planned:
+ return HeroIconThumbsUp
+ case PostStatus.Started:
+ return HeroIconSmile
}
+ return HeroIconInbox
+}
- return null
+export const ResponseStatusLabel = (props: PostResponseProps): JSX.Element | null => {
+ const status = PostStatus.Get(props.status)
+
+ return (
+ <>
+ <HStack>
+ <Icon sprite={getStatusIcon(status)} className={`h-6 c-status-col--${status.value}`} />
+ <span className={`text-semibold text-lg c-status-col--${status.value}`}>{status.title}</span>
+ </HStack>
+ </>
+ )
}
diff --git a/public/components/ShowPostStatus.scss b/public/components/ShowPostStatus.scss
index 7f82d9e3e..86dbdd1ba 100644
--- a/public/components/ShowPostStatus.scss
+++ b/public/components/ShowPostStatus.scss
@@ -1,28 +1,28 @@
@import "~@fider/assets/styles/variables.scss";
-.c-status-bg {
+.c-status-col {
&--open {
- background-color: get("colors.gray.900");
+ color: get("colors.blue.600");
}
&--planned {
- background-color: #6435c9;
+ color: #6435c9;
}
&--started {
- background-color: #2185d0;
+ color: #2185d0;
}
&--completed {
- background-color: #21ba45;
+ color: #21ba45;
}
&--declined {
- background-color: #db2828;
+ color: #db2828;
}
&--duplicate {
- background-color: #d6a100;
+ color: #d6a100;
}
}
diff --git a/public/pages/Home/components/ListPosts.tsx b/public/pages/Home/components/ListPosts.tsx
index e6d63a0b2..cc02b1faf 100644
--- a/public/pages/Home/components/ListPosts.tsx
+++ b/public/pages/Home/components/ListPosts.tsx
@@ -1,6 +1,6 @@
import React from "react"
import { Post, Tag, CurrentUser } from "@fider/models"
-import { ShowTag, ShowPostResponse, VoteCounter, Markdown, Icon } from "@fider/components"
+import { ShowTag, VoteCounter, Markdown, Icon, ResponseStatusLabel } from "@fider/components"
import IconChatAlt2 from "@fider/assets/images/heroicons-chat-alt-2.svg"
import { HStack, VStack } from "@fider/components/layout"
@@ -28,7 +28,7 @@ const ListPostItem = (props: { post: Post; user?: CurrentUser; tags: Tag[] }) =>
)}
</HStack>
<Markdown className="text-gray-600" maxLength={300} text={props.post.description} style="plainText" />
- <ShowPostResponse status={props.post.status} response={props.post.response} />
+ <ResponseStatusLabel status={props.post.status} response={props.post.response} />
{props.tags.length >= 1 && (
<HStack className="flex-wrap">
{props.tags.map((tag) => (
diff --git a/public/pages/ShowPost/ShowPost.page.tsx b/public/pages/ShowPost/ShowPost.page.tsx
index 350b1f216..ea92ed3f8 100644
--- a/public/pages/ShowPost/ShowPost.page.tsx
+++ b/public/pages/ShowPost/ShowPost.page.tsx
@@ -7,7 +7,8 @@ import { actions, clearUrlHash, Failure, Fider, notify, timeAgo } from "@fider/s
import IconDotsHorizontal from "@fider/assets/images/heroicons-dots-horizontal.svg"
import {
- ShowPostResponse,
+ ResponseStatusLabel,
+ ResponseDetails,
Button,
UserName,
Moment,
@@ -35,7 +36,7 @@ import IconX from "@fider/assets/images/heroicons-x.svg"
import IconThumbsUp from "@fider/assets/images/heroicons-thumbsup.svg"
import { HStack, VStack } from "@fider/components/layout"
import { Trans } from "@lingui/macro"
-import { TagsPanel2 } from "./components/TagsPanel2"
+// import { TagsPanel2 } from "./components/TagsPanel2"
import { NotificationsPanel2 } from "./components/NotificationsPanel2"
import { VoteSection } from "./components/VoteSection"
import { ModerationPanel } from "./components/ModerationPanel"
@@ -191,24 +192,7 @@ export default class ShowPostPage extends React.Component<ShowPostPageProps, Sho
<div className="p-show-post__header-col">
<VStack spacing={8}>
<HStack justify="between">
- <div className="flex-grow">
- {this.state.editMode ? (
- <Form error={this.state.error}>
- <Input field="title" maxLength={100} value={this.state.newTitle} onChange={this.setNewTitle} />
- </Form>
- ) : (
- <>
- <h1 className="text-large">{this.props.post.title}</h1>
- <div className="mt-2">
- <TagsPanel2 post={this.props.post} tags={this.props.tags} />
- </div>
- </>
- )}
- </div>
- <ModerationPanel onModalClose={() => this.setShowDeleteModal(false)} showModal={this.state.showDeleteModal} post={this.props.post} />
- {Fider.session.user.isCollaborator && (
- <ResponseModal onCloseModal={() => this.setShowResponseModal(false)} showModal={this.state.showResponseModal} post={this.props.post} />
- )}
+ <ResponseStatusLabel status={this.props.post.status} response={this.props.post.response} />
{!this.state.editMode && (
<Dropdown position="left" renderHandle={<Icon sprite={IconDotsHorizontal} width="24" height="24" />}>
<Dropdown.ListItem onClick={this.onActionSelected("copy")}>
@@ -234,16 +218,35 @@ export default class ShowPostPage extends React.Component<ShowPostPageProps, Sho
</Dropdown>
)}
</HStack>
+ <ResponseDetails status={this.props.post.status} response={this.props.post.response} />
+
+ <HStack justify="between">
+ <div className="flex-grow">
+ {this.state.editMode ? (
+ <Form error={this.state.error}>
+ <Input field="title" maxLength={100} value={this.state.newTitle} onChange={this.setNewTitle} />
+ </Form>
+ ) : (
+ <>
+ <h1 className="text-large">{this.props.post.title}</h1>
+ {/* <div className="mt-2"> */}
+ {/* <TagsPanel2 post={this.props.post} tags={this.props.tags} /> */}
+ {/* </div> */}
+ </>
+ )}
+ </div>
+ <ModerationPanel onModalClose={() => this.setShowDeleteModal(false)} showModal={this.state.showDeleteModal} post={this.props.post} />
+ {Fider.session.user.isCollaborator && (
+ <ResponseModal onCloseModal={() => this.setShowResponseModal(false)} showModal={this.state.showResponseModal} post={this.props.post} />
+ )}
+ </HStack>
{!this.state.editMode && (
- <HStack spacing={4} justify="between">
- <HStack>
- <Avatar user={this.props.post.user} />
- <VStack spacing={1}>
- <UserName user={this.props.post.user} />
- <Moment className="text-muted" locale={Fider.currentLocale} date={this.props.post.createdAt} />
- </VStack>
- </HStack>
- <NotificationsPanel2 post={this.props.post} subscribed={this.props.subscribed} />
+ <HStack>
+ <Avatar user={this.props.post.user} />
+ <VStack spacing={1}>
+ <UserName user={this.props.post.user} />
+ <Moment className="text-muted" locale={Fider.currentLocale} date={this.props.post.createdAt} />
+ </VStack>
</HStack>
)}
<VStack>
@@ -266,11 +269,13 @@ export default class ShowPostPage extends React.Component<ShowPostPageProps, Sho
</>
)}
</VStack>
- <ShowPostResponse status={this.props.post.status} response={this.props.post.response} />
<VStack spacing={4}>
{!this.state.editMode ? (
- <VoteSection post={this.props.post} votes={this.props.votes} />
+ <HStack justify="between" center={false}>
+ <VoteSection post={this.props.post} votes={this.props.votes} />
+ <NotificationsPanel2 post={this.props.post} subscribed={this.props.subscribed} />
+ </HStack>
) : (
<HStack>
<Button variant="primary" onClick={this.saveChanges} disabled={Fider.isReadOnly}>
@@ -287,7 +292,7 @@ export default class ShowPostPage extends React.Component<ShowPostPageProps, Sho
</Button>
</HStack>
)}
- <div className="purple-border" />
+ <div className="border-4 border-blue-500" />
</VStack>
</VStack>
</div>
diff --git a/public/pages/ShowPost/components/PostStatus.tsx b/public/pages/ShowPost/components/PostStatus.tsx
new file mode 100644
index 000000000..e69de29bb
diff --git a/public/pages/ShowPost/components/VoteSection.tsx b/public/pages/ShowPost/components/VoteSection.tsx
index f5f6754a2..5c8c15b01 100644
--- a/public/pages/ShowPost/components/VoteSection.tsx
+++ b/public/pages/ShowPost/components/VoteSection.tsx
@@ -6,8 +6,8 @@ import { useFider } from "@fider/hooks"
import IconThumbsUp from "@fider/assets/images/heroicons-thumbsup.svg"
import IconCheck from "@fider/assets/images/heroicons-check.svg"
import { Trans } from "@lingui/macro"
-import { HStack } from "@fider/components/layout"
-import { VotesPanel } from "./VotesPanel"
+import { HStack, VStack } from "@fider/components/layout"
+// import { VotesPanel } from "./VotesPanel"
interface VoteSectionProps {
post: Post
@@ -50,7 +50,7 @@ export const VoteSection = (props: VoteSectionProps) => {
const icon = hasVoted ? IconCheck : IconThumbsUp
return (
- <>
+ <VStack spacing={4}>
<SignInModal isOpen={isSignInModalOpen} onClose={hideModal} />
<div className="align-self-start">
<Button variant="primary" onClick={voteOrUndo} disabled={isDisabled}>
@@ -61,10 +61,10 @@ export const VoteSection = (props: VoteSectionProps) => {
<span className="text-display">
{votes.length} {votes.length === 1 ? "Vote" : "Votes"}
</span>
- <div className="pl-4">
+ {/* <div className="pl-4">
<VotesPanel post={post} votes={votes} hideTitle={true} />
- </div>
+ </div> */}
</HStack>
- </>
+ </VStack>
)
}
diff --git a/public/services/utils.ts b/public/services/utils.ts
index 969f9e9d2..fbb80db96 100644
--- a/public/services/utils.ts
+++ b/public/services/utils.ts
@@ -38,7 +38,7 @@ export const formatDate = (locale: string, input: Date | string, format: DateFor
}
}
-export const timeSince = (locale: string, now: Date, date: Date): string => {
+export const timeSince = (locale: string, now: Date, date: Date, dateFormat: DateFormat = "short"): string => {
try {
const seconds = Math.round((now.getTime() - date.getTime()) / 1000)
const minutes = Math.round(seconds / 60)
@@ -57,10 +57,9 @@ export const timeSince = (locale: string, now: Date, date: Date): string => {
rtf.format(-1 * years, "years")
)
} catch {
- return formatDate(locale, date, "short")
+ return formatDate(locale, date, dateFormat)
}
}
-
export const fileToBase64 = async (file: File): Promise<string> => {
return new Promise<string>((resolve, reject) => {
const reader = new FileReader()