Use appropriate icons for toasts (#4803)

* use appropriate icons for toasts

* use info for session expiry

* tweak size

* message -> safeMessage

---------

Co-authored-by: Samuel Newman <10959775+mozzius@users.noreply.github.com>
This commit is contained in:
Samuel Newman 2024-07-23 15:01:04 +01:00 committed by GitHub
parent 59bafb426f
commit 27d712290a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
48 changed files with 134 additions and 95 deletions

View file

@ -84,7 +84,7 @@ function DialogInner() {
},
onError: err => {
logger.error('Failed to submit chat appeal', {message: err})
Toast.show(_(msg`Failed to submit appeal, please try again.`))
Toast.show(_(msg`Failed to submit appeal, please try again.`), 'xmark')
},
onSuccess: () => {
control.close()

View file

@ -67,7 +67,7 @@ export function MessageInput({
return
}
if (new Graphemer().countGraphemes(message) > MAX_DM_GRAPHEME_LENGTH) {
Toast.show(_(msg`Message is too long`))
Toast.show(_(msg`Message is too long`), 'xmark')
return
}
clearDraft()

View file

@ -46,7 +46,7 @@ export function MessageInput({
return
}
if (new Graphemer().countGraphemes(message) > MAX_DM_GRAPHEME_LENGTH) {
Toast.show(_(msg`Message is too long`))
Toast.show(_(msg`Message is too long`), 'xmark')
return
}
clearDraft()

View file

@ -32,7 +32,7 @@ export function MessagesSettingsScreen({}: Props) {
const {mutate: updateDeclaration} = useUpdateActorDeclaration({
onError: () => {
Toast.show(_(msg`Failed to update settings`))
Toast.show(_(msg`Failed to update settings`), 'xmark')
},
})

View file

@ -116,6 +116,7 @@ let ProfileHeaderLabeler = ({
_(
msg`There was an an issue contacting the server, please check your internet connection and try again.`,
),
'xmark',
)
logger.error(`Failed to toggle labeler like`, {message: e.message})
}

View file

@ -104,7 +104,7 @@ let ProfileHeaderStandard = ({
} catch (e: any) {
if (e?.name !== 'AbortError') {
logger.error('Failed to follow', {message: String(e)})
Toast.show(_(msg`There was an issue! ${e.toString()}`))
Toast.show(_(msg`There was an issue! ${e.toString()}`), 'xmark')
}
}
})
@ -126,7 +126,7 @@ let ProfileHeaderStandard = ({
} catch (e: any) {
if (e?.name !== 'AbortError') {
logger.error('Failed to unfollow', {message: String(e)})
Toast.show(_(msg`There was an issue! ${e.toString()}`))
Toast.show(_(msg`There was an issue! ${e.toString()}`), 'xmark')
}
}
})
@ -140,7 +140,7 @@ let ProfileHeaderStandard = ({
} catch (e: any) {
if (e?.name !== 'AbortError') {
logger.error('Failed to unblock account', {message: e})
Toast.show(_(msg`There was an issue! ${e.toString()}`))
Toast.show(_(msg`There was an issue! ${e.toString()}`), 'xmark')
}
}
}, [_, queueUnblock, track])

View file

@ -359,7 +359,7 @@ function Header({
captureAction(ProgressGuideAction.Follow, dids.length)
Toast.show(_(msg`All accounts have been followed!`))
} catch (e) {
Toast.show(_(msg`An error occurred while trying to follow all`))
Toast.show(_(msg`An error occurred while trying to follow all`), 'xmark')
} finally {
setIsProcessing(false)
}
@ -672,7 +672,7 @@ function InvalidStarterPack({rkey}: {rkey: string}) {
onError: e => {
setIsProcessing(false)
logger.error('Failed to delete invalid starter pack', {safeMessage: e})
Toast.show(_(msg`Failed to delete starter pack`))
Toast.show(_(msg`Failed to delete starter pack`), 'xmark')
},
})

View file

@ -74,7 +74,10 @@ function reducer(state: State, action: Action): State {
break
case 'AddProfile':
if (state.profiles.length >= 51) {
Toast.show(msg`You may only add up to 50 profiles`.message ?? '')
Toast.show(
msg`You may only add up to 50 profiles`.message ?? '',
'info',
)
} else {
updatedState = {...state, profiles: [...state.profiles, action.profile]}
}
@ -89,7 +92,7 @@ function reducer(state: State, action: Action): State {
break
case 'AddFeed':
if (state.feeds.length >= 50) {
Toast.show(msg`You may only add up to 50 feeds`.message ?? '')
Toast.show(msg`You may only add up to 50 feeds`.message ?? '', 'info')
} else {
updatedState = {...state, feeds: [...state.feeds, action.feed]}
}

View file

@ -227,7 +227,7 @@ function WizardInner({
onError: e => {
logger.error('Failed to create starter pack', {safeMessage: e})
dispatch({type: 'SetProcessing', processing: false})
Toast.show(_(msg`Failed to create starter pack`))
Toast.show(_(msg`Failed to create starter pack`), 'xmark')
},
})
const {mutate: editStarterPack} = useEditStarterPackMutation({
@ -235,7 +235,7 @@ function WizardInner({
onError: e => {
logger.error('Failed to edit starter pack', {safeMessage: e})
dispatch({type: 'SetProcessing', processing: false})
Toast.show(_(msg`Failed to create starter pack`))
Toast.show(_(msg`Failed to create starter pack`), 'xmark')
},
})