diff --git a/frontend/Components/MenuItems/index.tsx b/frontend/Components/MenuItems/index.tsx index 2d48c91..3f17439 100644 --- a/frontend/Components/MenuItems/index.tsx +++ b/frontend/Components/MenuItems/index.tsx @@ -20,6 +20,8 @@ import { usernamePubKey } from '../../Functions/RelayFunctions/Users' import ProfileData from '../ProfileData' import { WalletContext } from '../../Contexts/WalletContext' import { AppContext } from '../../Contexts/AppContext' +import VersionNumber from 'react-native-version-number' +import axios from 'axios' export const MenuItems: React.FC = () => { const [drawerItemIndex, setDrawerItemIndex] = React.useState(-1) @@ -44,6 +46,7 @@ export const MenuItems: React.FC = () => { const [activerelays, setActiveRelays] = React.useState(0) const [loadingConnection, setLoadingConnection] = React.useState(false) + const [newVersion, setNewVerion] = React.useState(false) React.useEffect(() => { setActiveRelays(relays.filter((relay) => relay.active).length) @@ -82,6 +85,16 @@ export const MenuItems: React.FC = () => { setLoadingConnection(false) }, [online]) + React.useEffect(() => { + axios.get('https://api.github.com/repos/KoalaSat/nostros/releases/latest') + .then((response) => { + if (response) { + const tag = response.data.tag_name + setNewVerion(online && Boolean(tag) && tag !== VersionNumber.appVersion) + } + }) + }, []) + return ( <> { onPress={() => onPressItem('faq', 5)} onTouchEnd={() => setDrawerItemIndex(-1)} /> - - await Linking.openURL('https://github.com/KoalaSat/nostros/issues/new/choose') - } - /> + {newVersion && ( + + await Linking.openURL('https://github.com/KoalaSat/nostros/releases/latest') + } + right={() => + + } + /> + )} { ), onPress: async () => await Linking.openURL('https://github.com/KoalaSat/nostros'), }, + { + key: 2, + title: t('menuItems.reportBug'), + left: ( + ( + + )} + /> + ), + onPress: async () => await Linking.openURL('https://github.com/KoalaSat/nostros/issues/new/choose'), + }, { key: 3, title: t('aboutPage.telegram'), diff --git a/frontend/Pages/HomeNavigator/index.tsx b/frontend/Pages/HomeNavigator/index.tsx index fe5f020..ff87ef5 100644 --- a/frontend/Pages/HomeNavigator/index.tsx +++ b/frontend/Pages/HomeNavigator/index.tsx @@ -22,6 +22,7 @@ export const HomeNavigator: React.FC = () => { const bottomSheetRelaysRef = React.useRef(null) const bottomSheetLoginRef = React.useRef(null) const Stack = React.useMemo(() => createStackNavigator(), []) + const cardStyleInterpolator = React.useMemo( () => Platform.OS === 'android'