Skip to content

Commit

Permalink
Merge pull request #1705 from kaloudis/refactor-sync-layout
Browse files Browse the repository at this point in the history
Sync: refactor layout
  • Loading branch information
kaloudis authored Oct 3, 2023
2 parents 87d03ef + 9030928 commit 667d634
Showing 1 changed file with 33 additions and 24 deletions.
57 changes: 33 additions & 24 deletions views/Sync.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { View } from 'react-native';
import { inject, observer } from 'mobx-react';
import CircularProgress from 'react-native-circular-progress-indicator';

import Button from '../components/Button';
import KeyValue from '../components/KeyValue';
import Screen from '../components/Screen';
import Header from '../components/Header';
Expand Down Expand Up @@ -38,8 +39,8 @@ export default class Sync extends React.PureComponent<SyncProps, {}> {
}}
navigation={navigation}
/>
<View style={{ margin: 10, flex: 1, marginTop: '35%' }}>
<View style={{ alignSelf: 'center', marginBottom: 40 }}>
<View style={{ flex: 1, justifyContent: 'center' }}>
<View style={{ alignItems: 'center', marginBottom: 40 }}>
<CircularProgress
value={
currentBlockHeight && bestBlockHeight
Expand Down Expand Up @@ -78,28 +79,36 @@ export default class Sync extends React.PureComponent<SyncProps, {}> {
/>
</View>

{currentBlockHeight && (
<KeyValue
keyValue={localeString(
'views.Sync.currentBlockHeight'
)}
value={currentBlockHeight}
/>
)}
{bestBlockHeight && (
<KeyValue
keyValue={localeString('views.Sync.tip')}
value={bestBlockHeight}
/>
)}
{!!numBlocksUntilSynced && (
<KeyValue
keyValue={localeString(
'views.Sync.numBlocksUntilSynced'
)}
value={numBlocksUntilSynced}
/>
)}
<View style={{ marginLeft: 20, marginRight: 20 }}>
{currentBlockHeight && (
<KeyValue
keyValue={localeString(
'views.Sync.currentBlockHeight'
)}
value={currentBlockHeight}
/>
)}
{bestBlockHeight && (
<KeyValue
keyValue={localeString('views.Sync.tip')}
value={bestBlockHeight}
/>
)}
{!!numBlocksUntilSynced && (
<KeyValue
keyValue={localeString(
'views.Sync.numBlocksUntilSynced'
)}
value={numBlocksUntilSynced}
/>
)}
</View>
</View>
<View style={{ bottom: 15 }}>
<Button
title={localeString('general.goBack')}
onPress={() => navigation.goBack()}
/>
</View>
</Screen>
);
Expand Down

0 comments on commit 667d634

Please sign in to comment.