Merge branch 'master' into currency

This commit is contained in:
Marcos Rodriguez Vélez 2024-04-28 04:39:51 -04:00 committed by GitHub
commit b9e2df143d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 61 additions and 42 deletions

View file

@ -55,7 +55,7 @@ jobs:
MNEMONICS_COLDCARD: ${{ secrets.MNEMONICS_COLDCARD }}
e2e:
runs-on: macos-latest
runs-on: macos-13
steps:
- name: checkout
uses: actions/checkout@v4
@ -90,7 +90,7 @@ jobs:
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
java-version: '17'
- name: Build
run: npm run e2e:release-build

View file

@ -441,41 +441,4 @@ export function BlueBigCheckmark({ style = {} }) {
<Icon name="check" size={50} type="font-awesome" color="#0f5cc0" />
</View>
);
}
const tabsStyles = StyleSheet.create({
root: {
flexDirection: 'row',
height: 50,
borderColor: '#e3e3e3',
borderBottomWidth: 1,
},
tabRoot: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
borderColor: 'white',
borderBottomWidth: 2,
},
});
export const BlueTabs = ({ active, onSwitch, tabs }) => (
<View style={[tabsStyles.root, isIpad && { marginBottom: 30 }]}>
{tabs.map((Tab, i) => (
<TouchableOpacity
key={i}
accessibilityRole="button"
onPress={() => onSwitch(i)}
style={[
tabsStyles.tabRoot,
active === i && {
borderColor: BlueCurrentTheme.colors.buttonAlternativeTextColor,
borderBottomWidth: 2,
},
]}
>
<Tab active={active === i} />
</TouchableOpacity>
))}
</View>
);
}

55
components/Tabs.tsx Normal file
View file

@ -0,0 +1,55 @@
import React from 'react';
import { StyleSheet, View, TouchableOpacity } from 'react-native';
import { useTheme } from './themes';
const tabsStyles = StyleSheet.create({
root: {
flexDirection: 'row',
height: 50,
borderColor: '#e3e3e3',
borderBottomWidth: 1,
},
tabRoot: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
borderColor: 'white',
borderBottomWidth: 2,
},
activeTabRoot: {
borderColor: 'transparent',
borderBottomWidth: 2,
},
marginBottom: {
marginBottom: 30,
},
});
interface TabProps {
active: boolean;
}
interface TabsProps {
active: number;
onSwitch: (index: number) => void;
tabs: React.ComponentType<TabProps>[];
isIpad?: boolean;
}
export const Tabs: React.FC<TabsProps> = ({ active, onSwitch, tabs, isIpad = false }) => {
const { colors } = useTheme();
return (
<View style={[tabsStyles.root, isIpad && tabsStyles.marginBottom]}>
{tabs.map((Tab, i) => (
<TouchableOpacity
key={i}
accessibilityRole="button"
onPress={() => onSwitch(i)}
style={[tabsStyles.tabRoot, active === i && { ...tabsStyles.activeTabRoot, borderColor: colors.buttonAlternativeTextColor }]}
>
<Tab active={active === i} />
</TouchableOpacity>
))}
</View>
);
};

View file

@ -8,9 +8,10 @@ import { useNavigation, useRoute } from '@react-navigation/native';
import loc from '../../loc';
import { BlueCurrentTheme, useTheme } from '../../components/themes';
import { FContainer, FButton } from '../../components/FloatButtons';
import { BlueSpacing20, BlueTabs } from '../../BlueComponents';
import { BlueSpacing20 } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import SafeArea from '../../components/SafeArea';
import { Tabs } from '../../components/Tabs';
const ENTROPY_LIMIT = 256;
@ -244,7 +245,7 @@ const Entropy = () => {
</View>
</TouchableOpacity>
<BlueTabs
<Tabs
active={tab}
onSwitch={setTab}
tabs={[