Change publish btn action
This commit is contained in:
parent
b3e3068a8d
commit
88ecd906f9
|
@ -47,11 +47,6 @@ export const Panel = (props: Props) => {
|
||||||
const handleSaveClick = () => {
|
const handleSaveClick = () => {
|
||||||
saveShout(form)
|
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())
|
const html = useEditorHTML(() => editorRef.current())
|
||||||
|
|
||||||
|
@ -74,7 +69,7 @@ export const Panel = (props: Props) => {
|
||||||
<div class={clsx(styles.actionsHolder, styles.scrolled, { hidden: isShortcutsVisible() })}>
|
<div class={clsx(styles.actionsHolder, styles.scrolled, { hidden: isShortcutsVisible() })}>
|
||||||
<section>
|
<section>
|
||||||
<p>
|
<p>
|
||||||
<span class={styles.link} onClick={handlePublishClick}>
|
<span class={styles.link} onClick={() => publishShout(form)}>
|
||||||
{t('Publish')}
|
{t('Publish')}
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -63,11 +63,6 @@ export const HeaderAuth = (props: Props) => {
|
||||||
const handleSaveButtonClick = () => {
|
const handleSaveButtonClick = () => {
|
||||||
saveShout(form)
|
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)
|
const [width, setWidth] = createSignal(0)
|
||||||
|
|
||||||
|
@ -160,7 +155,7 @@ export const HeaderAuth = (props: Props) => {
|
||||||
{renderIconedButton({
|
{renderIconedButton({
|
||||||
value: t('Publish'),
|
value: t('Publish'),
|
||||||
icon: 'publish',
|
icon: 'publish',
|
||||||
action: handlePublishButtonClick,
|
action: () => publishShout(form),
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user