From 88ecd906f9ba9c368d9a9bc8c4c0d67730872140 Mon Sep 17 00:00:00 2001 From: ilya-bkv Date: Mon, 12 Feb 2024 11:12:23 +0300 Subject: [PATCH] Change publish btn action --- src/components/Editor/Panel/Panel.tsx | 7 +------ src/components/Nav/HeaderAuth.tsx | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/components/Editor/Panel/Panel.tsx b/src/components/Editor/Panel/Panel.tsx index c6503473..1a391a5f 100644 --- a/src/components/Editor/Panel/Panel.tsx +++ b/src/components/Editor/Panel/Panel.tsx @@ -47,11 +47,6 @@ export const Panel = (props: Props) => { const handleSaveClick = () => { saveShout(form) } - const { showSnackbar } = useSnackbar() - const handlePublishClick = () => { - if (form.mainTopic) publishShout(form) - else showSnackbar({ body: t('Please, set the main topic first') }) - } const html = useEditorHTML(() => editorRef.current()) @@ -74,7 +69,7 @@ export const Panel = (props: Props) => {

- + publishShout(form)}> {t('Publish')}

diff --git a/src/components/Nav/HeaderAuth.tsx b/src/components/Nav/HeaderAuth.tsx index 1d7851ab..31a0acc6 100644 --- a/src/components/Nav/HeaderAuth.tsx +++ b/src/components/Nav/HeaderAuth.tsx @@ -63,11 +63,6 @@ export const HeaderAuth = (props: Props) => { const handleSaveButtonClick = () => { saveShout(form) } - const { showSnackbar } = useSnackbar() - const handlePublishButtonClick = () => { - if (form.mainTopic) publishShout(form) - else showSnackbar({ body: t('Please, set the main topic first') }) - } const [width, setWidth] = createSignal(0) @@ -160,7 +155,7 @@ export const HeaderAuth = (props: Props) => { {renderIconedButton({ value: t('Publish'), icon: 'publish', - action: handlePublishButtonClick, + action: () => publishShout(form), })}