From 57b592b5aa9254bcb8c2851ac299496fbcab252b Mon Sep 17 00:00:00 2001 From: mantikoros Date: Sun, 2 Oct 2022 12:55:58 -0500 Subject: [PATCH] show toast after comment tips --- web/components/tipper.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/components/tipper.tsx b/web/components/tipper.tsx index 9d5cac84..b201f946 100644 --- a/web/components/tipper.tsx +++ b/web/components/tipper.tsx @@ -1,5 +1,6 @@ -import { debounce, sum } from 'lodash' import { useEffect, useRef, useState } from 'react' +import toast from 'react-hot-toast' +import { debounce, sum } from 'lodash' import { Comment } from 'common/comment' import { User } from 'common/user' @@ -10,6 +11,7 @@ import { track } from 'web/lib/service/analytics' import { TipButton } from './contract/tip-button' import { Row } from './layout/row' import { LIKE_TIP_AMOUNT } from 'common/like' +import { formatMoney } from 'common/util/format' export function Tipper(prop: { comment: Comment; tips: CommentTips }) { const { comment, tips } = prop @@ -72,6 +74,7 @@ export function Tipper(prop: { comment: Comment; tips: CommentTips }) { const addTip = (delta: number) => { setLocalTip(localTip + delta) me && saveTip(me, comment, localTip - savedTip + delta) + toast(`You tipped ${comment.userName} ${formatMoney(LIKE_TIP_AMOUNT)}!`) } const canUp =