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

This commit is contained in:
DS Boyce
2026-03-12 11:35:58 -07:00
committed by GitHub
parent 9c9970f680
commit 35cb2bcf94
62 changed files with 422 additions and 171 deletions
+7 -3
View File
@@ -3,7 +3,7 @@ import {Share} from 'react-native'
import {setStringAsync} from 'expo-clipboard'
import {t} from '@lingui/core/macro'
import * as Toast from '#/view/com/util/Toast'
import * as Toast from '#/components/Toast'
import {IS_ANDROID, IS_IOS} from '#/env'
/**
@@ -21,7 +21,9 @@ export async function shareUrl(url: string) {
// React Native Share is not supported by web. Web Share API
// has increasing but not full support, so default to clipboard
setStringAsync(url)
Toast.show(t`Copied to clipboard`, 'clipboard-check')
Toast.show(t`Copied to clipboard`, {
type: 'success',
})
}
}
@@ -37,6 +39,8 @@ export async function shareText(text: string) {
await Share.share({message: text})
} else {
await setStringAsync(text)
Toast.show(t`Copied to clipboard`, 'clipboard-check')
Toast.show(t`Copied to clipboard`, {
type: 'success',
})
}
}