mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-22 23:08:07 +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) {
|
getTransactions(limit = Infinity) {
|
||||||
let wallet = this.props.navigation.getParam('wallet');
|
let wallet = this.props.navigation.getParam('wallet');
|
||||||
|
|
||||||
let txs = wallet.getTransactions();
|
let txs = wallet.getTransactions();
|
||||||
for (let tx of txs) {
|
for (let tx of txs) {
|
||||||
tx.sort_ts = +new Date(tx.received);
|
tx.sort_ts = +new Date(tx.received);
|
||||||
|
@ -131,7 +132,7 @@ export default class WalletTransactions extends Component {
|
||||||
|
|
||||||
isLightning() {
|
isLightning() {
|
||||||
let w = this.state.wallet;
|
let w = this.state.wallet;
|
||||||
if (w && w.type === LightningCustodianWallet.type) {
|
if (w && w.chain === Chain.OFFCHAIN) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,7 +202,21 @@ export default class WalletTransactions extends Component {
|
||||||
|
|
||||||
renderListHeaderComponent = () => {
|
renderListHeaderComponent = () => {
|
||||||
return (
|
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
|
<Text
|
||||||
style={{
|
style={{
|
||||||
flex: 1,
|
flex: 1,
|
||||||
|
@ -420,24 +435,11 @@ export default class WalletTransactions extends Component {
|
||||||
}
|
}
|
||||||
onManageFundsPressed={() => this.setState({ isManageFundsModalVisible: true })}
|
onManageFundsPressed={() => this.setState({ isManageFundsModalVisible: true })}
|
||||||
/>
|
/>
|
||||||
<View style={{ backgroundColor: '#FFFFFF' }}>
|
<View style={{ backgroundColor: '#FFFFFF', 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>
|
|
||||||
<FlatList
|
<FlatList
|
||||||
|
ListHeaderComponent={this.renderListHeaderComponent}
|
||||||
onEndReachedThreshold={0.3}
|
onEndReachedThreshold={0.3}
|
||||||
onEndReached={() => {
|
onEndReached={async () => {
|
||||||
// pagination in works. in this block we will add more txs to flatlist
|
// 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
|
// 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,
|
pageSize: this.state.pageSize * 2,
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
ListHeaderComponent={this.renderListHeaderComponent}
|
|
||||||
ListFooterComponent={this.renderListFooterComponent}
|
ListFooterComponent={this.renderListFooterComponent}
|
||||||
ListEmptyComponent={
|
ListEmptyComponent={
|
||||||
<ScrollView style={{ minHeight: 100 }} contentContainerStyle={{ flex: 1, justifyContent: 'center', paddingHorizontal: 16 }}>
|
<ScrollView style={{ minHeight: 100 }} contentContainerStyle={{ flex: 1, justifyContent: 'center', paddingHorizontal: 16 }}>
|
||||||
|
@ -527,7 +528,7 @@ export default class WalletTransactions extends Component {
|
||||||
return (
|
return (
|
||||||
<BlueReceiveButtonIcon
|
<BlueReceiveButtonIcon
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
if (this.state.wallet.type === LightningCustodianWallet.type) {
|
if (this.state.wallet.chain === Chain.OFFCHAIN) {
|
||||||
navigate('LNDCreateInvoice', { fromWallet: this.state.wallet });
|
navigate('LNDCreateInvoice', { fromWallet: this.state.wallet });
|
||||||
} else {
|
} else {
|
||||||
navigate('ReceiveDetails', { secret: this.state.wallet.getSecret() });
|
navigate('ReceiveDetails', { secret: this.state.wallet.getSecret() });
|
||||||
|
@ -543,7 +544,7 @@ export default class WalletTransactions extends Component {
|
||||||
return (
|
return (
|
||||||
<BlueSendButtonIcon
|
<BlueSendButtonIcon
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
if (this.state.wallet.type === LightningCustodianWallet.type) {
|
if (this.state.wallet.chain === Chain.OFFCHAIN) {
|
||||||
navigate('ScanLndInvoice', { fromSecret: this.state.wallet.getSecret() });
|
navigate('ScanLndInvoice', { fromSecret: this.state.wallet.getSecret() });
|
||||||
} else {
|
} else {
|
||||||
navigate('SendDetails', {
|
navigate('SendDetails', {
|
||||||
|
|
Loading…
Add table
Reference in a new issue