From dccf41f0a50c4f3f9c313ce84f65997b9a7a52d9 Mon Sep 17 00:00:00 2001 From: myxmaster Date: Mon, 20 May 2024 13:12:51 +0200 Subject: [PATCH] use ArrowLeft svg for back buttons, fixed nested VirtualizedLists error --- views/POS/ProductCategoryDetails.tsx | 22 +++++++----- .../Settings/LightningAddress/NostrRelays.tsx | 35 +++++++++++-------- 2 files changed, 35 insertions(+), 22 deletions(-) diff --git a/views/POS/ProductCategoryDetails.tsx b/views/POS/ProductCategoryDetails.tsx index 400d3980d..1c60591c7 100644 --- a/views/POS/ProductCategoryDetails.tsx +++ b/views/POS/ProductCategoryDetails.tsx @@ -11,7 +11,7 @@ import ProductCategory from '../../models/ProductCategory'; import InventoryStore from '../../stores/InventoryStore'; import { inject, observer } from 'mobx-react'; import { v4 as uuidv4 } from 'uuid'; -import { Divider, Icon } from 'react-native-elements'; +import { Divider } from 'react-native-elements'; import { Route } from '@react-navigation/native'; import { StackNavigationProp } from '@react-navigation/stack'; @@ -24,9 +24,11 @@ import TextInput from '../../components/TextInput'; import { themeColor } from '../../utils/ThemeUtils'; import { localeString } from '../../utils/LocaleUtils'; -import DeleteIcon from '../../assets/images/SVG/Delete.svg'; import PosStore from '../../stores/PosStore'; +import ArrowLeft from '../../assets/images/SVG/Arrow_left.svg'; +import DeleteIcon from '../../assets/images/SVG/Delete.svg'; + interface ProductCategoryProps { navigation: StackNavigationProp; InventoryStore: InventoryStore; @@ -157,13 +159,17 @@ export default class ProductCategoryDetails extends React.Component< const { navigation } = this.props; const BackButton = () => ( - navigation.goBack()} - color={themeColor('text')} - underlayColor="transparent" - size={35} - /> + accessibilityLabel={localeString('general.goBack')} + > + + ); const Delete = () => ( diff --git a/views/Settings/LightningAddress/NostrRelays.tsx b/views/Settings/LightningAddress/NostrRelays.tsx index 762af6561..911cfc7de 100644 --- a/views/Settings/LightningAddress/NostrRelays.tsx +++ b/views/Settings/LightningAddress/NostrRelays.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; -import { FlatList, ScrollView, View } from 'react-native'; -import { Icon } from 'react-native-elements'; +import { FlatList, ScrollView, TouchableOpacity, View } from 'react-native'; import { inject, observer } from 'mobx-react'; import { schnorr } from '@noble/curves/secp256k1'; import { bytesToHex } from '@noble/hashes/utils'; @@ -24,6 +23,8 @@ import LightningAddressStore from '../../../stores/LightningAddressStore'; import { localeString } from '../../../utils/LocaleUtils'; import { themeColor } from '../../../utils/ThemeUtils'; +import ArrowLeft from '../../../assets/images/SVG/Arrow_left.svg'; + interface NostrRelaysProps { navigation: StackNavigationProp; SettingsStore: SettingsStore; @@ -91,18 +92,23 @@ export default class NostrRelays extends React.Component<
{ - navigation.navigate( - 'LightningAddress', - { relays } - ); - }} - color={themeColor('text')} - underlayColor="transparent" - size={35} - /> + + navigation.popTo('LightningAddress', { + relays + }) + } + accessibilityLabel={localeString( + 'general.goBack' + )} + > + + ) : ( 'Back' ) @@ -315,6 +321,7 @@ export default class NostrRelays extends React.Component< `${item.txid}-${index}` } onEndReachedThreshold={50} + scrollEnabled={false} /> ) : (