Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Create codemod for updating Toast calls to v2 (#10045)

authored by

DS Boyce and committed by
GitHub
35cb2bcf 9c9970f6

+422 -171
+106
.jscodeshift/toast-v2.js
··· 1 + /** 2 + * Codemod to replace namespaced React calls with named imports 3 + * 4 + * Before: 5 + * import * as Toast from '#/view/com/util/Toast' 6 + * Toast.show(message, 'xmark') 7 + * 8 + * After: 9 + * import * as Toast from '#/components/Toast' 10 + * Toast.show(message, {type: 'error'}) 11 + * 12 + * Usage: jscodeshift -t .jscodeshift/toast-v2.js <file-path> 13 + * Example: jscodeshift -t .jscodeshift/toast-v2.js src/App.native.tsx 14 + */ 15 + 16 + /* eslint-disable */ 17 + 18 + export const parser = 'tsx' 19 + 20 + const OLD_IMPORT = '#/view/com/util/Toast' 21 + const NEW_IMPORT = '#/components/Toast' 22 + 23 + const convertLegacyToastType = type => { 24 + switch (type) { 25 + // these ones are fine 26 + case 'default': 27 + case 'success': 28 + case 'error': 29 + case 'warning': 30 + case 'info': 31 + return type 32 + // legacy ones need conversion 33 + case 'xmark': 34 + return 'error' 35 + case 'exclamation-circle': 36 + return 'warning' 37 + case 'check': 38 + return 'success' 39 + case 'clipboard-check': 40 + return 'success' 41 + case 'circle-exclamation': 42 + case 'exclamation-circle': 43 + return 'warning' 44 + default: 45 + return 'default' 46 + } 47 + } 48 + 49 + export default function transformer(file, api) { 50 + const j = api.jscodeshift 51 + const root = j(file.source) 52 + 53 + // Find Toast import declarations using the old path 54 + const toastImports = root 55 + .find(j.ImportDeclaration) 56 + .filter(path => path.value.source.value === OLD_IMPORT) 57 + 58 + if (toastImports.length === 0) { 59 + return file.source 60 + } 61 + 62 + // Update import path 63 + toastImports.forEach(path => { 64 + path.value.source.value = NEW_IMPORT 65 + }) 66 + 67 + // Collect all local names the Toast namespace is bound to 68 + const toastLocalNames = new Set() 69 + toastImports.forEach(path => { 70 + path.value.specifiers.forEach(spec => { 71 + if (spec.type === 'ImportNamespaceSpecifier') { 72 + toastLocalNames.add(spec.local.name) 73 + } 74 + }) 75 + }) 76 + 77 + // Transform Toast.show(message, type) calls 78 + root.find(j.CallExpression).forEach(path => { 79 + const {callee, arguments: args} = path.value 80 + 81 + // Match <ToastName>.show(...) 82 + if ( 83 + callee.type !== 'MemberExpression' || 84 + callee.object.type !== 'Identifier' || 85 + !toastLocalNames.has(callee.object.name) || 86 + callee.property.name !== 'show' 87 + ) { 88 + return 89 + } 90 + 91 + // Only transform 2-arg calls where the second arg is a string literal 92 + if (args.length !== 2) return 93 + const typeArg = args[1] 94 + if (typeArg.type !== 'StringLiteral' && typeArg.type !== 'Literal') return 95 + 96 + const legacyType = typeArg.value 97 + const newType = convertLegacyToastType(legacyType) 98 + 99 + // Replace the second argument with an options object: {type: 'newType'} 100 + args[1] = j.objectExpression([ 101 + j.property('init', j.identifier('type'), j.stringLiteral(newType)), 102 + ]) 103 + }) 104 + 105 + return root.toSource() 106 + }
+4 -5
src/App.native.tsx
··· 58 58 import {Provider as StarterPackProvider} from '#/state/shell/starter-pack' 59 59 import {Provider as HiddenRepliesProvider} from '#/state/threadgate-hidden-replies' 60 60 import {TestCtrls} from '#/view/com/testing/TestCtrls' 61 - import * as Toast from '#/view/com/util/Toast' 62 61 import {Shell} from '#/view/shell' 63 62 import {ThemeProvider as Alf} from '#/alf' 64 63 import {useColorModeTheme} from '#/alf/util/useColorModeTheme' ··· 68 67 import {Provider as PolicyUpdateOverlayProvider} from '#/components/PolicyUpdateOverlay' 69 68 import {Provider as PortalProvider} from '#/components/Portal' 70 69 import {Provider as VideoVolumeProvider} from '#/components/Post/Embed/VideoEmbed/VideoVolumeContext' 70 + import * as Toast from '#/components/Toast' 71 71 import {ToastOutlet} from '#/components/Toast' 72 72 import { 73 73 prefetchAgeAssuranceConfig, ··· 139 139 140 140 useEffect(() => { 141 141 return listenSessionDropped(() => { 142 - Toast.show( 143 - _(msg`Sorry! Your session expired. Please sign in again.`), 144 - 'info', 145 - ) 142 + Toast.show(_(msg`Sorry! Your session expired. Please sign in again.`), { 143 + type: 'info', 144 + }) 146 145 }) 147 146 }, [_]) 148 147
+4 -5
src/App.web.tsx
··· 47 47 import {Provider as SelectedFeedProvider} from '#/state/shell/selected-feed' 48 48 import {Provider as StarterPackProvider} from '#/state/shell/starter-pack' 49 49 import {Provider as HiddenRepliesProvider} from '#/state/threadgate-hidden-replies' 50 - import * as Toast from '#/view/com/util/Toast' 51 50 import {Shell} from '#/view/shell/index' 52 51 import {ThemeProvider as Alf} from '#/alf' 53 52 import {useColorModeTheme} from '#/alf/util/useColorModeTheme' ··· 58 57 import {Provider as PortalProvider} from '#/components/Portal' 59 58 import {Provider as ActiveVideoProvider} from '#/components/Post/Embed/VideoEmbed/ActiveVideoWebContext' 60 59 import {Provider as VideoVolumeProvider} from '#/components/Post/Embed/VideoEmbed/VideoVolumeContext' 60 + import * as Toast from '#/components/Toast' 61 61 import {ToastOutlet} from '#/components/Toast' 62 62 import { 63 63 prefetchAgeAssuranceConfig, ··· 115 115 116 116 useEffect(() => { 117 117 return listenSessionDropped(() => { 118 - Toast.show( 119 - _(msg`Sorry! Your session expired. Please sign in again.`), 120 - 'info', 121 - ) 118 + Toast.show(_(msg`Sorry! Your session expired. Please sign in again.`), { 119 + type: 'info', 120 + }) 122 121 }) 123 122 }, [_]) 124 123
+4 -2
src/components/FeedCard.tsx
··· 18 18 useRemoveFeedMutation, 19 19 } from '#/state/queries/preferences' 20 20 import {useSession} from '#/state/session' 21 - import * as Toast from '#/view/com/util/Toast' 22 21 import {UserAvatar} from '#/view/com/util/UserAvatar' 23 22 import {atoms as a, select, useTheme} from '#/alf' 24 23 import { ··· 33 32 import {Loader} from '#/components/Loader' 34 33 import * as Prompt from '#/components/Prompt' 35 34 import {RichText, type RichTextProps} from '#/components/RichText' 35 + import * as Toast from '#/components/Toast' 36 36 import {Text} from '#/components/Typography' 37 37 import {useActiveLiveEventFeedUris} from '#/features/liveEvents/context' 38 38 import type * as bsky from '#/types/bsky' ··· 313 313 Toast.show(l({message: 'Feeds updated!', context: 'toast'})) 314 314 } catch (err: any) { 315 315 logger.error(err, {message: `FeedCard: failed to update feeds`, pin}) 316 - Toast.show(l`Failed to update feeds`, 'xmark') 316 + Toast.show(l`Failed to update feeds`, { 317 + type: 'error', 318 + }) 317 319 } 318 320 }, 319 321 [l, pin, saveFeeds, removeFeed, uri, savedFeedConfig, type],
+19 -7
src/components/PostControls/PostMenu/PostMenuItems.tsx
··· 56 56 } from '#/state/queries/threadgate' 57 57 import {useRequireAuth, useSession} from '#/state/session' 58 58 import {useMergedThreadgateHiddenReplies} from '#/state/threadgate-hidden-replies' 59 - import * as Toast from '#/view/com/util/Toast' 60 59 import {useDialogControl} from '#/components/Dialog' 61 60 import {useGlobalDialogsControlContext} from '#/components/dialogs/Context' 62 61 import { ··· 93 92 useReportDialogControl, 94 93 } from '#/components/moderation/ReportDialog' 95 94 import * as Prompt from '#/components/Prompt' 95 + import * as Toast from '#/components/Toast' 96 96 import {useAnalytics} from '#/analytics' 97 97 import {IS_INTERNAL} from '#/env' 98 98 import * as bsky from '#/types/bsky' ··· 216 216 }, 217 217 e => { 218 218 logger.error('Failed to delete post', {message: e}) 219 - Toast.show(l`Failed to delete post, please try again`, 'xmark') 219 + Toast.show(l`Failed to delete post, please try again`, { 220 + type: 'error', 221 + }) 220 222 }, 221 223 ) 222 224 } ··· 246 248 const e = err as Error 247 249 if (e?.name !== 'AbortError') { 248 250 logger.error('Failed to toggle thread mute', {message: e}) 249 - Toast.show(l`Failed to toggle thread mute, please try again`, 'xmark') 251 + Toast.show(l`Failed to toggle thread mute, please try again`, { 252 + type: 'error', 253 + }) 250 254 } 251 255 } 252 256 } ··· 265 269 const str = richTextToString(richText, true) 266 270 267 271 void Clipboard.setStringAsync(str) 268 - Toast.show(l`Copied to clipboard`, 'clipboard-check') 272 + Toast.show(l`Copied to clipboard`, { 273 + type: 'success', 274 + }) 269 275 } 270 276 271 277 const onPressTranslate = () => { ··· 434 440 const e = err as Error 435 441 if (e?.name !== 'AbortError') { 436 442 logger.error('Failed to block account', {message: e}) 437 - Toast.show(l`There was an issue! ${e.toString()}`, 'xmark') 443 + Toast.show(l`There was an issue! ${e.toString()}`, { 444 + type: 'error', 445 + }) 438 446 } 439 447 } finally { 440 448 ax.metric('postMenu:blockAccount', { ··· 455 463 const e = err as Error 456 464 if (e?.name !== 'AbortError') { 457 465 logger.error('Failed to unmute account', {message: e}) 458 - Toast.show(l`There was an issue! ${e.toString()}`, 'xmark') 466 + Toast.show(l`There was an issue! ${e.toString()}`, { 467 + type: 'error', 468 + }) 459 469 } 460 470 } finally { 461 471 ax.metric('postMenu:unmuteAccount', { ··· 473 483 const e = err as Error 474 484 if (e?.name !== 'AbortError') { 475 485 logger.error('Failed to mute account', {message: e}) 476 - Toast.show(l`There was an issue! ${e.toString()}`, 'xmark') 486 + Toast.show(l`There was an issue! ${e.toString()}`, { 487 + type: 'error', 488 + }) 477 489 } 478 490 } finally { 479 491 ax.metric('postMenu:muteAccount', {
+4 -2
src/components/PostControls/ShareMenu/ShareMenuItems.tsx
··· 12 12 import {toShareUrl} from '#/lib/strings/url-helpers' 13 13 import {useProfileShadow} from '#/state/cache/profile-shadow' 14 14 import {useSession} from '#/state/session' 15 - import * as Toast from '#/view/com/util/Toast' 16 15 import {atoms as a} from '#/alf' 17 16 import {Admonition} from '#/components/Admonition' 18 17 import {useDialogControl} from '#/components/Dialog' ··· 22 21 import {Clipboard_Stroke2_Corner2_Rounded as ClipboardIcon} from '#/components/icons/Clipboard' 23 22 import {PaperPlane_Stroke2_Corner0_Rounded as PaperPlaneIcon} from '#/components/icons/PaperPlane' 24 23 import * as Menu from '#/components/Menu' 24 + import * as Toast from '#/components/Toast' 25 25 import {useAgeAssurance} from '#/ageAssurance' 26 26 import {useAnalytics} from '#/analytics' 27 27 import {IS_IOS} from '#/env' ··· 71 71 } else { 72 72 await ExpoClipboard.setStringAsync(url) 73 73 } 74 - Toast.show(_(msg`Copied to clipboard`), 'clipboard-check') 74 + Toast.show(_(msg`Copied to clipboard`), { 75 + type: 'success', 76 + }) 75 77 onShareProp() 76 78 } 77 79
+10 -4
src/components/PostControls/index.tsx
··· 24 24 ProgressGuideAction, 25 25 useProgressGuideControls, 26 26 } from '#/state/shell/progress-guide' 27 - import * as Toast from '#/view/com/util/Toast' 28 27 import {atoms as a, useBreakpoints} from '#/alf' 29 28 import {Reply as Bubble} from '#/components/icons/Reply' 30 29 import {useFormatPostStatCount} from '#/components/PostControls/util' 31 30 import * as Skele from '#/components/Skeleton' 31 + import * as Toast from '#/components/Toast' 32 32 import {useAnalytics} from '#/analytics' 33 33 import {BookmarkButton} from './BookmarkButton' 34 34 import { ··· 106 106 107 107 const onPressToggleLike = async () => { 108 108 if (isBlocked) { 109 - Toast.show(l`Cannot interact with a blocked user`, 'exclamation-circle') 109 + Toast.show(l`Cannot interact with a blocked user`, { 110 + type: 'warning', 111 + }) 110 112 return 111 113 } 112 114 ··· 135 137 136 138 const onRepost = async () => { 137 139 if (isBlocked) { 138 - Toast.show(l`Cannot interact with a blocked user`, 'exclamation-circle') 140 + Toast.show(l`Cannot interact with a blocked user`, { 141 + type: 'warning', 142 + }) 139 143 return 140 144 } 141 145 ··· 161 165 162 166 const onQuote = () => { 163 167 if (isBlocked) { 164 - Toast.show(l`Cannot interact with a blocked user`, 'exclamation-circle') 168 + Toast.show(l`Cannot interact with a blocked user`, { 169 + type: 'warning', 170 + }) 165 171 return 166 172 } 167 173
+7 -3
src/components/ProfileCard.tsx
··· 22 22 import {useProfileShadow} from '#/state/cache/profile-shadow' 23 23 import {useProfileFollowMutationQueue} from '#/state/queries/profile' 24 24 import {useSession} from '#/state/session' 25 - import * as Toast from '#/view/com/util/Toast' 26 25 import {PreviewableUserAvatar, UserAvatar} from '#/view/com/util/UserAvatar' 27 26 import { 28 27 atoms as a, ··· 43 42 import * as Pills from '#/components/Pills' 44 43 import {ProfileBadges} from '#/components/ProfileBadges' 45 44 import {RichText} from '#/components/RichText' 45 + import * as Toast from '#/components/Toast' 46 46 import {Text} from '#/components/Typography' 47 47 import {type Metrics} from '#/analytics' 48 48 import {useActorStatus} from '#/features/liveNow' ··· 504 504 } catch (e) { 505 505 const err = e as Error 506 506 if (err?.name !== 'AbortError') { 507 - Toast.show(l`An issue occurred, please try again.`, 'xmark') 507 + Toast.show(l`An issue occurred, please try again.`, { 508 + type: 'error', 509 + }) 508 510 } 509 511 } 510 512 } ··· 524 526 } catch (e) { 525 527 const err = e as Error 526 528 if (err?.name !== 'AbortError') { 527 - Toast.show(l`An issue occurred, please try again.`, 'xmark') 529 + Toast.show(l`An issue occurred, please try again.`, { 530 + type: 'error', 531 + }) 528 532 } 529 533 } 530 534 }
+10 -4
src/components/activity-notifications/SubscribeProfileDialog.tsx
··· 21 21 import {updateProfileShadow} from '#/state/cache/profile-shadow' 22 22 import {RQKEY_getActivitySubscriptions} from '#/state/queries/activity-subscriptions' 23 23 import {useAgent} from '#/state/session' 24 - import * as Toast from '#/view/com/util/Toast' 25 24 import {atoms as a, platform, useTheme, web} from '#/alf' 26 25 import {Admonition} from '#/components/Admonition' 27 26 import { ··· 34 33 import * as Toggle from '#/components/forms/Toggle' 35 34 import {Loader} from '#/components/Loader' 36 35 import * as ProfileCard from '#/components/ProfileCard' 36 + import * as Toast from '#/components/Toast' 37 37 import {Text} from '#/components/Typography' 38 38 import {useAnalytics} from '#/analytics' 39 39 import {IS_WEB} from '#/env' ··· 139 139 _( 140 140 msg`You will no longer receive notifications for ${sanitizeHandle(profile.handle, '@')}`, 141 141 ), 142 - 'check', 142 + { 143 + type: 'success', 144 + }, 143 145 ) 144 146 145 147 // filter out the subscription ··· 169 171 _( 170 172 msg`You'll start receiving notifications for ${sanitizeHandle(profile.handle, '@')}!`, 171 173 ), 172 - 'check', 174 + { 175 + type: 'success', 176 + }, 173 177 ) 174 178 } else { 175 - Toast.show(_(msg`Changes saved`), 'check') 179 + Toast.show(_(msg`Changes saved`), { 180 + type: 'success', 181 + }) 176 182 } 177 183 } 178 184 })
+4 -2
src/components/ageAssurance/AgeAssuranceAppealDialog.tsx
··· 8 8 9 9 import {BLUESKY_MOD_SERVICE_HEADERS} from '#/lib/constants' 10 10 import {useAgent, useSession} from '#/state/session' 11 - import * as Toast from '#/view/com/util/Toast' 12 11 import {atoms as a, useBreakpoints, web} from '#/alf' 13 12 import {AgeAssuranceBadge} from '#/components/ageAssurance/AgeAssuranceBadge' 14 13 import {Button, ButtonIcon, ButtonText} from '#/components/Button' 15 14 import * as Dialog from '#/components/Dialog' 16 15 import {Loader} from '#/components/Loader' 16 + import * as Toast from '#/components/Toast' 17 17 import {Text} from '#/components/Typography' 18 18 import {logger} from '#/ageAssurance' 19 19 import {useAnalytics} from '#/analytics' ··· 70 70 logger.error('AgeAssuranceAppealDialog failed', {safeMessage: err}) 71 71 Toast.show( 72 72 _(msg`Age assurance inquiry failed to send, please try again.`), 73 - 'xmark', 73 + { 74 + type: 'error', 75 + }, 74 76 ) 75 77 }, 76 78 onSuccess: () => {
+4 -2
src/components/dialogs/PostInteractionSettingsDialog.tsx
··· 37 37 usePostThreadContext, 38 38 } from '#/state/queries/usePostThread' 39 39 import {useAgent, useSession} from '#/state/session' 40 - import * as Toast from '#/view/com/util/Toast' 41 40 import {UserAvatar} from '#/view/com/util/UserAvatar' 42 41 import {atoms as a, useTheme, web} from '#/alf' 43 42 import {Button, ButtonIcon, ButtonText} from '#/components/Button' ··· 50 49 import {CircleInfo_Stroke2_Corner0_Rounded as CircleInfo} from '#/components/icons/CircleInfo' 51 50 import {CloseQuote_Stroke2_Corner1_Rounded as QuoteIcon} from '#/components/icons/Quote' 52 51 import {Loader} from '#/components/Loader' 52 + import * as Toast from '#/components/Toast' 53 53 import {Text} from '#/components/Typography' 54 54 import {useAnalytics} from '#/analytics' 55 55 import {IS_IOS} from '#/env' ··· 240 240 _( 241 241 msg`There was an issue. Please check your internet connection and try again.`, 242 242 ), 243 - 'xmark', 243 + { 244 + type: 'error', 245 + }, 244 246 ) 245 247 } finally { 246 248 setIsSaving(false)
+1 -1
src/components/dialogs/lists/CreateOrEditListDialog.tsx
··· 17 17 } from '#/state/queries/list' 18 18 import {useAgent} from '#/state/session' 19 19 import {ErrorMessage} from '#/view/com/util/error/ErrorMessage' 20 - import * as Toast from '#/view/com/util/Toast' 21 20 import {EditableUserAvatar} from '#/view/com/util/UserAvatar' 22 21 import {atoms as a, useTheme, web} from '#/alf' 23 22 import {Button, ButtonIcon, ButtonText} from '#/components/Button' ··· 25 24 import * as TextField from '#/components/forms/TextField' 26 25 import {Loader} from '#/components/Loader' 27 26 import * as Prompt from '#/components/Prompt' 27 + import * as Toast from '#/components/Toast' 28 28 import {Text} from '#/components/Typography' 29 29 import {IS_WEB} from '#/env' 30 30
+9 -3
src/components/dialogs/lists/ListAddRemoveUsersDialog.tsx
··· 14 14 useListMembershipAddMutation, 15 15 useListMembershipRemoveMutation, 16 16 } from '#/state/queries/list-memberships' 17 - import * as Toast from '#/view/com/util/Toast' 18 17 import {atoms as a} from '#/alf' 19 18 import {Button, ButtonIcon, ButtonText} from '#/components/Button' 20 19 import * as Dialog from '#/components/Dialog' ··· 24 23 } from '#/components/dialogs/SearchablePeopleList' 25 24 import {Loader} from '#/components/Loader' 26 25 import * as ProfileCard from '#/components/ProfileCard' 26 + import * as Toast from '#/components/Toast' 27 27 import type * as bsky from '#/types/bsky' 28 28 29 29 export function ListAddRemoveUsersDialog({ ··· 113 113 Toast.show(_(msg`Added to list`)) 114 114 onChange?.('add', profile) 115 115 }, 116 - onError: e => Toast.show(cleanError(e), 'xmark'), 116 + onError: e => 117 + Toast.show(cleanError(e), { 118 + type: 'error', 119 + }), 117 120 }) 118 121 const {mutate: listMembershipRemove, isPending: isRemovingPending} = 119 122 useListMembershipRemoveMutation({ ··· 121 124 Toast.show(_(msg`Removed from list`)) 122 125 onChange?.('remove', profile) 123 126 }, 124 - onError: e => Toast.show(cleanError(e), 'xmark'), 127 + onError: e => 128 + Toast.show(cleanError(e), { 129 + type: 'error', 130 + }), 125 131 }) 126 132 const isMutating = isAddingPending || isRemovingPending 127 133
+6 -6
src/components/dms/ActionsWrapper.web.tsx
··· 6 6 7 7 import {useConvoActive} from '#/state/messages/convo' 8 8 import {useSession} from '#/state/session' 9 - import * as Toast from '#/view/com/util/Toast' 10 9 import {atoms as a, useTheme} from '#/alf' 11 10 import {MessageContextMenu} from '#/components/dms/MessageContextMenu' 12 11 import {DotGrid3x1_Stroke2_Corner0_Rounded as DotsHorizontalIcon} from '#/components/icons/DotGrid' 13 12 import {EmojiSmile_Stroke2_Corner0_Rounded as EmojiSmileIcon} from '#/components/icons/Emoji' 13 + import * as Toast from '#/components/Toast' 14 14 import {EmojiReactionPicker} from './EmojiReactionPicker' 15 15 import {hasReachedReactionLimit} from './util' 16 16 ··· 60 60 .catch(() => Toast.show(_(msg`Failed to remove emoji reaction`))) 61 61 } else { 62 62 if (hasReachedReactionLimit(message, currentAccount?.did)) return 63 - convo 64 - .addReaction(message.id, emoji) 65 - .catch(() => 66 - Toast.show(_(msg`Failed to add emoji reaction`), 'xmark'), 67 - ) 63 + convo.addReaction(message.id, emoji).catch(() => 64 + Toast.show(_(msg`Failed to add emoji reaction`), { 65 + type: 'error', 66 + }), 67 + ) 68 68 } 69 69 }, 70 70 [_, convo, message, currentAccount?.did],
+7 -3
src/components/dms/AfterReportDialog.tsx
··· 13 13 useProfileBlockMutationQueue, 14 14 useProfileQuery, 15 15 } from '#/state/queries/profile' 16 - import * as Toast from '#/view/com/util/Toast' 17 16 import {atoms as a, platform, useBreakpoints, useTheme, web} from '#/alf' 18 17 import {Button, ButtonText} from '#/components/Button' 19 18 import * as Dialog from '#/components/Dialog' 20 19 import * as Toggle from '#/components/forms/Toggle' 21 20 import {Loader} from '#/components/Loader' 21 + import * as Toast from '#/components/Toast' 22 22 import {Text} from '#/components/Typography' 23 23 import {IS_NATIVE} from '#/env' 24 24 ··· 135 135 } 136 136 }, 137 137 onError: () => { 138 - Toast.show(_(msg`Could not leave chat`), 'xmark') 138 + Toast.show(_(msg`Could not leave chat`), { 139 + type: 'error', 140 + }) 139 141 }, 140 142 }) 141 143 ··· 161 163 leaveConvo() 162 164 } 163 165 if (toastMsg) { 164 - Toast.show(toastMsg, 'check') 166 + Toast.show(toastMsg, { 167 + type: 'success', 168 + }) 165 169 } 166 170 }) 167 171 }
+4 -2
src/components/dms/ConvoMenu.tsx
··· 18 18 unstableCacheProfileView, 19 19 useProfileBlockMutationQueue, 20 20 } from '#/state/queries/profile' 21 - import * as Toast from '#/view/com/util/Toast' 22 21 import {type ViewStyleProp} from '#/alf' 23 22 import {atoms as a} from '#/alf' 24 23 import {Button, ButtonIcon} from '#/components/Button' ··· 40 39 import * as Menu from '#/components/Menu' 41 40 import {ReportDialog} from '#/components/moderation/ReportDialog' 42 41 import * as Prompt from '#/components/Prompt' 42 + import * as Toast from '#/components/Toast' 43 43 import type * as bsky from '#/types/bsky' 44 44 45 45 let ConvoMenu = ({ ··· 205 205 } 206 206 }, 207 207 onError: () => { 208 - Toast.show(_(msg`Could not mute chat`), 'xmark') 208 + Toast.show(_(msg`Could not mute chat`), { 209 + type: 'error', 210 + }) 209 211 }, 210 212 }) 211 213
+4 -2
src/components/dms/LeaveConvoPrompt.tsx
··· 4 4 5 5 import {type NavigationProp} from '#/lib/routes/types' 6 6 import {useLeaveConvo} from '#/state/queries/messages/leave-conversation' 7 - import * as Toast from '#/view/com/util/Toast' 8 7 import {type DialogOuterProps} from '#/components/Dialog' 9 8 import * as Prompt from '#/components/Prompt' 9 + import * as Toast from '#/components/Toast' 10 10 import {IS_NATIVE} from '#/env' 11 11 12 12 export function LeaveConvoPrompt({ ··· 32 32 } 33 33 }, 34 34 onError: () => { 35 - Toast.show(_(msg`Could not leave chat`), 'xmark') 35 + Toast.show(_(msg`Could not leave chat`), { 36 + type: 'error', 37 + }) 36 38 }, 37 39 }) 38 40
+9 -7
src/components/dms/MessageContextMenu.tsx
··· 12 12 import {useLanguagePrefs} from '#/state/preferences' 13 13 import {unstableCacheProfileView} from '#/state/queries/unstable-profile-cache' 14 14 import {useSession} from '#/state/session' 15 - import * as Toast from '#/view/com/util/Toast' 16 15 import * as ContextMenu from '#/components/ContextMenu' 17 16 import {type TriggerProps} from '#/components/ContextMenu/types' 18 17 import {AfterReportDialog} from '#/components/dms/AfterReportDialog' ··· 23 22 import {ReportDialog} from '#/components/moderation/ReportDialog' 24 23 import * as Prompt from '#/components/Prompt' 25 24 import {usePromptControl} from '#/components/Prompt' 25 + import * as Toast from '#/components/Toast' 26 26 import {useAnalytics} from '#/analytics' 27 27 import {IS_NATIVE} from '#/env' 28 28 import {EmojiReactionPicker} from './EmojiReactionPicker' ··· 58 58 ) 59 59 60 60 void Clipboard.setStringAsync(str) 61 - Toast.show(_(msg`Copied to clipboard`), 'clipboard-check') 61 + Toast.show(_(msg`Copied to clipboard`), { 62 + type: 'success', 63 + }) 62 64 }, [_, message.text, message.facets]) 63 65 64 66 const onPressTranslateMessage = useCallback(() => { ··· 95 97 .catch(() => Toast.show(_(msg`Failed to remove emoji reaction`))) 96 98 } else { 97 99 if (hasReachedReactionLimit(message, currentAccount?.did)) return 98 - convo 99 - .addReaction(message.id, emoji) 100 - .catch(() => 101 - Toast.show(_(msg`Failed to add emoji reaction`), 'xmark'), 102 - ) 100 + convo.addReaction(message.id, emoji).catch(() => 101 + Toast.show(_(msg`Failed to add emoji reaction`), { 102 + type: 'error', 103 + }), 104 + ) 103 105 } 104 106 }, 105 107 [_, convo, message, currentAccount?.did],
+1 -1
src/components/dms/MessageProfileButton.tsx
··· 10 10 import {type NavigationProp} from '#/lib/routes/types' 11 11 import {useGetConvoAvailabilityQuery} from '#/state/queries/messages/get-convo-availability' 12 12 import {useGetConvoForMembers} from '#/state/queries/messages/get-convo-for-members' 13 - import * as Toast from '#/view/com/util/Toast' 14 13 import {atoms as a, useTheme} from '#/alf' 15 14 import {Button, ButtonIcon} from '#/components/Button' 16 15 import {canBeMessaged} from '#/components/dms/util' 17 16 import {Message_Stroke2_Corner0_Rounded as Message} from '#/components/icons/Message' 17 + import * as Toast from '#/components/Toast' 18 18 import {useAnalytics} from '#/analytics' 19 19 20 20 export function MessageProfileButton({
+4 -2
src/components/dms/dialogs/NewChatDialog.tsx
··· 7 7 import {logger} from '#/logger' 8 8 import {useGetConvoForMembers} from '#/state/queries/messages/get-convo-for-members' 9 9 import {FAB} from '#/view/com/util/fab/FAB' 10 - import * as Toast from '#/view/com/util/Toast' 11 10 import {useTheme} from '#/alf' 12 11 import * as Dialog from '#/components/Dialog' 13 12 import {SearchablePeopleList} from '#/components/dialogs/SearchablePeopleList' 14 13 import {PlusLarge_Stroke2_Corner0_Rounded as Plus} from '#/components/icons/Plus' 14 + import * as Toast from '#/components/Toast' 15 15 import {useAnalytics} from '#/analytics' 16 16 17 17 export function NewChat({ ··· 37 37 }, 38 38 onError: error => { 39 39 logger.error('Failed to create chat', {safeMessage: error}) 40 - Toast.show(_(msg`An issue occurred starting the chat`), 'xmark') 40 + Toast.show(_(msg`An issue occurred starting the chat`), { 41 + type: 'error', 42 + }) 41 43 }, 42 44 }) 43 45
+4 -5
src/components/dms/dialogs/ShareViaChatDialog.tsx
··· 4 4 5 5 import {logger} from '#/logger' 6 6 import {useGetConvoForMembers} from '#/state/queries/messages/get-convo-for-members' 7 - import * as Toast from '#/view/com/util/Toast' 8 7 import * as Dialog from '#/components/Dialog' 9 8 import {SearchablePeopleList} from '#/components/dialogs/SearchablePeopleList' 9 + import * as Toast from '#/components/Toast' 10 10 import {useAnalytics} from '#/analytics' 11 11 12 12 export function SendViaChatDialog({ ··· 47 47 }, 48 48 onError: error => { 49 49 logger.error('Failed to share post to chat', {message: error}) 50 - Toast.show( 51 - _(msg`An issue occurred while trying to open the chat`), 52 - 'xmark', 53 - ) 50 + Toast.show(_(msg`An issue occurred while trying to open the chat`), { 51 + type: 'error', 52 + }) 54 53 }, 55 54 }) 56 55
+7 -3
src/components/hooks/useFollowMethods.ts
··· 6 6 import {type Shadow} from '#/state/cache/types' 7 7 import {useProfileFollowMutationQueue} from '#/state/queries/profile' 8 8 import {useRequireAuth} from '#/state/session' 9 - import * as Toast from '#/view/com/util/Toast' 9 + import * as Toast from '#/components/Toast' 10 10 import {type Metrics} from '#/analytics/metrics' 11 11 import type * as bsky from '#/types/bsky' 12 12 ··· 32 32 } catch (e: any) { 33 33 logger.error(`useFollowMethods: failed to follow`, {message: String(e)}) 34 34 if (e?.name !== 'AbortError') { 35 - Toast.show(_(msg`An issue occurred, please try again.`), 'xmark') 35 + Toast.show(_(msg`An issue occurred, please try again.`), { 36 + type: 'error', 37 + }) 36 38 } 37 39 } 38 40 }) ··· 47 49 message: String(e), 48 50 }) 49 51 if (e?.name !== 'AbortError') { 50 - Toast.show(_(msg`An issue occurred, please try again.`), 'xmark') 52 + Toast.show(_(msg`An issue occurred, please try again.`), { 53 + type: 'error', 54 + }) 51 55 } 52 56 } 53 57 })
+1 -1
src/components/moderation/LabelsOnMeDialog.tsx
··· 14 14 import {sanitizeHandle} from '#/lib/strings/handles' 15 15 import {logger} from '#/logger' 16 16 import {useAgent, useSession} from '#/state/session' 17 - import * as Toast from '#/view/com/util/Toast' 18 17 import {atoms as a, useBreakpoints, useTheme} from '#/alf' 19 18 import {Button, ButtonIcon, ButtonText} from '#/components/Button' 20 19 import * as Dialog from '#/components/Dialog' 21 20 import {InlineLinkText} from '#/components/Link' 21 + import * as Toast from '#/components/Toast' 22 22 import {Text} from '#/components/Typography' 23 23 import {IS_ANDROID} from '#/env' 24 24 import {Admonition} from '../Admonition'
+1 -1
src/components/verification/VerificationCreatePrompt.tsx
··· 7 7 import {logger} from '#/logger' 8 8 import {useModerationOpts} from '#/state/preferences/moderation-opts' 9 9 import {useVerificationCreateMutation} from '#/state/queries/verification/useVerificationCreateMutation' 10 - import * as Toast from '#/view/com/util/Toast' 11 10 import {atoms as a, useBreakpoints} from '#/alf' 12 11 import {Admonition} from '#/components/Admonition' 13 12 import {Button, ButtonIcon, ButtonText} from '#/components/Button' ··· 17 16 import {Loader} from '#/components/Loader' 18 17 import * as ProfileCard from '#/components/ProfileCard' 19 18 import * as Prompt from '#/components/Prompt' 19 + import * as Toast from '#/components/Toast' 20 20 import type * as bsky from '#/types/bsky' 21 21 22 22 export function VerificationCreatePrompt({
+4 -2
src/components/verification/VerificationRemovePrompt.tsx
··· 5 5 6 6 import {logger} from '#/logger' 7 7 import {useVerificationsRemoveMutation} from '#/state/queries/verification/useVerificationsRemoveMutation' 8 - import * as Toast from '#/view/com/util/Toast' 9 8 import {type DialogControlProps} from '#/components/Dialog' 10 9 import * as Prompt from '#/components/Prompt' 10 + import * as Toast from '#/components/Toast' 11 11 import type * as bsky from '#/types/bsky' 12 12 13 13 export {useDialogControl as usePromptControl} from '#/components/Dialog' ··· 31 31 await remove({profile, verifications}) 32 32 Toast.show(_(msg`Removed verification`)) 33 33 } catch (e) { 34 - Toast.show(_(msg`Failed to remove verification`), 'xmark') 34 + Toast.show(_(msg`Failed to remove verification`), { 35 + type: 'error', 36 + }) 35 37 logger.error('Failed to remove verification', { 36 38 safeMessage: e, 37 39 })
+1 -1
src/features/liveNow/index.tsx
··· 23 23 } from '#/state/cache/profile-shadow' 24 24 import {useAgent, useSession} from '#/state/session' 25 25 import {useTickEveryMinute} from '#/state/shell' 26 - import * as Toast from '#/view/com/util/Toast' 27 26 import {useDialogContext} from '#/components/Dialog' 27 + import * as Toast from '#/components/Toast' 28 28 import {useAnalytics} from '#/analytics' 29 29 import {getLiveNowHost, getLiveServiceNames} from '#/features/liveNow/utils' 30 30 import type * as bsky from '#/types/bsky'
+7 -9
src/lib/hooks/useAccountSwitcher.ts
··· 5 5 import {logger} from '#/logger' 6 6 import {type SessionAccount, useSessionApi} from '#/state/session' 7 7 import {useLoggedOutViewControls} from '#/state/shell/logged-out' 8 - import * as Toast from '#/view/com/util/Toast' 8 + import * as Toast from '#/components/Toast' 9 9 import {useAnalytics} from '#/analytics' 10 10 import {type Metrics} from '#/analytics/metrics' 11 11 import {IS_WEB} from '#/env' ··· 42 42 Toast.show(_(msg`Signed in as @${account.handle}`)) 43 43 } else { 44 44 requestSwitchToAccount({requestedAccount: account.did}) 45 - Toast.show( 46 - _(msg`Please sign in as @${account.handle}`), 47 - 'circle-exclamation', 48 - ) 45 + Toast.show(_(msg`Please sign in as @${account.handle}`), { 46 + type: 'warning', 47 + }) 49 48 } 50 49 } catch (e: any) { 51 50 logger.error(`switch account: selectAccount failed`, { 52 51 message: e.message, 53 52 }) 54 53 requestSwitchToAccount({requestedAccount: account.did}) 55 - Toast.show( 56 - _(msg`Please sign in as @${account.handle}`), 57 - 'circle-exclamation', 58 - ) 54 + Toast.show(_(msg`Please sign in as @${account.handle}`), { 55 + type: 'warning', 56 + }) 59 57 } finally { 60 58 setPendingDid(null) 61 59 }
+4 -2
src/lib/media/picker.shared.ts
··· 6 6 import {t} from '@lingui/core/macro' 7 7 8 8 import {type ImageMeta} from '#/state/gallery' 9 - import * as Toast from '#/view/com/util/Toast' 9 + import * as Toast from '#/components/Toast' 10 10 import {IS_IOS, IS_WEB} from '#/env' 11 11 import {VIDEO_MAX_DURATION_MS} from '../constants' 12 12 import {getDataUriSize} from './util' ··· 30 30 return (response.assets ?? []) 31 31 .filter(asset => { 32 32 if (asset.mimeType?.startsWith('image/')) return true 33 - Toast.show(t`Only image files are supported`, 'exclamation-circle') 33 + Toast.show(t`Only image files are supported`, { 34 + type: 'warning', 35 + }) 34 36 return false 35 37 }) 36 38 .map(image => ({
+7 -3
src/lib/sharing.ts
··· 3 3 import {setStringAsync} from 'expo-clipboard' 4 4 import {t} from '@lingui/core/macro' 5 5 6 - import * as Toast from '#/view/com/util/Toast' 6 + import * as Toast from '#/components/Toast' 7 7 import {IS_ANDROID, IS_IOS} from '#/env' 8 8 9 9 /** ··· 21 21 // React Native Share is not supported by web. Web Share API 22 22 // has increasing but not full support, so default to clipboard 23 23 setStringAsync(url) 24 - Toast.show(t`Copied to clipboard`, 'clipboard-check') 24 + Toast.show(t`Copied to clipboard`, { 25 + type: 'success', 26 + }) 25 27 } 26 28 } 27 29 ··· 37 39 await Share.share({message: text}) 38 40 } else { 39 41 await setStringAsync(text) 40 - Toast.show(t`Copied to clipboard`, 'clipboard-check') 42 + Toast.show(t`Copied to clipboard`, { 43 + type: 'success', 44 + }) 41 45 } 42 46 }
+1 -1
src/screens/List/ListHiddenScreen.tsx
··· 19 19 useRemoveFeedMutation, 20 20 } from '#/state/queries/preferences' 21 21 import {useSession} from '#/state/session' 22 - import * as Toast from '#/view/com/util/Toast' 23 22 import {CenteredView} from '#/view/com/util/Views' 24 23 import {atoms as a, useBreakpoints, useTheme} from '#/alf' 25 24 import {Button, ButtonIcon, ButtonText} from '#/components/Button' 26 25 import {EyeSlash_Stroke2_Corner0_Rounded as EyeSlash} from '#/components/icons/EyeSlash' 27 26 import {Loader} from '#/components/Loader' 28 27 import {useHider} from '#/components/moderation/Hider' 28 + import * as Toast from '#/components/Toast' 29 29 import {Text} from '#/components/Typography' 30 30 31 31 export function ListHiddenScreen({
+1 -1
src/screens/Login/ChooseAccountForm.tsx
··· 7 7 import {logger} from '#/logger' 8 8 import {type SessionAccount, useSession, useSessionApi} from '#/state/session' 9 9 import {useLoggedOutViewControls} from '#/state/shell/logged-out' 10 - import * as Toast from '#/view/com/util/Toast' 11 10 import {atoms as a, web} from '#/alf' 12 11 import {AccountList} from '#/components/AccountList' 13 12 import {Button, ButtonText} from '#/components/Button' 14 13 import * as TextField from '#/components/forms/TextField' 14 + import * as Toast from '#/components/Toast' 15 15 import {useAnalytics} from '#/analytics' 16 16 import {IS_WEB} from '#/env' 17 17 import {FormContainer} from './FormContainer'
+13 -5
src/screens/Messages/Inbox.tsx
··· 30 30 import {FAB} from '#/view/com/util/fab/FAB' 31 31 import {List} from '#/view/com/util/List' 32 32 import {ChatListLoadingPlaceholder} from '#/view/com/util/LoadingPlaceholder' 33 - import * as Toast from '#/view/com/util/Toast' 34 33 import {atoms as a, useBreakpoints, useTheme} from '#/alf' 35 34 import {AgeRestrictedScreen} from '#/components/ageAssurance/AgeRestrictedScreen' 36 35 import {useAgeAssuranceCopy} from '#/components/ageAssurance/useAgeAssuranceCopy' ··· 43 42 import {Message_Stroke2_Corner0_Rounded as MessageIcon} from '#/components/icons/Message' 44 43 import * as Layout from '#/components/Layout' 45 44 import {ListFooter} from '#/components/Lists' 45 + import * as Toast from '#/components/Toast' 46 46 import {Text} from '#/components/Typography' 47 47 import {IS_NATIVE} from '#/env' 48 48 import {RequestListItem} from './components/RequestListItem' ··· 313 313 const t = useTheme() 314 314 const {mutate: markAllRead} = useUpdateAllRead('request', { 315 315 onMutate: () => { 316 - Toast.show(_(msg`Marked all as read`), 'check') 316 + Toast.show(_(msg`Marked all as read`), { 317 + type: 'success', 318 + }) 317 319 }, 318 320 onError: () => { 319 - Toast.show(_(msg`Failed to mark all requests as read`), 'xmark') 321 + Toast.show(_(msg`Failed to mark all requests as read`), { 322 + type: 'error', 323 + }) 320 324 }, 321 325 }) 322 326 ··· 336 340 const {_} = useLingui() 337 341 const {mutate: markAllRead} = useUpdateAllRead('request', { 338 342 onMutate: () => { 339 - Toast.show(_(msg`Marked all as read`), 'check') 343 + Toast.show(_(msg`Marked all as read`), { 344 + type: 'success', 345 + }) 340 346 }, 341 347 onError: () => { 342 - Toast.show(_(msg`Failed to mark all requests as read`), 'xmark') 348 + Toast.show(_(msg`Failed to mark all requests as read`), { 349 + type: 'error', 350 + }) 343 351 }, 344 352 }) 345 353
+4 -2
src/screens/Messages/Settings.tsx
··· 9 9 import {useUpdateActorDeclaration} from '#/state/queries/messages/actor-declaration' 10 10 import {useProfileQuery} from '#/state/queries/profile' 11 11 import {useSession} from '#/state/session' 12 - import * as Toast from '#/view/com/util/Toast' 13 12 import {atoms as a} from '#/alf' 14 13 import {Admonition} from '#/components/Admonition' 15 14 import {Divider} from '#/components/Divider' 16 15 import * as Toggle from '#/components/forms/Toggle' 17 16 import * as Layout from '#/components/Layout' 17 + import * as Toast from '#/components/Toast' 18 18 import {Text} from '#/components/Typography' 19 19 import {IS_NATIVE} from '#/env' 20 20 import {useBackgroundNotificationPreferences} from '../../../modules/expo-background-notification-handler/src/BackgroundNotificationHandlerProvider' ··· 37 37 38 38 const {mutate: updateDeclaration} = useUpdateActorDeclaration({ 39 39 onError: () => { 40 - Toast.show(_(msg`Failed to update settings`), 'xmark') 40 + Toast.show(_(msg`Failed to update settings`), { 41 + type: 'error', 42 + }) 41 43 }, 42 44 }) 43 45
+4 -2
src/screens/Messages/components/ChatDisabled.tsx
··· 9 9 import {BLUESKY_MOD_SERVICE_HEADERS} from '#/lib/constants' 10 10 import {logger} from '#/logger' 11 11 import {useAgent, useSession} from '#/state/session' 12 - import * as Toast from '#/view/com/util/Toast' 13 12 import {atoms as a, useBreakpoints, useTheme} from '#/alf' 14 13 import {Button, ButtonIcon, ButtonText} from '#/components/Button' 15 14 import * as Dialog from '#/components/Dialog' 16 15 import {Loader} from '#/components/Loader' 16 + import * as Toast from '#/components/Toast' 17 17 import {Text} from '#/components/Typography' 18 18 19 19 export function ChatDisabled() { ··· 97 97 }, 98 98 onError: err => { 99 99 logger.error('Failed to submit chat appeal', {message: err}) 100 - Toast.show(_(msg`Failed to submit appeal, please try again.`), 'xmark') 100 + Toast.show(_(msg`Failed to submit appeal, please try again.`), { 101 + type: 'error', 102 + }) 101 103 }, 102 104 onSuccess: () => { 103 105 control.close()
+4 -2
src/screens/Messages/components/MessageInput.tsx
··· 24 24 useSaveMessageDraft, 25 25 } from '#/state/messages/message-drafts' 26 26 import {type EmojiPickerPosition} from '#/view/com/composer/text-input/web/EmojiPicker' 27 - import * as Toast from '#/view/com/util/Toast' 28 27 import {android, atoms as a, useTheme} from '#/alf' 29 28 import {useSharedInputStyles} from '#/components/forms/TextField' 30 29 import {PaperPlane_Stroke2_Corner0_Rounded as PaperPlane} from '#/components/icons/PaperPlane' 30 + import * as Toast from '#/components/Toast' 31 31 import {IS_IOS, IS_WEB} from '#/env' 32 32 import {useExtractEmbedFromFacets} from './MessageInputEmbed' 33 33 ··· 76 76 return 77 77 } 78 78 if (countGraphemes(message) > MAX_DM_GRAPHEME_LENGTH) { 79 - Toast.show(_(msg`Message is too long`), 'xmark') 79 + Toast.show(_(msg`Message is too long`), { 80 + type: 'error', 81 + }) 80 82 return 81 83 } 82 84 clearDraft()
+4 -2
src/screens/Messages/components/MessageInput.web.tsx
··· 17 17 type Emoji, 18 18 type EmojiPickerPosition, 19 19 } from '#/view/com/composer/text-input/web/EmojiPicker' 20 - import * as Toast from '#/view/com/util/Toast' 21 20 import {atoms as a, flatten, useTheme} from '#/alf' 22 21 import {Button} from '#/components/Button' 23 22 import {useSharedInputStyles} from '#/components/forms/TextField' 24 23 import {EmojiArc_Stroke2_Corner0_Rounded as EmojiSmile} from '#/components/icons/Emoji' 25 24 import {PaperPlane_Stroke2_Corner0_Rounded as PaperPlane} from '#/components/icons/PaperPlane' 25 + import * as Toast from '#/components/Toast' 26 26 import {IS_WEB_SAFARI, IS_WEB_TOUCH_DEVICE} from '#/env' 27 27 import {useExtractEmbedFromFacets} from './MessageInputEmbed' 28 28 ··· 57 57 return 58 58 } 59 59 if (countGraphemes(message) > MAX_DM_GRAPHEME_LENGTH) { 60 - Toast.show(_(msg`Message is too long`), 'xmark') 60 + Toast.show(_(msg`Message is too long`), { 61 + type: 'error', 62 + }) 61 63 return 62 64 } 63 65 clearDraft()
+19 -7
src/screens/Messages/components/RequestButtons.tsx
··· 16 16 unstableCacheProfileView, 17 17 useProfileBlockMutationQueue, 18 18 } from '#/state/queries/profile' 19 - import * as Toast from '#/view/com/util/Toast' 20 19 import {atoms as a} from '#/alf' 21 20 import { 22 21 Button, ··· 36 35 import {Loader} from '#/components/Loader' 37 36 import * as Menu from '#/components/Menu' 38 37 import {ReportDialog} from '#/components/moderation/ReportDialog' 38 + import * as Toast from '#/components/Toast' 39 39 40 40 export function RejectMenu({ 41 41 convo, ··· 72 72 message: 'Failed to delete chat', 73 73 }), 74 74 ), 75 - 'xmark', 75 + { 76 + type: 'error', 77 + }, 76 78 ) 77 79 }, 78 80 }) ··· 86 88 message: 'Chat deleted', 87 89 }), 88 90 ), 89 - 'check', 91 + { 92 + type: 'success', 93 + }, 90 94 ) 91 95 leaveConvo() 92 96 }, [leaveConvo, _]) ··· 99 103 message: 'Account blocked', 100 104 }), 101 105 ), 102 - 'check', 106 + { 107 + type: 'success', 108 + }, 103 109 ) 104 110 // block and also delete convo 105 111 queueBlock() ··· 245 251 message: 'Failed to accept chat', 246 252 }), 247 253 ), 248 - 'xmark', 254 + { 255 + type: 'error', 256 + }, 249 257 ) 250 258 }, 251 259 }) ··· 314 322 message: 'Failed to delete chat', 315 323 }), 316 324 ), 317 - 'xmark', 325 + { 326 + type: 'error', 327 + }, 318 328 ) 319 329 }, 320 330 }) ··· 327 337 message: 'Chat deleted', 328 338 }), 329 339 ), 330 - 'check', 340 + { 341 + type: 'success', 342 + }, 331 343 ) 332 344 leaveConvo() 333 345 }, [leaveConvo, _])
+1 -1
src/screens/ModerationInteractionSettings/index.tsx
··· 16 16 threadgateAllowUISettingToAllowRecordValue, 17 17 threadgateRecordToAllowUISetting, 18 18 } from '#/state/queries/threadgate' 19 - import * as Toast from '#/view/com/util/Toast' 20 19 import {atoms as a, useGutters} from '#/alf' 21 20 import {Admonition} from '#/components/Admonition' 22 21 import {PostInteractionSettingsForm} from '#/components/dialogs/PostInteractionSettingsDialog' 23 22 import * as Layout from '#/components/Layout' 24 23 import {Loader} from '#/components/Loader' 24 + import * as Toast from '#/components/Toast' 25 25 26 26 export function Screen() { 27 27 const gutters = useGutters(['base'])
+7 -3
src/screens/PostThread/components/ThreadItemAnchorFollowButton.tsx
··· 12 12 useProfileQuery, 13 13 } from '#/state/queries/profile' 14 14 import {useRequireAuth} from '#/state/session' 15 - import * as Toast from '#/view/com/util/Toast' 16 15 import {atoms as a, useBreakpoints} from '#/alf' 17 16 import {Button, ButtonIcon, ButtonText} from '#/components/Button' 18 17 import {Check_Stroke2_Corner0_Rounded as CheckIcon} from '#/components/icons/Check' 19 18 import {PlusLarge_Stroke2_Corner0_Rounded as PlusIcon} from '#/components/icons/Plus' 19 + import * as Toast from '#/components/Toast' 20 20 import {IS_IOS} from '#/env' 21 21 import {GrowthHack} from './GrowthHack' 22 22 ··· 114 114 } catch (e: any) { 115 115 if (e?.name !== 'AbortError') { 116 116 logger.error('Failed to follow', {message: String(e)}) 117 - Toast.show(_(msg`There was an issue! ${e.toString()}`), 'xmark') 117 + Toast.show(_(msg`There was an issue! ${e.toString()}`), { 118 + type: 'error', 119 + }) 118 120 } 119 121 } 120 122 }) ··· 125 127 } catch (e: any) { 126 128 if (e?.name !== 'AbortError') { 127 129 logger.error('Failed to unfollow', {message: String(e)}) 128 - Toast.show(_(msg`There was an issue! ${e.toString()}`), 'xmark') 130 + Toast.show(_(msg`There was an issue! ${e.toString()}`), { 131 + type: 'error', 132 + }) 129 133 } 130 134 } 131 135 })
+1 -1
src/screens/Profile/Header/EditProfileDialog.tsx
··· 12 12 import {type ImageMeta} from '#/state/gallery' 13 13 import {useProfileUpdateMutation} from '#/state/queries/profile' 14 14 import {ErrorMessage} from '#/view/com/util/error/ErrorMessage' 15 - import * as Toast from '#/view/com/util/Toast' 16 15 import {EditableUserAvatar} from '#/view/com/util/UserAvatar' 17 16 import {UserBanner} from '#/view/com/util/UserBanner' 18 17 import {atoms as a, useTheme} from '#/alf' ··· 23 22 import {InlineLinkText} from '#/components/Link' 24 23 import {Loader} from '#/components/Loader' 25 24 import * as Prompt from '#/components/Prompt' 25 + import * as Toast from '#/components/Toast' 26 26 import {Text} from '#/components/Typography' 27 27 import {useSimpleVerificationState} from '#/components/verification' 28 28
+10 -4
src/screens/Profile/components/ProfileFeedHeader.tsx
··· 21 21 } from '#/state/queries/preferences' 22 22 import {useSession} from '#/state/session' 23 23 import {formatCount} from '#/view/com/util/numeric/format' 24 - import * as Toast from '#/view/com/util/Toast' 25 24 import {UserAvatar} from '#/view/com/util/UserAvatar' 26 25 import {atoms as a, useBreakpoints, useTheme, web} from '#/alf' 27 26 import {Button, ButtonIcon, ButtonText} from '#/components/Button' ··· 50 49 useReportDialogControl, 51 50 } from '#/components/moderation/ReportDialog' 52 51 import {RichText} from '#/components/RichText' 52 + import * as Toast from '#/components/Toast' 53 53 import {Text} from '#/components/Typography' 54 54 import {useAnalytics} from '#/analytics' 55 55 import {IS_WEB} from '#/env' ··· 139 139 _( 140 140 msg`There was an issue updating your feeds, please check your internet connection and try again.`, 141 141 ), 142 - 'xmark', 142 + { 143 + type: 'error', 144 + }, 143 145 ) 144 146 logger.error('Failed to update feeds', {message: err}) 145 147 } ··· 177 179 ax.metric('feed:pin', {feedUrl: info.uri}) 178 180 } 179 181 } catch (e) { 180 - Toast.show(_(msg`There was an issue contacting the server`), 'xmark') 182 + Toast.show(_(msg`There was an issue contacting the server`), { 183 + type: 'error', 184 + }) 181 185 logger.error('Failed to toggle pinned feed', {message: e}) 182 186 } 183 187 } ··· 421 425 _( 422 426 msg`There was an issue contacting the server, please check your internet connection and try again.`, 423 427 ), 424 - 'xmark', 428 + { 429 + type: 'error', 430 + }, 425 431 ) 426 432 logger.error('Failed to toggle like', {message: err}) 427 433 }
+7 -3
src/screens/SavedFeeds.tsx
··· 25 25 import {type UsePreferencesQueryResponse} from '#/state/queries/preferences/types' 26 26 import {useSetMinimalShellMode} from '#/state/shell' 27 27 import {FeedSourceCard} from '#/view/com/feeds/FeedSourceCard' 28 - import * as Toast from '#/view/com/util/Toast' 29 28 import {NoFollowingFeed} from '#/screens/Feeds/NoFollowingFeed' 30 29 import {NoSavedFeedsOfAnyType} from '#/screens/Feeds/NoSavedFeedsOfAnyType' 31 30 import {atoms as a, useBreakpoints, useTheme} from '#/alf' ··· 43 42 import * as Layout from '#/components/Layout' 44 43 import {InlineLinkText} from '#/components/Link' 45 44 import {Loader} from '#/components/Loader' 45 + import * as Toast from '#/components/Toast' 46 46 import {Text} from '#/components/Typography' 47 47 48 48 type Props = NativeStackScreenProps<CommonNavigatorParams, 'SavedFeeds'> ··· 104 104 navigation.navigate('Feeds') 105 105 } 106 106 } catch (e) { 107 - Toast.show(_(msg`There was an issue contacting the server`), 'xmark') 107 + Toast.show(_(msg`There was an issue contacting the server`), { 108 + type: 'error', 109 + }) 108 110 logger.error('Failed to toggle pinned feed', {message: e}) 109 111 } 110 112 } ··· 288 290 navigation.navigate('Feeds') 289 291 } 290 292 } catch (e) { 291 - Toast.show(_(msg`There was an issue contacting the server`), 'xmark') 293 + Toast.show(_(msg`There was an issue contacting the server`), { 294 + type: 'error', 295 + }) 292 296 logger.error('Failed to toggle pinned feed', {message: e}) 293 297 } 294 298 }
+1 -1
src/screens/Settings/AboutSettings.tsx
··· 10 10 11 11 import {STATUS_PAGE_URL} from '#/lib/constants' 12 12 import {type CommonNavigatorParams} from '#/lib/routes/types' 13 - import * as Toast from '#/view/com/util/Toast' 14 13 import * as SettingsList from '#/screens/Settings/components/SettingsList' 15 14 import {Atom_Stroke2_Corner0_Rounded as AtomIcon} from '#/components/icons/Atom' 16 15 import {BroomSparkle_Stroke2_Corner2_Rounded as BroomSparkleIcon} from '#/components/icons/BroomSparkle' ··· 20 19 import {Wrench_Stroke2_Corner2_Rounded as WrenchIcon} from '#/components/icons/Wrench' 21 20 import * as Layout from '#/components/Layout' 22 21 import {Loader} from '#/components/Loader' 22 + import * as Toast from '#/components/Toast' 23 23 import {getDeviceId} from '#/analytics/identifiers' 24 24 import {IS_ANDROID, IS_IOS, IS_NATIVE} from '#/env' 25 25 import * as env from '#/env'
+1 -1
src/screens/Settings/AppPasswords.tsx
··· 20 20 } from '#/state/queries/app-passwords' 21 21 import {EmptyState} from '#/view/com/util/EmptyState' 22 22 import {ErrorScreen} from '#/view/com/util/error/ErrorScreen' 23 - import * as Toast from '#/view/com/util/Toast' 24 23 import {atoms as a, useTheme} from '#/alf' 25 24 import {Admonition} from '#/components/Admonition' 26 25 import {Button, ButtonIcon, ButtonText} from '#/components/Button' ··· 32 31 import * as Layout from '#/components/Layout' 33 32 import {Loader} from '#/components/Loader' 34 33 import * as Prompt from '#/components/Prompt' 34 + import * as Toast from '#/components/Toast' 35 35 import {Text} from '#/components/Typography' 36 36 import {AddAppPasswordDialog} from './components/AddAppPasswordDialog' 37 37 import * as SettingsList from './components/SettingsList'
+4 -2
src/screens/Settings/InterestsSettings.tsx
··· 22 22 import {createGetSuggestedUsersQueryKey} from '#/state/queries/trending/useGetSuggestedUsersQuery' 23 23 import {createSuggestedStarterPacksQueryKey} from '#/state/queries/useSuggestedStarterPacksQuery' 24 24 import {useAgent} from '#/state/session' 25 - import * as Toast from '#/view/com/util/Toast' 26 25 import {atoms as a, useGutters, useTheme} from '#/alf' 27 26 import {Admonition} from '#/components/Admonition' 28 27 import {Divider} from '#/components/Divider' 29 28 import * as Toggle from '#/components/forms/Toggle' 30 29 import * as Layout from '#/components/Layout' 31 30 import {Loader} from '#/components/Loader' 31 + import * as Toast from '#/components/Toast' 32 32 import {Text} from '#/components/Typography' 33 33 34 34 type Props = NativeStackScreenProps<CommonNavigatorParams, 'InterestsSettings'> ··· 139 139 context: 'toast', 140 140 }), 141 141 ), 142 - 'xmark', 142 + { 143 + type: 'error', 144 + }, 143 145 ) 144 146 } finally { 145 147 setIsSaving(false)
+4 -3
src/screens/Settings/Settings.tsx
··· 28 28 import {useOnboardingDispatch} from '#/state/shell' 29 29 import {useLoggedOutViewControls} from '#/state/shell/logged-out' 30 30 import {useCloseAllActiveElements} from '#/state/util' 31 - import * as Toast from '#/view/com/util/Toast' 32 31 import {UserAvatar} from '#/view/com/util/UserAvatar' 33 32 import * as SettingsList from '#/screens/Settings/components/SettingsList' 34 33 import {atoms as a, platform, tokens, useBreakpoints, useTheme} from '#/alf' ··· 63 62 import {ID as PolicyUpdate202508} from '#/components/PolicyUpdateOverlay/updates/202508/config' 64 63 import {ProfileBadges} from '#/components/ProfileBadges' 65 64 import * as Prompt from '#/components/Prompt' 65 + import * as Toast from '#/components/Toast' 66 66 import {Text} from '#/components/Typography' 67 67 import {useAnalytics} from '#/analytics' 68 68 import {IS_INTERNAL, IS_IOS, IS_NATIVE} from '#/env' ··· 520 520 </SettingsList.ItemText> 521 521 </SettingsList.PressableItem> 522 522 ) : null} 523 - 524 523 <SettingsList.Divider /> 525 524 <View style={[a.p_xl, a.gap_md]}> 526 525 <Text style={[a.text_lg, a.font_semi_bold]}> ··· 545 544 onPress={() => { 546 545 device.set([PolicyUpdate202508], false) 547 546 agent.bskyAppRemoveNuxs([PolicyUpdate202508]) 548 - Toast.show(`Done`, 'info') 547 + Toast.show(`Done`, { 548 + type: 'info', 549 + }) 549 550 }} 550 551 label="Reset policy update nux" 551 552 color="secondary"
+1 -1
src/screens/Settings/components/DisableEmail2FADialog.tsx
··· 7 7 import {cleanError} from '#/lib/strings/errors' 8 8 import {useAgent, useSession} from '#/state/session' 9 9 import {ErrorMessage} from '#/view/com/util/error/ErrorMessage' 10 - import * as Toast from '#/view/com/util/Toast' 11 10 import {atoms as a, useBreakpoints, useTheme} from '#/alf' 12 11 import {Button, ButtonIcon, ButtonText} from '#/components/Button' 13 12 import * as Dialog from '#/components/Dialog' 14 13 import * as TextField from '#/components/forms/TextField' 15 14 import {Lock_Stroke2_Corner0_Rounded as Lock} from '#/components/icons/Lock' 16 15 import {Loader} from '#/components/Loader' 16 + import * as Toast from '#/components/Toast' 17 17 import {P, Text} from '#/components/Typography' 18 18 import {IS_NATIVE} from '#/env' 19 19
+4 -2
src/screens/Settings/components/OTAInfo.tsx
··· 4 4 import {Trans} from '@lingui/react/macro' 5 5 import {useMutation, useQuery} from '@tanstack/react-query' 6 6 7 - import * as Toast from '#/view/com/util/Toast' 8 7 import {Button, ButtonIcon, ButtonText} from '#/components/Button' 9 8 import {ArrowRotateCounterClockwise_Stroke2_Corner0_Rounded as RetryIcon} from '#/components/icons/ArrowRotate' 10 9 import {Shapes_Stroke2_Corner0_Rounded as ShapesIcon} from '#/components/icons/Shapes' 11 10 import {Loader} from '#/components/Loader' 11 + import * as Toast from '#/components/Toast' 12 12 import * as SettingsList from '../components/SettingsList' 13 13 14 14 export function OTAInfo() { ··· 34 34 await Updates.reloadAsync() 35 35 }, 36 36 onError: error => 37 - Toast.show(`Failed to update: ${error.message}`, 'xmark'), 37 + Toast.show(`Failed to update: ${error.message}`, { 38 + type: 'error', 39 + }), 38 40 }) 39 41 40 42 if (!Updates.isEnabled || __DEV__) {
+10 -4
src/screens/StarterPack/StarterPackScreen.tsx
··· 46 46 import {useSetActiveStarterPack} from '#/state/shell/starter-pack' 47 47 import {PagerWithHeader} from '#/view/com/pager/PagerWithHeader' 48 48 import {ProfileSubpageHeader} from '#/view/com/profile/ProfileSubpageHeader' 49 - import * as Toast from '#/view/com/util/Toast' 50 49 import {bulkWriteFollows} from '#/screens/Onboarding/util' 51 50 import {atoms as a, useBreakpoints, useTheme} from '#/alf' 52 51 import {Button, ButtonIcon, ButtonText} from '#/components/Button' ··· 74 73 import {ProfilesList} from '#/components/StarterPack/Main/ProfilesList' 75 74 import {QrCodeDialog} from '#/components/StarterPack/QrCodeDialog' 76 75 import {ShareDialog} from '#/components/StarterPack/ShareDialog' 76 + import * as Toast from '#/components/Toast' 77 77 import {Text} from '#/components/Typography' 78 78 import {useAnalytics} from '#/analytics' 79 79 import {IS_WEB} from '#/env' ··· 356 356 listItems = await getAllListMembers(agent, starterPack.list.uri) 357 357 } catch (e) { 358 358 setIsProcessing(false) 359 - Toast.show(_(msg`An error occurred while trying to follow all`), 'xmark') 359 + Toast.show(_(msg`An error occurred while trying to follow all`), { 360 + type: 'error', 361 + }) 360 362 logger.error('Failed to get list members for starter pack', { 361 363 safeMessage: e, 362 364 }) ··· 381 383 }) 382 384 } catch (e) { 383 385 setIsProcessing(false) 384 - Toast.show(_(msg`An error occurred while trying to follow all`), 'xmark') 386 + Toast.show(_(msg`An error occurred while trying to follow all`), { 387 + type: 'error', 388 + }) 385 389 logger.error('Failed to follow all accounts', {safeMessage: e}) 386 390 } 387 391 ··· 749 753 onError: e => { 750 754 setIsProcessing(false) 751 755 logger.error('Failed to delete invalid starter pack', {safeMessage: e}) 752 - Toast.show(_(msg`Failed to delete starter pack`), 'xmark') 756 + Toast.show(_(msg`Failed to delete starter pack`), { 757 + type: 'error', 758 + }) 753 759 }, 754 760 }) 755 761
+7 -3
src/screens/StarterPack/Wizard/State.tsx
··· 7 7 import {msg, plural} from '@lingui/core/macro' 8 8 9 9 import {STARTER_PACK_MAX_SIZE} from '#/lib/constants' 10 - import * as Toast from '#/view/com/util/Toast' 10 + import * as Toast from '#/components/Toast' 11 11 import * as bsky from '#/types/bsky' 12 12 13 13 const steps = ['Details', 'Profiles', 'Feeds'] as const ··· 80 80 msg`You may only add up to ${plural(STARTER_PACK_MAX_SIZE, { 81 81 other: `${STARTER_PACK_MAX_SIZE} profiles`, 82 82 })}`.message ?? '', 83 - 'info', 83 + { 84 + type: 'info', 85 + }, 84 86 ) 85 87 } else { 86 88 updatedState = {...state, profiles: [...state.profiles, action.profile]} ··· 96 98 break 97 99 case 'AddFeed': 98 100 if (state.feeds.length >= 3) { 99 - Toast.show(msg`You may only add up to 3 feeds`.message ?? '', 'info') 101 + Toast.show(msg`You may only add up to 3 feeds`.message ?? '', { 102 + type: 'info', 103 + }) 100 104 } else { 101 105 updatedState = {...state, feeds: [...state.feeds, action.feed]} 102 106 }
+7 -3
src/screens/StarterPack/Wizard/index.tsx
··· 40 40 } from '#/state/queries/starter-packs' 41 41 import {useSession} from '#/state/session' 42 42 import {useSetMinimalShellMode} from '#/state/shell' 43 - import * as Toast from '#/view/com/util/Toast' 44 43 import {UserAvatar} from '#/view/com/util/UserAvatar' 45 44 import { 46 45 useWizardState, ··· 56 55 import {ListMaybePlaceholder} from '#/components/Lists' 57 56 import {Loader} from '#/components/Loader' 58 57 import {WizardEditListDialog} from '#/components/StarterPack/Wizard/WizardEditListDialog' 58 + import * as Toast from '#/components/Toast' 59 59 import {Text} from '#/components/Typography' 60 60 import {useAnalytics} from '#/analytics' 61 61 import {IS_NATIVE} from '#/env' ··· 258 258 onError: e => { 259 259 logger.error('Failed to create starter pack', {safeMessage: e}) 260 260 dispatch({type: 'SetProcessing', processing: false}) 261 - Toast.show(_(msg`Failed to create starter pack`), 'xmark') 261 + Toast.show(_(msg`Failed to create starter pack`), { 262 + type: 'error', 263 + }) 262 264 }, 263 265 }) 264 266 const {mutate: editStarterPack} = useEditStarterPackMutation({ ··· 266 268 onError: e => { 267 269 logger.error('Failed to edit starter pack', {safeMessage: e}) 268 270 dispatch({type: 'SetProcessing', processing: false}) 269 - Toast.show(_(msg`Failed to create starter pack`), 'xmark') 271 + Toast.show(_(msg`Failed to create starter pack`), { 272 + type: 'error', 273 + }) 270 274 }, 271 275 }) 272 276
+1 -1
src/state/queries/activity-subscriptions.ts
··· 14 14 } from '@tanstack/react-query' 15 15 16 16 import {useAgent, useSession} from '#/state/session' 17 - import * as Toast from '#/view/com/util/Toast' 17 + import * as Toast from '#/components/Toast' 18 18 19 19 export const RQKEY_getActivitySubscriptions = ['activity-subscriptions'] 20 20 export const RQKEY_getNotificationDeclaration = ['notification-declaration']
+4 -2
src/state/queries/notifications/settings.ts
··· 9 9 10 10 import {logger} from '#/logger' 11 11 import {useAgent} from '#/state/session' 12 - import * as Toast from '#/view/com/util/Toast' 12 + import * as Toast from '#/components/Toast' 13 13 14 14 const RQKEY_ROOT = 'notification-settings' 15 15 const RQKEY = [RQKEY_ROOT] ··· 46 46 onError: e => { 47 47 logger.error('Could not update notification settings', {message: e}) 48 48 queryClient.invalidateQueries({queryKey: RQKEY}) 49 - Toast.show(t`Could not update notification settings`, 'xmark') 49 + Toast.show(t`Could not update notification settings`, { 50 + type: 'error', 51 + }) 50 52 }, 51 53 }) 52 54 }
+1 -1
src/state/queries/pinned-post.ts
··· 4 4 5 5 import {logger} from '#/logger' 6 6 import {RQKEY as FEED_RQKEY} from '#/state/queries/post-feed' 7 - import * as Toast from '#/view/com/util/Toast' 7 + import * as Toast from '#/components/Toast' 8 8 import {updatePostShadow} from '../cache/post-shadow' 9 9 import {useAgent, useSession} from '../session' 10 10 import {useProfileUpdateMutation} from './profile'
+4 -5
src/state/shell/composer/index.tsx
··· 18 18 RQKEY_LINK_ROOT, 19 19 } from '#/state/queries/resolve-link' 20 20 import {type EmojiPickerPosition} from '#/view/com/composer/text-input/web/EmojiPicker' 21 - import * as Toast from '#/view/com/util/Toast' 21 + import * as Toast from '#/components/Toast' 22 22 23 23 export interface ComposerOptsPostRef { 24 24 uri: string ··· 104 104 author.viewer?.blockingByList), 105 105 ) 106 106 if (isBlocked) { 107 - Toast.show( 108 - _(msg`Cannot interact with a blocked user`), 109 - 'exclamation-circle', 110 - ) 107 + Toast.show(_(msg`Cannot interact with a blocked user`), { 108 + type: 'warning', 109 + }) 111 110 } else { 112 111 setState(prevOpts => { 113 112 if (prevOpts) {
+1 -1
src/view/com/composer/videos/SubtitleFilePicker.tsx
··· 5 5 import {Trans} from '@lingui/react/macro' 6 6 7 7 import {logger} from '#/logger' 8 - import * as Toast from '#/view/com/util/Toast' 9 8 import {atoms as a} from '#/alf' 10 9 import {Button, ButtonIcon, ButtonText} from '#/components/Button' 11 10 import {CC_Stroke2_Corner0_Rounded as CCIcon} from '#/components/icons/CC' 11 + import * as Toast from '#/components/Toast' 12 12 13 13 export function SubtitleFilePicker({ 14 14 onSelectFile,
+4 -2
src/view/com/composer/videos/VideoPreview.web.tsx
··· 7 7 import {clamp} from '#/lib/numbers' 8 8 import {useAutoplayDisabled} from '#/state/preferences' 9 9 import {ExternalEmbedRemoveBtn} from '#/view/com/composer/ExternalEmbedRemoveBtn' 10 - import * as Toast from '#/view/com/util/Toast' 11 10 import {atoms as a} from '#/alf' 11 + import * as Toast from '#/components/Toast' 12 12 import {PlayButtonIcon} from '#/components/video/PlayButtonIcon' 13 13 14 14 export function VideoPreview({ ··· 63 63 playsInline 64 64 onError={err => { 65 65 console.error('Error loading video', err) 66 - Toast.show(_(msg`Could not process your video`), 'xmark') 66 + Toast.show(_(msg`Could not process your video`), { 67 + type: 'error', 68 + }) 67 69 clear() 68 70 }} 69 71 />
+7 -3
src/view/com/notifications/NotificationFeedItem.tsx
··· 44 44 import {Post} from '#/view/com/post/Post' 45 45 import {formatCount} from '#/view/com/util/numeric/format' 46 46 import {TimeElapsed} from '#/view/com/util/TimeElapsed' 47 - import * as Toast from '#/view/com/util/Toast' 48 47 import {PreviewableUserAvatar, UserAvatar} from '#/view/com/util/UserAvatar' 49 48 import {atoms as a, platform, useTheme} from '#/alf' 50 49 import {Button, ButtonIcon, ButtonText} from '#/components/Button' ··· 67 66 import {ProfileHoverCard} from '#/components/ProfileHoverCard' 68 67 import {Notification as StarterPackCard} from '#/components/StarterPack/StarterPackCard' 69 68 import {SubtleHover} from '#/components/SubtleHover' 69 + import * as Toast from '#/components/Toast' 70 70 import {Text} from '#/components/Typography' 71 71 import * as bsky from '#/types/bsky' 72 72 ··· 769 769 ) 770 770 } catch (err: any) { 771 771 if (err?.name !== 'AbortError') { 772 - Toast.show(_(msg`An issue occurred, please try again.`), 'xmark') 772 + Toast.show(_(msg`An issue occurred, please try again.`), { 773 + type: 'error', 774 + }) 773 775 } 774 776 } 775 777 } ··· 789 791 ) 790 792 } catch (err: any) { 791 793 if (err?.name !== 'AbortError') { 792 - Toast.show(_(msg`An issue occurred, please try again.`), 'xmark') 794 + Toast.show(_(msg`An issue occurred, please try again.`), { 795 + type: 'error', 796 + }) 793 797 } 794 798 } 795 799 }
+7 -3
src/view/com/posts/FeedShutdownMsg.tsx
··· 12 12 useReplaceForYouWithDiscoverFeedMutation, 13 13 } from '#/state/queries/preferences' 14 14 import {useSetSelectedFeed} from '#/state/shell/selected-feed' 15 - import * as Toast from '#/view/com/util/Toast' 16 15 import {atoms as a, useTheme} from '#/alf' 17 16 import {Button, ButtonIcon, ButtonText} from '#/components/Button' 18 17 import {InlineLinkText} from '#/components/Link' 19 18 import {Loader} from '#/components/Loader' 19 + import * as Toast from '#/components/Toast' 20 20 import {Text} from '#/components/Typography' 21 21 22 22 export function FeedShutdownMsg({feedUri}: {feedUri: string}) { ··· 52 52 _( 53 53 msg`There was an issue updating your feeds, please check your internet connection and try again.`, 54 54 ), 55 - 'exclamation-circle', 55 + { 56 + type: 'warning', 57 + }, 56 58 ) 57 59 logger.error('Failed to update feeds', {message: err}) 58 60 } ··· 71 73 _( 72 74 msg`There was an issue updating your feeds, please check your internet connection and try again.`, 73 75 ), 74 - 'exclamation-circle', 76 + { 77 + type: 'warning', 78 + }, 75 79 ) 76 80 logger.error('Failed to update feeds', {message: err}) 77 81 }
+19 -7
src/view/com/profile/ProfileMenu.tsx
··· 22 22 } from '#/state/queries/profile' 23 23 import {useSession} from '#/state/session' 24 24 import {EventStopper} from '#/view/com/util/EventStopper' 25 - import * as Toast from '#/view/com/util/Toast' 26 25 import {atoms as a, useTheme} from '#/alf' 27 26 import {Button, ButtonIcon} from '#/components/Button' 28 27 import {useDialogControl} from '#/components/Dialog' ··· 52 51 useReportDialogControl, 53 52 } from '#/components/moderation/ReportDialog' 54 53 import * as Prompt from '#/components/Prompt' 54 + import * as Toast from '#/components/Toast' 55 55 import {useFullVerificationState} from '#/components/verification' 56 56 import {VerificationCreatePrompt} from '#/components/verification/VerificationCreatePrompt' 57 57 import {VerificationRemovePrompt} from '#/components/verification/VerificationRemovePrompt' ··· 149 149 } catch (e: any) { 150 150 if (e?.name !== 'AbortError') { 151 151 ax.logger.error('Failed to unmute account', {message: e}) 152 - Toast.show(_(msg`There was an issue! ${e.toString()}`), 'xmark') 152 + Toast.show(_(msg`There was an issue! ${e.toString()}`), { 153 + type: 'error', 154 + }) 153 155 } 154 156 } 155 157 } else { ··· 159 161 } catch (e: any) { 160 162 if (e?.name !== 'AbortError') { 161 163 ax.logger.error('Failed to mute account', {message: e}) 162 - Toast.show(_(msg`There was an issue! ${e.toString()}`), 'xmark') 164 + Toast.show(_(msg`There was an issue! ${e.toString()}`), { 165 + type: 'error', 166 + }) 163 167 } 164 168 } 165 169 } ··· 173 177 } catch (e: any) { 174 178 if (e?.name !== 'AbortError') { 175 179 ax.logger.error('Failed to unblock account', {message: e}) 176 - Toast.show(_(msg`There was an issue! ${e.toString()}`), 'xmark') 180 + Toast.show(_(msg`There was an issue! ${e.toString()}`), { 181 + type: 'error', 182 + }) 177 183 } 178 184 } 179 185 } else { ··· 183 189 } catch (e: any) { 184 190 if (e?.name !== 'AbortError') { 185 191 ax.logger.error('Failed to block account', {message: e}) 186 - Toast.show(_(msg`There was an issue! ${e.toString()}`), 'xmark') 192 + Toast.show(_(msg`There was an issue! ${e.toString()}`), { 193 + type: 'error', 194 + }) 187 195 } 188 196 } 189 197 } ··· 196 204 } catch (e: any) { 197 205 if (e?.name !== 'AbortError') { 198 206 ax.logger.error('Failed to follow account', {message: e}) 199 - Toast.show(_(msg`There was an issue! ${e.toString()}`), 'xmark') 207 + Toast.show(_(msg`There was an issue! ${e.toString()}`), { 208 + type: 'error', 209 + }) 200 210 } 201 211 } 202 212 }, [_, ax, queueFollow]) ··· 208 218 } catch (e: any) { 209 219 if (e?.name !== 'AbortError') { 210 220 ax.logger.error('Failed to unfollow account', {message: e}) 211 - Toast.show(_(msg`There was an issue! ${e.toString()}`), 'xmark') 221 + Toast.show(_(msg`There was an issue! ${e.toString()}`), { 222 + type: 'error', 223 + }) 212 224 } 213 225 } 214 226 }, [_, ax, queueUnfollow])
+1 -1
src/view/screens/Debug.tsx
··· 16 16 import {Button} from '#/view/com/util/forms/Button' 17 17 import * as LoadingPlaceholder from '#/view/com/util/LoadingPlaceholder' 18 18 import {Text} from '#/view/com/util/text/Text' 19 - import * as Toast from '#/view/com/util/Toast' 20 19 import {ViewHeader} from '#/view/com/util/ViewHeader' 21 20 import {ViewSelector} from '#/view/com/util/ViewSelector' 22 21 import {HashtagWide_Stroke1_Corner0_Rounded as HashtagWideIcon} from '#/components/icons/Hashtag' 23 22 import * as Layout from '#/components/Layout' 23 + import * as Toast from '#/components/Toast' 24 24 25 25 const MAIN_VIEWS = ['Base', 'Controls', 'Error', 'Notifs'] 26 26
+1 -1
src/view/screens/Storybook/Settings.tsx
··· 1 1 import {View} from 'react-native' 2 2 3 - import * as Toast from '#/view/com/util/Toast' 4 3 import * as SettingsList from '#/screens/Settings/components/SettingsList' 5 4 import {atoms as a, useTheme} from '#/alf' 6 5 import {Alien_Stroke2_Corner0_Rounded as AlienIcon} from '#/components/icons/Alien' ··· 16 15 import {RaisingHand4Finger_Stroke2_Corner2_Rounded as HandIcon} from '#/components/icons/RaisingHand' 17 16 import {ShieldCheck_Stroke2_Corner0_Rounded as ShieldIcon} from '#/components/icons/Shield' 18 17 import {Window_Stroke2_Corner2_Rounded as WindowIcon} from '#/components/icons/Window' 18 + import * as Toast from '#/components/Toast' 19 19 import {Text} from '#/components/Typography' 20 20 21 21 export function Settings() {