84caf1e8d8
* remove unused packages, switch to `expo-linear-gradient` * upgrade expo deps * rm blur view * re-add normalize-url * replace `react-native-version-number` with `expo-application` * add `expo-haptics` * rm `react-native-haptic-feedback` * migrate to `expo-haptics` * add `expo-clipboard` * migrate to `expo-clipboard` * add `expo-file-system` * migrate to `expo-file-system` and `expo-image-manipulator` passing tests remove other `react-native-fs` usages move to `expo-image-manipulator` for resizes remove react-native-image-resizer update tests update jest setup simplify some logic properly cleanup files migrate file downloads to `expo-file-system` rm `rn-fetch-blob` * delete file after uploading blob on native * fix file move error * add `react-native-date-picker` * rm `@reactnativecommunity/datetimepicker` * migrate to `react-native-date-picker` * use modal on android * fix android alf * use @discord/bottom-sheet * rm some patches * remove expo-dev-client * rm metro config changes that have been merged * Working build * ignore error for now * ignore error for now * add newArchEnabled flag * add types/invariant
65 lines
1.6 KiB
TypeScript
65 lines
1.6 KiB
TypeScript
import React from 'react'
|
|
import {StyleSheet, Text, View, Pressable} from 'react-native'
|
|
import {LinearGradient} from 'expo-linear-gradient'
|
|
import {s, colors, gradients} from 'lib/styles'
|
|
import {usePalette} from 'lib/hooks/usePalette'
|
|
import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries'
|
|
import {Trans, msg} from '@lingui/macro'
|
|
import {useLingui} from '@lingui/react'
|
|
|
|
export const ConfirmLanguagesButton = ({
|
|
onPress,
|
|
extraText,
|
|
}: {
|
|
onPress: () => void
|
|
extraText?: string
|
|
}) => {
|
|
const pal = usePalette('default')
|
|
const {_} = useLingui()
|
|
const {isMobile} = useWebMediaQueries()
|
|
return (
|
|
<View
|
|
style={[
|
|
styles.btnContainer,
|
|
pal.borderDark,
|
|
isMobile && {
|
|
paddingBottom: 40,
|
|
borderTopWidth: 1,
|
|
},
|
|
]}>
|
|
<Pressable
|
|
testID="confirmContentLanguagesBtn"
|
|
onPress={onPress}
|
|
accessibilityRole="button"
|
|
accessibilityLabel={_(msg`Confirm content language settings`)}
|
|
accessibilityHint="">
|
|
<LinearGradient
|
|
colors={[gradients.blueLight.start, gradients.blueLight.end]}
|
|
start={{x: 0, y: 0}}
|
|
end={{x: 1, y: 1}}
|
|
style={[styles.btn]}>
|
|
<Text style={[s.white, s.bold, s.f18]}>
|
|
<Trans>Done{extraText}</Trans>
|
|
</Text>
|
|
</LinearGradient>
|
|
</Pressable>
|
|
</View>
|
|
)
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
btnContainer: {
|
|
paddingTop: 10,
|
|
paddingHorizontal: 10,
|
|
},
|
|
btn: {
|
|
flexDirection: 'row',
|
|
alignItems: 'center',
|
|
justifyContent: 'center',
|
|
width: '100%',
|
|
borderRadius: 32,
|
|
padding: 14,
|
|
backgroundColor: colors.gray1,
|
|
},
|
|
})
|