summaryrefslogtreecommitdiffstats
path: root/ui/src/components/inbox.tsx
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-01-22 22:29:11 -0500
committerDessalines <tyhou13@gmx.com>2020-01-22 22:29:11 -0500
commit3b4258096c3c3dc160090436c9205e1ecf2e8e75 (patch)
treef07264d3de3b169c6140b2bf303ff7732d908b0a /ui/src/components/inbox.tsx
parent66af9623d90aadd47c9cf37faeac4f60f1d818d4 (diff)
Adding a toaster to replace alerts. Fixes #457
Diffstat (limited to 'ui/src/components/inbox.tsx')
-rw-r--r--ui/src/components/inbox.tsx12
1 files changed, 4 insertions, 8 deletions
diff --git a/ui/src/components/inbox.tsx b/ui/src/components/inbox.tsx
index 6a426bcc..bf090179 100644
--- a/ui/src/components/inbox.tsx
+++ b/ui/src/components/inbox.tsx
@@ -18,7 +18,7 @@ import {
PrivateMessageResponse,
} from '../interfaces';
import { WebSocketService, UserService } from '../services';
-import { msgOp, fetchLimit, isCommentType } from '../utils';
+import { msgOp, fetchLimit, isCommentType, toast } from '../utils';
import { CommentNodes } from './comment-nodes';
import { PrivateMessage } from './private-message';
import { SortSelect } from './sort-select';
@@ -198,11 +198,7 @@ export class Inbox extends Component<any, InboxState> {
<div>
{combined.map(i =>
isCommentType(i) ? (
- <CommentNodes
- nodes={[{ comment: i }]}
- noIndent
- markable
- />
+ <CommentNodes nodes={[{ comment: i }]} noIndent markable />
) : (
<PrivateMessage privateMessage={i} />
)
@@ -328,7 +324,7 @@ export class Inbox extends Component<any, InboxState> {
console.log(msg);
let op: UserOperation = msgOp(msg);
if (msg.error) {
- alert(i18n.t(msg.error));
+ toast(i18n.t(msg.error), 'danger');
return;
} else if (op == UserOperation.GetReplies) {
let res: GetRepliesResponse = msg;
@@ -423,7 +419,7 @@ export class Inbox extends Component<any, InboxState> {
this.setState(this.state);
} else if (op == UserOperation.CreateComment) {
// let res: CommentResponse = msg;
- alert(i18n.t('reply_sent'));
+ toast(i18n.t('reply_sent'));
// this.state.replies.unshift(res.comment); // TODO do this right
// this.setState(this.state);
} else if (op == UserOperation.SaveComment) {