Skip to content

Commit

Permalink
feat: show app version (#1775)
Browse files Browse the repository at this point in the history
Co-authored-by: iGroza <[email protected]>
  • Loading branch information
iGroza and iGroza authored Mar 12, 2024
1 parent 7f5b4ed commit ed68579
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import {AppTheme, ModalType} from '@app/types';
import {getAppTrackingAuthorizationStatus, sleep} from '@app/utils';
import {SPLASH_TIMEOUT_MS} from '@app/variables/common';

import {AppVersionAbsoluteView} from './components/app-version-absolute-view';
import {migrationWallets} from './models/migration-wallets';

const appTheme = createTheme({
Expand Down Expand Up @@ -223,6 +224,7 @@ export const App = () => {
/>
<AppScreenSecurityOverview />
{toast}
<AppVersionAbsoluteView />
</NavigationContainer>
</MenuProvider>
</SafeAreaProvider>
Expand Down
38 changes: 38 additions & 0 deletions src/components/app-version-absolute-view.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import {memo, useMemo} from 'react';

import {View} from 'react-native';

import {Color} from '@app/colors';
import {createTheme} from '@app/helpers';
import {getAppVersion, getBuildNumber} from '@app/services/version';
import {STRINGS} from '@app/variables/common';

import {Text} from './ui';

export const AppVersionAbsoluteView = memo(() => {
const version = useMemo(
() =>
`v${STRINGS.NBSP}${getAppVersion()}${STRINGS.NBSP}(${getBuildNumber()})`,
[],
);
return (
<View style={styles.container}>
<Text clean style={styles.text}>
{version}
</Text>
</View>
);
});

const styles = createTheme({
container: {
position: 'absolute',
bottom: 2,
left: 2,
},
text: {
fontSize: 8,
lineHeight: 10,
color: Color.textBase2,
},
});

0 comments on commit ed68579

Please sign in to comment.