From 7b9242da2bcc3fed1d43a799ac44c1910dbe7624 Mon Sep 17 00:00:00 2001 From: Megha-Dev-19 Date: Thu, 7 Dec 2023 15:42:14 +0530 Subject: [PATCH 1/8] fix solution action --- src/devhub/entity/post/PostEditor.jsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/devhub/entity/post/PostEditor.jsx b/src/devhub/entity/post/PostEditor.jsx index cff6067ea..4e55daefd 100644 --- a/src/devhub/entity/post/PostEditor.jsx +++ b/src/devhub/entity/post/PostEditor.jsx @@ -1,3 +1,10 @@ +const cleanDescription = (description) => { + return description ? description.replace( + /###### Requested amount: .+?\n###### Requested sponsor: @[^\s]+\n/g, + "" + ) : description +}; + initState({ seekingFunding: props.seekingFunding ?? false, author_id: context.accountId, @@ -89,13 +96,6 @@ const labels = labelStrings.map((s) => { return { name: s }; }); -const cleanDescription = (description) => { - return description.replace( - /###### Requested amount: .+?\n###### Requested sponsor: @[^\s]+\n/g, - "" - ); -}; - if (!state.draftStateApplied && props.draftState) { State.update({ ...props.draftState, draftStateApplied: true }); } From c31e5ca8c883c74f5523003fb9ef75c12718961b Mon Sep 17 00:00:00 2001 From: Megha-Dev-19 Date: Mon, 22 Apr 2024 15:21:54 +0530 Subject: [PATCH 2/8] fix preview for proposals --- src/devhub/components/molecule/Compose.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devhub/components/molecule/Compose.jsx b/src/devhub/components/molecule/Compose.jsx index 059ae8cda..b681af491 100644 --- a/src/devhub/components/molecule/Compose.jsx +++ b/src/devhub/components/molecule/Compose.jsx @@ -95,7 +95,7 @@ const Compose = ({ "${REPL_DEVHUB}/widget/devhub.components.molecule.MarkdownViewer" } props={{ - text: data, + text: state.data, }} /> From 910df8c8f113509235b28724c59080fb7f3d7a88 Mon Sep 17 00:00:00 2001 From: Megha-Dev-19 <100185149+Megha-Dev-19@users.noreply.github.com> Date: Tue, 1 Oct 2024 15:13:56 +0530 Subject: [PATCH 3/8] remove markdown iframe --- .../devhub/components/molecule/Compose.jsx | 10 - .../components/molecule/SimpleMDEViewer.jsx | 190 ++++++------------ .../entity/proposal/CommentsAndLogs.jsx | 5 - .../devhub/entity/proposal/Proposal.jsx | 5 - .../devhub/components/molecule/Compose.jsx | 5 - .../entity/proposal/CommentsAndLogs.jsx | 5 - .../devhub/entity/proposal/Proposal.jsx | 5 - .../widget/components/molecule/Compose.jsx | 5 - .../widget/components/proposals/Proposal.jsx | 5 - .../widget/components/rfps/Rfp.jsx | 5 - 10 files changed, 67 insertions(+), 173 deletions(-) diff --git a/instances/devhub.near/widget/devhub/components/molecule/Compose.jsx b/instances/devhub.near/widget/devhub/components/molecule/Compose.jsx index 5484fe0eb..0ae8c0b62 100644 --- a/instances/devhub.near/widget/devhub/components/molecule/Compose.jsx +++ b/instances/devhub.near/widget/devhub/components/molecule/Compose.jsx @@ -116,11 +116,6 @@ const Compose = ({ src={`${REPL_DEVHUB}/widget/devhub.components.molecule.SimpleMDEViewer`} props={{ content: state.data, - embeddCSS: ` - body{ - font-size:14px; - } - `, }} /> @@ -189,11 +184,6 @@ const Compose = ({ src={`${REPL_DEVHUB}/widget/devhub.components.molecule.SimpleMDEViewer`} props={{ content: state.data, - embeddCSS: ` - body { - font-size: 14px; - } - `, }} /> diff --git a/instances/devhub.near/widget/devhub/components/molecule/SimpleMDEViewer.jsx b/instances/devhub.near/widget/devhub/components/molecule/SimpleMDEViewer.jsx index bdaa0fd25..ff9b649f6 100644 --- a/instances/devhub.near/widget/devhub/components/molecule/SimpleMDEViewer.jsx +++ b/instances/devhub.near/widget/devhub/components/molecule/SimpleMDEViewer.jsx @@ -1,139 +1,83 @@ const content = props.content ?? ""; -const height = props.height; const embeddCSS = props.embeddCSS; -const [iframeHeight, setIframeHeight] = useState("100px"); -const code = ` - - - - - - - - - - -
- - - - - `; +const renderMention = + props.renderMention ?? + ((accountId) => ( + + + + )); +const processedContent = content + .replace(//gi, " \n") + .replace(/\n/g, " \n"); return ( -