code review
This commit is contained in:
parent
961a122279
commit
1752bf5198
|
@ -19,19 +19,21 @@ type Props = {
|
|||
export const Draft = (props: Props) => {
|
||||
const { t } = useLocalize()
|
||||
|
||||
const handlePublishLinkClick = () => {
|
||||
const handlePublishLinkClick = (e) => {
|
||||
e.preventDefault()
|
||||
props.onPublish(props.shout)
|
||||
}
|
||||
|
||||
const handleDeleteLinkClick = () => {
|
||||
const handleDeleteLinkClick = (e) => {
|
||||
e.preventDefault()
|
||||
props.onDelete(props.shout)
|
||||
}
|
||||
|
||||
return (
|
||||
<div class={clsx(props.class)}>
|
||||
<div class={styles.created}>
|
||||
<Icon name="pencil-outline" class={styles.icon} /> {formatDate(new Date(props.shout.createdAt))}{' '}
|
||||
{formatDateTime(props.shout.createdAt)()}
|
||||
<Icon name="pencil-outline" class={styles.icon} /> {formatDate(new Date(props.shout.createdAt))}
|
||||
{formatDateTime(props.shout.createdAt)()}
|
||||
</div>
|
||||
<div class={styles.titleContainer}>
|
||||
<span class={styles.title}>{props.shout.title || t('Unnamed draft')}</span> {props.shout.subtitle}
|
||||
|
|
|
@ -37,11 +37,13 @@ export const Panel = (props: Props) => {
|
|||
}
|
||||
})
|
||||
|
||||
const handleSaveLinkClick = () => {
|
||||
const handleSaveLinkClick = (e) => {
|
||||
e.preventDefault()
|
||||
saveShout()
|
||||
}
|
||||
|
||||
const handlePublishLinkClick = () => {
|
||||
const handlePublishLinkClick = (e) => {
|
||||
e.preventDefault()
|
||||
publishShout()
|
||||
}
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ export const EditorProvider = (props: { children: JSX.Element }) => {
|
|||
openPage(router, 'article', { slug: shout.slug })
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
console.error('[saveShout]', error)
|
||||
showSnackbar({ type: 'error', body: t('Error') })
|
||||
}
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ export const EditorProvider = (props: { children: JSX.Element }) => {
|
|||
publish: true
|
||||
})
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
console.error('[publishShout]', error)
|
||||
showSnackbar({ type: 'error', body: t('Error') })
|
||||
}
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ export const EditorProvider = (props: { children: JSX.Element }) => {
|
|||
|
||||
openPage(router, 'feed')
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
console.error('[publishShoutById]', error)
|
||||
showSnackbar({ type: 'error', body: t('Error') })
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user