1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Use flash message instead of toast

This commit is contained in:
Zhiyuan Zheng
2021-02-28 22:49:55 +01:00
parent 78898059cb
commit b20b75f22e
13 changed files with 154 additions and 199 deletions

View File

@ -1,13 +1,14 @@
import analytics from '@components/analytics'
import Button from '@components/Button'
import haptics from '@components/haptics'
import { toast } from '@components/toast'
import { displayMessage } from '@components/Message'
import {
QueryKeyRelationship,
useRelationshipMutation,
useRelationshipQuery
} from '@utils/queryHooks/relationship'
import { QueryKeyTimeline } from '@utils/queryHooks/timeline'
import { useTheme } from '@utils/styles/ThemeManager'
import React from 'react'
import { useTranslation } from 'react-i18next'
import { useQueryClient } from 'react-query'
@ -18,6 +19,7 @@ export interface Props {
const RelationshipOutgoing = React.memo(
({ id }: Props) => {
const { mode } = useTheme()
const { t } = useTranslation('componentRelationship')
const query = useRelationshipQuery({ id })
@ -37,8 +39,8 @@ const RelationshipOutgoing = React.memo(
}
},
onError: (err: any, { payload: { action } }) => {
haptics('Error')
toast({
displayMessage({
mode,
type: 'error',
message: t('common:toastMessage.error.message', {
function: t(`${action}.function`)