mirror of https://github.com/tooot-app/app
Show instance version
This commit is contained in:
parent
dc91f3edeb
commit
902d4e6c3a
|
@ -267,7 +267,8 @@
|
|||
"heading": "Help us improve",
|
||||
"description": "Collecting only non-user relative usage"
|
||||
},
|
||||
"version": "Version v{{version}}"
|
||||
"version": "Version v{{version}}",
|
||||
"instanceVersion": "Mastodon version v{{version}}"
|
||||
},
|
||||
"switch": {
|
||||
"existing": "Choose from logged in",
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { MenuContainer, MenuRow } from '@components/Menu'
|
||||
import { useAppDispatch } from '@root/store'
|
||||
import { getInstanceVersion } from '@utils/slices/instancesSlice'
|
||||
import {
|
||||
changeAnalytics,
|
||||
getSettingsAnalytics
|
||||
|
@ -9,7 +10,7 @@ import { useTheme } from '@utils/styles/ThemeManager'
|
|||
import Constants from 'expo-constants'
|
||||
import React from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { StyleSheet, Text } from 'react-native'
|
||||
import { Text } from 'react-native'
|
||||
import { useSelector } from 'react-redux'
|
||||
|
||||
const SettingsAnalytics: React.FC = () => {
|
||||
|
@ -18,6 +19,7 @@ const SettingsAnalytics: React.FC = () => {
|
|||
const { t } = useTranslation('screenTabs')
|
||||
|
||||
const settingsAnalytics = useSelector(getSettingsAnalytics)
|
||||
const instanceVersion = useSelector(getInstanceVersion, () => true)
|
||||
|
||||
return (
|
||||
<MenuContainer>
|
||||
|
@ -29,19 +31,27 @@ const SettingsAnalytics: React.FC = () => {
|
|||
dispatch(changeAnalytics(!settingsAnalytics))
|
||||
}
|
||||
/>
|
||||
<Text style={[styles.version, { color: colors.secondary }]}>
|
||||
<Text
|
||||
style={{
|
||||
textAlign: 'center',
|
||||
...StyleConstants.FontStyle.S,
|
||||
marginTop: StyleConstants.Spacing.S,
|
||||
color: colors.secondary
|
||||
}}
|
||||
>
|
||||
{t('me.settings.version', { version: Constants.manifest?.version })}
|
||||
</Text>
|
||||
<Text
|
||||
style={{
|
||||
textAlign: 'center',
|
||||
...StyleConstants.FontStyle.S,
|
||||
color: colors.secondary
|
||||
}}
|
||||
>
|
||||
{t('me.settings.instanceVersion', { version: instanceVersion })}
|
||||
</Text>
|
||||
</MenuContainer>
|
||||
)
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
version: {
|
||||
textAlign: 'center',
|
||||
...StyleConstants.FontStyle.S,
|
||||
marginTop: StyleConstants.Spacing.M
|
||||
}
|
||||
})
|
||||
|
||||
export default SettingsAnalytics
|
||||
|
|
Loading…
Reference in New Issue