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
48 changed files with 134 additions and 95 deletions
+6 -2
View File
@@ -66,7 +66,10 @@ function LightboxFooter({imageIndex}: {imageIndex: number}) {
const saveImageToAlbumWithToasts = React.useCallback(
async (uri: string) => {
if (!permissionResponse || permissionResponse.granted === false) {
Toast.show(_(msg`Permission to access camera roll is required.`))
Toast.show(
_(msg`Permission to access camera roll is required.`),
'info',
)
if (permissionResponse?.canAskAgain) {
requestPermission()
} else {
@@ -74,6 +77,7 @@ function LightboxFooter({imageIndex}: {imageIndex: number}) {
_(
msg`Permission to access camera roll was denied. Please enable it in your system settings.`,
),
'xmark',
)
}
return
@@ -83,7 +87,7 @@ function LightboxFooter({imageIndex}: {imageIndex: number}) {
await saveImageToMediaLibrary({uri})
Toast.show(_(msg`Saved to your camera roll`))
} catch (e: any) {
Toast.show(_(msg`Failed to save image: ${String(e)}`))
Toast.show(_(msg`Failed to save image: ${String(e)}`), 'xmark')
}
},
[permissionResponse, requestPermission, _],