[Video] Make compress/upload cancelable (#4996)

* add abort controller to video upload system

* rm log

* rm log 2
This commit is contained in:
Samuel Newman
2024-08-29 17:00:12 +01:00
committed by GitHub
parent 551c4a4f32
commit ea5ab99399
10 changed files with 104 additions and 58 deletions
@@ -3,18 +3,19 @@ import {View} from 'react-native'
// @ts-expect-error no type definition
import ProgressPie from 'react-native-progress/Pie'
import {ImagePickerAsset} from 'expo-image-picker'
import {Trans} from '@lingui/macro'
import {atoms as a, useTheme} from '#/alf'
import {Text} from '#/components/Typography'
import {ExternalEmbedRemoveBtn} from '../ExternalEmbedRemoveBtn'
import {VideoTranscodeBackdrop} from './VideoTranscodeBackdrop'
export function VideoTranscodeProgress({
asset,
progress,
clear,
}: {
asset: ImagePickerAsset
progress: number
clear: () => void
}) {
const t = useTheme()
@@ -41,16 +42,14 @@ export function VideoTranscodeProgress({
a.inset_0,
]}>
<ProgressPie
size={64}
borderWidth={4}
size={48}
borderWidth={3}
borderColor={t.atoms.text.color}
color={t.atoms.text.color}
progress={progress}
/>
<Text>
<Trans>Compressing...</Trans>
</Text>
</View>
<ExternalEmbedRemoveBtn onRemove={clear} />
</View>
)
}