Add context for toast messages (#7902)

* add context for toast

* add
This commit is contained in:
Minseo Lee
2025-03-07 02:46:09 +09:00
committed by GitHub
parent 29eef6188a
commit a7db0bac6f
22 changed files with 64 additions and 48 deletions
+2 -2
View File
@@ -51,7 +51,7 @@ export function Component() {
} else {
await agent.com.atproto.server.updateEmail({email: email.trim()})
await agent.resumeSession(agent.session!)
Toast.show(_(msg`Email updated`))
Toast.show(_(msg({message: 'Email updated', context: 'toast'})))
setStage(Stages.Done)
}
} catch (e) {
@@ -80,7 +80,7 @@ export function Component() {
token: confirmationCode.trim(),
})
await agent.resumeSession(agent.session!)
Toast.show(_(msg`Email updated`))
Toast.show(_(msg({message: 'Email updated', context: 'toast'})))
setStage(Stages.Done)
} catch (e) {
setError(cleanError(String(e)))
+4 -4
View File
@@ -159,8 +159,8 @@ export function Component({
})
Toast.show(
isCurateList
? _(msg`User list updated`)
: _(msg`Moderation list updated`),
? _(msg({message: 'User list updated', context: 'toast'}))
: _(msg({message: 'Moderation list updated', context: 'toast'})),
)
onSave?.(list.uri)
} else {
@@ -173,8 +173,8 @@ export function Component({
})
Toast.show(
isCurateList
? _(msg`User list created`)
: _(msg`Moderation list created`),
? _(msg({message: 'User list created', context: 'toast'}))
: _(msg({message: 'Moderation list created', context: 'toast'})),
)
onSave?.(res.uri)
}
+1 -1
View File
@@ -121,7 +121,7 @@ export function Component({
newUserAvatar,
newUserBanner,
})
Toast.show(_(msg`Profile updated`))
Toast.show(_(msg({message: 'Profile updated', context: 'toast'})))
onUpdate?.()
closeModal()
} catch (e: any) {
+1 -1
View File
@@ -82,7 +82,7 @@ export function Component({
token: confirmationCode.trim(),
})
await agent.resumeSession(agent.session!)
Toast.show(_(msg`Email verified`))
Toast.show(_(msg({message: 'Email verified', context: 'toast'})))
closeModal()
onSuccess?.()
} catch (e) {