diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index b3272cd3b6..dce3256f27 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -129,7 +129,7 @@ import {EmojiArc_Stroke2_Corner0_Rounded as EmojiSmile} from '#/components/icons import {TimesLarge_Stroke2_Corner0_Rounded as X} from '#/components/icons/Times' import {LazyQuoteEmbed} from '#/components/Post/Embed/LazyQuoteEmbed' import * as Prompt from '#/components/Prompt' -import {toast} from '#/components/Toast' +import * as toast from '#/components/Toast' import {Text as NewText} from '#/components/Typography' import {BottomSheetPortalProvider} from '../../../../modules/bottom-sheet' import { @@ -815,10 +815,8 @@ let ComposerPost = React.memo(function ComposerPost({ if (isNative) return // web only const [mimeType] = uri.slice('data:'.length).split(';') if (!SUPPORTED_MIME_TYPES.includes(mimeType as SupportedMimeTypes)) { - toast.show({ + toast.show(_(msg`Unsupported video type`), { type: 'error', - content: _(msg`Unsupported video type`), - a11yLabel: _(msg`Unsupported video type.`), }) return } @@ -1255,8 +1253,6 @@ function ComposerFooter({ dispatch, showAddButton, onEmojiButtonPress, - onError, - onSelectVideo, onAddPost, }: { @@ -1338,12 +1334,9 @@ function ComposerFooter({ } } - errors.map((error, i) => { - toast.show({ + errors.map(error => { + toast.show(error, { type: 'warning', - content: error, - a11yLabel: error, - duration: 3e3 * (errors.length - i), }) }) }, @@ -1369,9 +1362,7 @@ function ComposerFooter({ ) : ( diff --git a/src/view/com/composer/SelectMediaButton.tsx b/src/view/com/composer/SelectMediaButton.tsx index 8d6d13cf91..9e6f6d8674 100644 --- a/src/view/com/composer/SelectMediaButton.tsx +++ b/src/view/com/composer/SelectMediaButton.tsx @@ -22,12 +22,10 @@ import {atoms as a, useTheme} from '#/alf' import {Button} from '#/components/Button' import {useSheetWrapper} from '#/components/Dialog/sheet-wrapper' import {Image_Stroke2_Corner0_Rounded as ImageIcon} from '#/components/icons/Image' -import {toast} from '#/components/Toast' +import * as toast from '#/components/Toast' export type SelectMediaButtonProps = { - size: number disabled?: boolean - setError: (error: string) => void selectedAssetsCount: number onSelectAssets: (props: { type: AssetType @@ -433,10 +431,8 @@ export function SelectMediaButton({ ]) if (!photoAccess && !videoAccess) { - toast.show({ + toast.show(_(msg`You need to allow access to your media library.`), { type: 'error', - content: 'You need to allow access to your media library.', - a11yLabel: 'You need to allow access to your media library.', }) return } @@ -459,6 +455,7 @@ export function SelectMediaButton({ await processSelectedAssets(assets) }, [ + _, requestPhotoAccessIfNeeded, requestVideoAccessIfNeeded, sheetWrapper,