mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-22 23:08:07 +01:00
Merge pull request #6187 from BlueWallet/curr
FIX: Currency row height issue on some devices
This commit is contained in:
commit
d06ff14034
1 changed files with 1 additions and 10 deletions
|
@ -18,8 +18,6 @@ import loc from '../../loc';
|
||||||
import { FiatUnit, FiatUnitSource, FiatUnitType, getFiatRate } from '../../models/fiatUnit';
|
import { FiatUnit, FiatUnitSource, FiatUnitType, getFiatRate } from '../../models/fiatUnit';
|
||||||
dayjs.extend(require('dayjs/plugin/calendar'));
|
dayjs.extend(require('dayjs/plugin/calendar'));
|
||||||
|
|
||||||
const ITEM_HEIGHT = 50;
|
|
||||||
|
|
||||||
const Currency = () => {
|
const Currency = () => {
|
||||||
const { setPreferredFiatCurrency } = useContext(BlueStorageContext);
|
const { setPreferredFiatCurrency } = useContext(BlueStorageContext);
|
||||||
const [isSavingNewPreferredCurrency, setIsSavingNewPreferredCurrency] = useState(false);
|
const [isSavingNewPreferredCurrency, setIsSavingNewPreferredCurrency] = useState(false);
|
||||||
|
@ -62,17 +60,11 @@ const Currency = () => {
|
||||||
fetchCurrency();
|
fetchCurrency();
|
||||||
}, [setOptions]);
|
}, [setOptions]);
|
||||||
|
|
||||||
const getItemLayout = (_data: any, index: number) => ({
|
|
||||||
length: ITEM_HEIGHT,
|
|
||||||
offset: ITEM_HEIGHT * index,
|
|
||||||
index,
|
|
||||||
});
|
|
||||||
|
|
||||||
const renderItem = ({ item }: { item: FiatUnitType }) => (
|
const renderItem = ({ item }: { item: FiatUnitType }) => (
|
||||||
<ListItem
|
<ListItem
|
||||||
disabled={isSavingNewPreferredCurrency || selectedCurrency.endPointKey === item.endPointKey}
|
disabled={isSavingNewPreferredCurrency || selectedCurrency.endPointKey === item.endPointKey}
|
||||||
title={`${item.endPointKey} (${item.symbol})`}
|
title={`${item.endPointKey} (${item.symbol})`}
|
||||||
containerStyle={StyleSheet.flatten([styles.flex, { height: ITEM_HEIGHT }])}
|
containerStyle={StyleSheet.flatten([styles.flex, { minHeight: 60 }])}
|
||||||
checkmark={selectedCurrency.endPointKey === item.endPointKey}
|
checkmark={selectedCurrency.endPointKey === item.endPointKey}
|
||||||
onPress={async () => {
|
onPress={async () => {
|
||||||
setIsSavingNewPreferredCurrency(true);
|
setIsSavingNewPreferredCurrency(true);
|
||||||
|
@ -104,7 +96,6 @@ const Currency = () => {
|
||||||
data={data}
|
data={data}
|
||||||
initialNumToRender={30}
|
initialNumToRender={30}
|
||||||
extraData={data}
|
extraData={data}
|
||||||
getItemLayout={getItemLayout}
|
|
||||||
renderItem={renderItem}
|
renderItem={renderItem}
|
||||||
/>
|
/>
|
||||||
<BlueCard>
|
<BlueCard>
|
||||||
|
|
Loading…
Add table
Reference in a new issue