mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-22 15:04:50 +01:00
FIX: TX list uses whole canvas area
This commit is contained in:
parent
ea23dc1063
commit
bbe01d16a3
1 changed files with 22 additions and 21 deletions
|
@ -107,6 +107,7 @@ export default class WalletTransactions extends Component {
|
|||
*/
|
||||
getTransactions(limit = Infinity) {
|
||||
let wallet = this.props.navigation.getParam('wallet');
|
||||
|
||||
let txs = wallet.getTransactions();
|
||||
for (let tx of txs) {
|
||||
tx.sort_ts = +new Date(tx.received);
|
||||
|
@ -131,7 +132,7 @@ export default class WalletTransactions extends Component {
|
|||
|
||||
isLightning() {
|
||||
let w = this.state.wallet;
|
||||
if (w && w.type === LightningCustodianWallet.type) {
|
||||
if (w && w.chain === Chain.OFFCHAIN) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -201,7 +202,21 @@ export default class WalletTransactions extends Component {
|
|||
|
||||
renderListHeaderComponent = () => {
|
||||
return (
|
||||
<View style={{ flex: 1, flexDirection: 'row' }}>
|
||||
<View style={{ flex: 1 }}>
|
||||
<View style={{ flexDirection: 'row', margin: 16, justifyContent: 'space-evenly' }}>
|
||||
{/*
|
||||
So the idea here, due to Apple banning native Lapp marketplace, is:
|
||||
On Android everythins works as it worked before. Single "Marketplace" button that leads to LappBrowser that
|
||||
opens /marketplace/ url of offchain wallet type, and /marketplace-btc/ for onchain.
|
||||
On iOS its more complicated - we have one button that opens same page _externally_ (in Safari), and second
|
||||
button that opens actual LappBrowser but with _blank_ page. This is important to not trigger Apple.
|
||||
Blank page is also the way Trust Wallet does it with Dapp Browser.
|
||||
|
||||
For ONCHAIN wallet type no LappBrowser button should be displayed, its Lightning-network specific.
|
||||
*/}
|
||||
{this.renderMarketplaceButton()}
|
||||
{this.state.wallet.type === LightningCustodianWallet.type && Platform.OS === 'ios' && this.renderLappBrowserButton()}
|
||||
</View>
|
||||
<Text
|
||||
style={{
|
||||
flex: 1,
|
||||
|
@ -420,24 +435,11 @@ export default class WalletTransactions extends Component {
|
|||
}
|
||||
onManageFundsPressed={() => this.setState({ isManageFundsModalVisible: true })}
|
||||
/>
|
||||
<View style={{ backgroundColor: '#FFFFFF' }}>
|
||||
<View style={{ flexDirection: 'row', margin: 16, justifyContent: 'space-evenly' }}>
|
||||
{/*
|
||||
So the idea here, due to Apple banning native Lapp marketplace, is:
|
||||
On Android everythins works as it worked before. Single "Marketplace" button that leads to LappBrowser that
|
||||
opens /marketplace/ url of offchain wallet type, and /marketplace-btc/ for onchain.
|
||||
On iOS its more complicated - we have one button that opens same page _externally_ (in Safari), and second
|
||||
button that opens actual LappBrowser but with _blank_ page. This is important to not trigger Apple.
|
||||
Blank page is also the way Trust Wallet does it with Dapp Browser.
|
||||
|
||||
For ONCHAIN wallet type no LappBrowser button should be displayed, its Lightning-network specific.
|
||||
*/}
|
||||
{this.renderMarketplaceButton()}
|
||||
{this.state.wallet.type === LightningCustodianWallet.type && Platform.OS === 'ios' && this.renderLappBrowserButton()}
|
||||
</View>
|
||||
<View style={{ backgroundColor: '#FFFFFF', flex: 1 }}>
|
||||
<FlatList
|
||||
ListHeaderComponent={this.renderListHeaderComponent}
|
||||
onEndReachedThreshold={0.3}
|
||||
onEndReached={() => {
|
||||
onEndReached={async () => {
|
||||
// pagination in works. in this block we will add more txs to flatlist
|
||||
// so as user scrolls closer to bottom it will render mode transactions
|
||||
|
||||
|
@ -452,7 +454,6 @@ export default class WalletTransactions extends Component {
|
|||
pageSize: this.state.pageSize * 2,
|
||||
});
|
||||
}}
|
||||
ListHeaderComponent={this.renderListHeaderComponent}
|
||||
ListFooterComponent={this.renderListFooterComponent}
|
||||
ListEmptyComponent={
|
||||
<ScrollView style={{ minHeight: 100 }} contentContainerStyle={{ flex: 1, justifyContent: 'center', paddingHorizontal: 16 }}>
|
||||
|
@ -527,7 +528,7 @@ export default class WalletTransactions extends Component {
|
|||
return (
|
||||
<BlueReceiveButtonIcon
|
||||
onPress={() => {
|
||||
if (this.state.wallet.type === LightningCustodianWallet.type) {
|
||||
if (this.state.wallet.chain === Chain.OFFCHAIN) {
|
||||
navigate('LNDCreateInvoice', { fromWallet: this.state.wallet });
|
||||
} else {
|
||||
navigate('ReceiveDetails', { secret: this.state.wallet.getSecret() });
|
||||
|
@ -543,7 +544,7 @@ export default class WalletTransactions extends Component {
|
|||
return (
|
||||
<BlueSendButtonIcon
|
||||
onPress={() => {
|
||||
if (this.state.wallet.type === LightningCustodianWallet.type) {
|
||||
if (this.state.wallet.chain === Chain.OFFCHAIN) {
|
||||
navigate('ScanLndInvoice', { fromSecret: this.state.wallet.getSecret() });
|
||||
} else {
|
||||
navigate('SendDetails', {
|
||||
|
|
Loading…
Add table
Reference in a new issue