FIX: Lint

This commit is contained in:
Marcos Rodriguez Velez 2024-06-30 17:38:01 -04:00
parent dcb940b0c7
commit cb9c0044fe
No known key found for this signature in database
GPG Key ID: 6030B2F48CCE86D7
2 changed files with 12 additions and 25 deletions

14
App.tsx
View File

@ -10,25 +10,13 @@ import { BlueDarkTheme, BlueDefaultTheme } from './components/themes';
import MasterView from './navigation/MasterView'; import MasterView from './navigation/MasterView';
import { navigationRef } from './NavigationService'; import { navigationRef } from './NavigationService';
import { StorageProvider } from './components/Context/StorageProvider'; import { StorageProvider } from './components/Context/StorageProvider';
import { TrueSheet } from '@lodev09/react-native-true-sheet';
const App = () => { const App = () => {
const colorScheme = useColorScheme(); const colorScheme = useColorScheme();
const onReady = () => {
// @ts-ignore: fix later
navigationRef.current?.addListener('beforeRemove', async (e: any) => {
if (e.data.action.type === 'NAVIGATE') {
e.preventDefault();
await TrueSheet.dismiss('BottomModal');
navigationRef.current?.dispatch(e.data.action);
}
});
};
return ( return (
<LargeScreenProvider> <LargeScreenProvider>
<NavigationContainer ref={navigationRef} theme={colorScheme === 'dark' ? BlueDarkTheme : BlueDefaultTheme} onReady={onReady}> <NavigationContainer ref={navigationRef} theme={colorScheme === 'dark' ? BlueDarkTheme : BlueDefaultTheme}>
<SafeAreaProvider> <SafeAreaProvider>
<StorageProvider> <StorageProvider>
<SettingsProvider> <SettingsProvider>

View File

@ -5,10 +5,8 @@ import {
ActivityIndicator, ActivityIndicator,
FlatList, FlatList,
Keyboard, Keyboard,
KeyboardAvoidingView,
LayoutAnimation, LayoutAnimation,
PixelRatio, PixelRatio,
Platform,
StyleSheet, StyleSheet,
Text, Text,
TextInput, TextInput,
@ -132,7 +130,7 @@ const OutputModal = ({ item: { address, txid, value, vout, confirmations = 0 },
const amount = formatBalance(value, balanceUnit, true); const amount = formatBalance(value, balanceUnit, true);
const oStyles = StyleSheet.create({ const oStyles = StyleSheet.create({
container: { paddingHorizontal: 0, borderBottomColor: colors.lightBorder, backgroundColor: colors.elevated }, container: { paddingHorizontal: 0, borderBottomColor: colors.lightBorder, backgroundColor: 'transparent' },
avatar: { borderColor: 'white', borderWidth: 1, backgroundColor: color }, avatar: { borderColor: 'white', borderWidth: 1, backgroundColor: color },
amount: { fontWeight: 'bold', color: colors.foregroundColor }, amount: { fontWeight: 'bold', color: colors.foregroundColor },
tranContainer: { paddingLeft: 20 }, tranContainer: { paddingLeft: 20 },
@ -197,6 +195,7 @@ const mStyles = StyleSheet.create({
}, },
}); });
const transparentBackground = { backgroundColor: 'transparent' };
const OutputModalContent = ({ output, wallet, onUseCoin, frozen, setFrozen }) => { const OutputModalContent = ({ output, wallet, onUseCoin, frozen, setFrozen }) => {
const { colors } = useTheme(); const { colors } = useTheme();
const { txMetadata, saveToDisk } = useStorage(); const { txMetadata, saveToDisk } = useStorage();
@ -234,7 +233,12 @@ const OutputModalContent = ({ output, wallet, onUseCoin, frozen, setFrozen }) =>
]} ]}
onChangeText={onMemoChange} onChangeText={onMemoChange}
/> />
<ListItem title={loc.cc.freezeLabel} Component={TouchableWithoutFeedback} switch={switchValue} /> <ListItem
title={loc.cc.freezeLabel}
containerStyle={transparentBackground}
Component={TouchableWithoutFeedback}
switch={switchValue}
/>
<BlueSpacing20 /> <BlueSpacing20 />
<View style={mStyles.buttonContainer}> <View style={mStyles.buttonContainer}>
<Button testID="UseCoin" title={loc.cc.use_coin} onPress={() => onUseCoin([output])} /> <Button testID="UseCoin" title={loc.cc.use_coin} onPress={() => onUseCoin([output])} />
@ -417,12 +421,11 @@ const CoinControl = () => {
Keyboard.dismiss(); Keyboard.dismiss();
setOutput(false); setOutput(false);
}} }}
backgroundColor={colors.elevated}
contentContainerStyle={styles.modalContent}
> >
<KeyboardAvoidingView enabled={!Platform.isPad} behavior={Platform.OS === 'ios' ? 'position' : null}> {output && renderOutputModalContent()}
<View style={[styles.modalContent, { backgroundColor: colors.elevated }]}>{output && renderOutputModalContent()}</View>
</KeyboardAvoidingView>
</BottomModal> </BottomModal>
<FlatList <FlatList
ListHeaderComponent={tipCoins} ListHeaderComponent={tipCoins}
data={utxo} data={utxo}
@ -463,10 +466,6 @@ const styles = StyleSheet.create({
}, },
modalContent: { modalContent: {
padding: 22, padding: 22,
justifyContent: 'center',
borderTopLeftRadius: 16,
borderTopRightRadius: 16,
borderColor: 'rgba(0, 0, 0, 0.1)',
}, },
empty: { empty: {
flex: 1, flex: 1,