From 09f57447c6435e0cdbe1f18fe594414b75c3cbf1 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 19 Oct 2021 12:29:54 -0500 Subject: [PATCH] Compose: preliminary toast upon submission --- app/soapbox/actions/compose.js | 2 ++ app/soapbox/actions/snackbar.js | 3 ++- app/styles/components/snackbar.scss | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/soapbox/actions/compose.js b/app/soapbox/actions/compose.js index 11d842315..d2c1518a0 100644 --- a/app/soapbox/actions/compose.js +++ b/app/soapbox/actions/compose.js @@ -72,6 +72,7 @@ const messages = defineMessages({ uploadErrorLimit: { id: 'upload_error.limit', defaultMessage: 'File upload limit exceeded.' }, uploadErrorPoll: { id: 'upload_error.poll', defaultMessage: 'File upload not allowed with polls.' }, scheduleError: { id: 'compose.invalid_schedule', defaultMessage: 'You must schedule a post at least 5 minutes out.' }, + success: { id: 'compose.submit_success', defaultMessage: 'Your post was sent' }, }); const COMPOSE_PANEL_BREAKPOINT = 600 + (285 * 1) + (10 * 1); @@ -154,6 +155,7 @@ export function handleComposeSubmit(dispatch, getState, data, status) { dispatch(insertIntoTagHistory(data.tags || [], status)); dispatch(submitComposeSuccess({ ...data })); + dispatch(snackbar.show('post', messages.success)); } const needsDescriptions = state => { diff --git a/app/soapbox/actions/snackbar.js b/app/soapbox/actions/snackbar.js index 1872c82bd..c1be02757 100644 --- a/app/soapbox/actions/snackbar.js +++ b/app/soapbox/actions/snackbar.js @@ -1,6 +1,6 @@ import { ALERT_SHOW } from './alerts'; -const show = (severity, message) => ({ +export const show = (severity, message) => ({ type: ALERT_SHOW, message, severity, @@ -22,4 +22,5 @@ export default { info, success, error, + show, }; diff --git a/app/styles/components/snackbar.scss b/app/styles/components/snackbar.scss index 9889cda28..ffbb4c502 100644 --- a/app/styles/components/snackbar.scss +++ b/app/styles/components/snackbar.scss @@ -32,6 +32,10 @@ } } + &--post { + background-color: #0482d8 !important; + } + &--success { background-color: #199e5a !important;