From e4a26b66d230dfb1a117fd84e4b3afa9a5c23812 Mon Sep 17 00:00:00 2001 From: Scott Benton Date: Tue, 14 May 2024 00:09:35 -0400 Subject: [PATCH] feat(homebrew): Added description to homebrew --- .../AboutSection/AboutSection.tsx | 15 ++++++++------ .../AboutSection/Description.tsx | 20 ++++++++++++------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/pages/Homebrew/HomebrewEditorPage/AboutSection/AboutSection.tsx b/src/pages/Homebrew/HomebrewEditorPage/AboutSection/AboutSection.tsx index ba38175e..87e174fa 100644 --- a/src/pages/Homebrew/HomebrewEditorPage/AboutSection/AboutSection.tsx +++ b/src/pages/Homebrew/HomebrewEditorPage/AboutSection/AboutSection.tsx @@ -132,12 +132,15 @@ export function AboutSection(props: AboutSectionProps) { /> )} - - - + {(!!details.description || isEditor) && ( + + + + )} {details.type === PackageTypes.Expansion && ( Expansion For diff --git a/src/pages/Homebrew/HomebrewEditorPage/AboutSection/Description.tsx b/src/pages/Homebrew/HomebrewEditorPage/AboutSection/Description.tsx index 17aa346d..9664887a 100644 --- a/src/pages/Homebrew/HomebrewEditorPage/AboutSection/Description.tsx +++ b/src/pages/Homebrew/HomebrewEditorPage/AboutSection/Description.tsx @@ -1,4 +1,5 @@ import { Box } from "@mui/material"; +import { MarkdownRenderer } from "components/shared/MarkdownRenderer"; import { MarkdownEditor } from "components/shared/RichTextEditor/MarkdownEditor"; import { useState } from "react"; import { useStore } from "stores/store"; @@ -6,10 +7,11 @@ import { useStore } from "stores/store"; export interface DescriptionProps { expansionId: string; description?: string; + isEditor?: boolean; } export function Description(props: DescriptionProps) { - const { expansionId, description } = props; + const { expansionId, description, isEditor } = props; const updateDetails = useStore((store) => store.homebrew.updateExpansion); const [localDescription, setLocalDescription] = useState(description ?? ""); @@ -20,12 +22,16 @@ export function Description(props: DescriptionProps) { return ( theme.breakpoints.values.md}> - setLocalDescription(value)} - onBlur={handleSave} - /> + {isEditor ? ( + setLocalDescription(value)} + onBlur={handleSave} + /> + ) : ( + + )} ); }