From 2bbbc4728da17d87988a3784ae574f9d481d2b16 Mon Sep 17 00:00:00 2001 From: Nevo David Date: Fri, 8 Aug 2025 04:24:43 +0700 Subject: [PATCH] feat: add comment fix --- .../src/components/new-launch/editor.tsx | 97 +++++++++++-------- 1 file changed, 58 insertions(+), 39 deletions(-) diff --git a/apps/frontend/src/components/new-launch/editor.tsx b/apps/frontend/src/components/new-launch/editor.tsx index 84abfeb9..681589fc 100644 --- a/apps/frontend/src/components/new-launch/editor.tsx +++ b/apps/frontend/src/components/new-launch/editor.tsx @@ -368,6 +368,19 @@ export const EditorWrapper: FC<{ dummy={dummy} selectedIntegration={selectedIntegration} chars={chars} + childButton={ + <> + {canEdit ? ( + + ) : ( +
+ )} + + } />
@@ -417,16 +430,6 @@ export const EditorWrapper: FC<{ )}
- - {canEdit ? ( - - ) : ( -
- )}
))} @@ -450,6 +453,7 @@ export const Editor: FC<{ selectedIntegration: SelectedIntegrations[]; dummy: boolean; chars: Record; + childButton?: React.ReactNode; }> = (props) => { const { editorType = 'normal', @@ -463,6 +467,7 @@ export const Editor: FC<{ selectedIntegration, dummy, chars, + childButton, } = props; const user = useUser(); const [id] = useState(makeId(10)); @@ -524,7 +529,7 @@ export const Editor: FC<{ ); return ( -
+
@@ -650,34 +655,48 @@ export const Editor: FC<{
-
- {(props?.totalChars || 0) > 0 ? ( -
props.totalChars && '!text-red-500' - )} - > - {valueWithoutHtml.length}/{props.totalChars} -
- ) : ( -
- {selectedIntegration?.map((p) => ( - -
chars?.[p.integration.id] && '!text-red-500'}> - {p.integration.name} ({capitalize(p.integration.identifier)}): -
-
chars?.[p.integration.id] && '!text-red-500'}> - {valueWithoutHtml.length}/{chars?.[p.integration.id]} -
-
- ))} -
- )} +
+
{childButton}
+
+ {(props?.totalChars || 0) > 0 ? ( +
props.totalChars && '!text-red-500' + )} + > + {valueWithoutHtml.length}/{props.totalChars} +
+ ) : ( +
+ {selectedIntegration?.map((p) => ( + +
chars?.[p.integration.id] && + '!text-red-500' + } + > + {p.integration.name} ({capitalize(p.integration.identifier)} + ): +
+
chars?.[p.integration.id] && + '!text-red-500' + } + > + {valueWithoutHtml.length}/{chars?.[p.integration.id]} +
+
+ ))} +
+ )} +
);