forked from Ivasoft/mattermost-mobile
Gekidou about screen (#5591)
* Added about screen * Remove TS error * Needs clean up * Testing login flow * Converted About screen to functional component * Improvements * Sort imports * Prevents double tapping * Apply suggestions from code review Co-authored-by: Elias Nahum <nahumhbl@gmail.com> * Code clean up * Adding translation keys * Added some keys * Updated AppVersion component * Missed translation key Co-authored-by: Avinash Lingaloo <> Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
This commit is contained in:
@@ -2,9 +2,10 @@
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import React from 'react';
|
||||
import {StyleSheet, View} from 'react-native';
|
||||
import {StyleSheet, TextStyle, View} from 'react-native';
|
||||
import DeviceInfo from 'react-native-device-info';
|
||||
|
||||
import {t} from '@i18n';
|
||||
import FormattedText from '@components/formatted_text';
|
||||
|
||||
const style = StyleSheet.create({
|
||||
@@ -17,19 +18,32 @@ const style = StyleSheet.create({
|
||||
},
|
||||
});
|
||||
|
||||
const AppVersion = () => {
|
||||
type AppVersionProps = {
|
||||
isWrapped?: boolean;
|
||||
textStyle?: TextStyle;
|
||||
}
|
||||
|
||||
const AppVersion = ({isWrapped = true, textStyle = {}}: AppVersionProps) => {
|
||||
const appVersion = (
|
||||
<FormattedText
|
||||
id={t('mobile.about.appVersion')}
|
||||
defaultMessage='App Version: {version} (Build {number})'
|
||||
style={StyleSheet.flatten([style.version, textStyle])}
|
||||
values={{
|
||||
version: DeviceInfo.getVersion(),
|
||||
number: DeviceInfo.getBuildNumber(),
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
if (!isWrapped) {
|
||||
return appVersion;
|
||||
}
|
||||
|
||||
return (
|
||||
<View pointerEvents='none'>
|
||||
<View style={style.info}>
|
||||
<FormattedText
|
||||
id='mobile.about.appVersion'
|
||||
defaultMessage='App Version: {version} (Build {number})'
|
||||
style={style.version}
|
||||
values={{
|
||||
version: DeviceInfo.getVersion(),
|
||||
number: DeviceInfo.getBuildNumber(),
|
||||
}}
|
||||
/>
|
||||
{appVersion}
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user