Update the view after a post is created

This commit is contained in:
Paul Frazee 2022-10-04 11:33:32 -05:00
parent 0aaa406b17
commit 236c908058
9 changed files with 79 additions and 9 deletions

View file

@ -16,7 +16,13 @@ const WARNING_TEXT_LENGTH = 200
const DANGER_TEXT_LENGTH = 255
export const snapPoints = ['100%']
export function Component({replyTo}: {replyTo?: string}) {
export function Component({
replyTo,
onPost,
}: {
replyTo?: string
onPost?: () => void
}) {
const store = useStores()
const [error, setError] = useState('')
const [text, setText] = useState('')
@ -72,6 +78,7 @@ export function Component({replyTo}: {replyTo?: string}) {
)
return
}
onPost?.()
store.shell.closeModal()
Toast.show(`Your ${replyTo ? 'reply' : 'post'} has been published`, {
duration: Toast.durations.LONG,