Skip to content

Commit f279e68

Browse files
authored
Show "Open" post response if there is one (#1305)
1 parent e83d7fc commit f279e68

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

Lines changed: 3 additions & 0 deletions
Loading

public/components/ShowPostResponse.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Icon, Markdown } from "@fider/components"
44
import HeroIconDuplicate from "@fider/assets/images/heroicons-duplicate.svg"
55
import HeroIconCheck from "@fider/assets/images/heroicons-check-circle.svg"
66
import HeroIconSparkles from "@fider/assets/images/heroicons-sparkles-outline.svg"
7+
import HeroIconLightBulb from "@fider/assets/images/heroicons-lightbulb.svg"
78
import HeroIconThumbsUp from "@fider/assets/images/heroicons-thumbsup.svg"
89
import HeroIconThumbsDown from "@fider/assets/images/heroicons-thumbsdown.svg"
910
import { HStack, VStack } from "./layout"
@@ -18,7 +19,7 @@ interface PostResponseProps {
1819
export const ResponseDetails = (props: PostResponseProps): JSX.Element | null => {
1920
const status = PostStatus.Get(props.status)
2021

21-
if (!props.response || status === PostStatus.Open) {
22+
if (!props.response) {
2223
return null
2324
}
2425

@@ -53,6 +54,8 @@ const getLozengeProps = (status: PostStatus): { icon: SpriteSymbol; bg: string;
5354
return { icon: HeroIconCheck, bg: "bg-green-300", color: "text-green-800", border: "border-green-500" }
5455
case PostStatus.Planned:
5556
return { icon: HeroIconThumbsUp, bg: "bg-blue-100", color: "text-blue-700", border: "border-blue-400" }
57+
case PostStatus.Open:
58+
return { icon: HeroIconLightBulb, bg: "bg-blue-100", color: "text-blue-700", border: "border-blue-400" }
5659
default:
5760
return { icon: HeroIconSparkles, bg: "bg-green-100", color: "text-green-700", border: "border-green-400" }
5861
}
@@ -62,10 +65,6 @@ export const ResponseLozenge = (props: PostResponseProps): JSX.Element | null =>
6265
const status = PostStatus.Get(props.status)
6366
const { icon, bg, color, border } = getLozengeProps(status)
6467

65-
if (status === PostStatus.Open) {
66-
return <div />
67-
}
68-
6968
return (
7069
<div>
7170
<HStack align="start" className={`${color} ${bg} border ${border} rounded-full p-1 px-3`}>

0 commit comments

Comments
 (0)