Skip to content

Commit

Permalink
Merge pull request #397 from WalletConnect/refactor/toast-messages
Browse files Browse the repository at this point in the history
refactor: update toast messages
  • Loading branch information
enesozturk authored Jan 15, 2024
2 parents 5695f43 + a67252b commit 05e282f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Text from '@/components/general/Text'
import W3iContext from '@/contexts/W3iContext/context'
import { useModals } from '@/utils/hooks'
import { unsubscribeModalService } from '@/utils/store'
import { showErrorMessageToast, showSuccessMessageToast } from '@/utils/toasts'
import { showDefaultToast, showErrorMessageToast } from '@/utils/toasts'

import './UnsubscribeModal.scss'

Expand All @@ -32,9 +32,7 @@ export const UnsubscribeModal: React.FC = () => {
notifyClientProxy.observeOne('notify_delete', {
next: () => {
unsubscribeModalService.closeModal()
showSuccessMessageToast(
`Successfully unsubscribed from ${app ? app.metadata.name : `dapp`}`
)
showDefaultToast(`Unsubscribed from ${app ? app.metadata.name : `dapp`}`)
setLoading(false)
navigate('/notifications/new-app')
}
Expand Down
4 changes: 4 additions & 0 deletions src/utils/toasts.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import toast from 'react-hot-toast'

export const showDefaultToast = (message: string) => {
toast(message)
}

export const showSuccessMessageToast = (message: string) => {
toast.success(message)
}
Expand Down

1 comment on commit 05e282f

@vercel
Copy link

@vercel vercel bot commented on 05e282f Jan 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.