From 1ce7cc1fddf103defab44fcdf4bcfefede357b79 Mon Sep 17 00:00:00 2001 From: Iuri <689440+iuricmp@users.noreply.github.com> Date: Mon, 17 Jun 2024 15:50:30 +0100 Subject: [PATCH] feat: display version number (#97) * feat: display version number * feat: display version on settings screen --------- Signed-off-by: Iuri Pereira <689440+iuricmp@users.noreply.github.com> --- mobile/Makefile | 8 +++- mobile/app.json | 3 +- mobile/app/index.tsx | 28 +++++++---- .../settings/account/account-balance.tsx | 3 ++ mobile/package-lock.json | 47 ++++++++++++------- mobile/package.json | 6 ++- 6 files changed, 66 insertions(+), 29 deletions(-) diff --git a/mobile/Makefile b/mobile/Makefile index 3ae6560e..fc6a6824 100644 --- a/mobile/Makefile +++ b/mobile/Makefile @@ -73,10 +73,14 @@ clean_install: clean node_modules cd ios && pod install .PHONY: clean_install -release: node_modules +release.ios: node_modules npm run build eas build --platform ios --profile production -.PHONY: release +.PHONY: release.ios + +release.android: node_modules + eas build --platform android --profile production +.PHONY: elease.android help: @echo "Usage: make [target]" diff --git a/mobile/app.json b/mobile/app.json index 2f90ed5c..34afc6ff 100644 --- a/mobile/app.json +++ b/mobile/app.json @@ -34,7 +34,8 @@ "foregroundImage": "./assets/images/adaptive-icon.png", "backgroundColor": "#ffffff" }, - "package": "tech.berty.dsocial.android" + "package": "tech.berty.dsocial.android", + "versionCode": 7 }, "web": { "favicon": "./assets/images/favicon.png" diff --git a/mobile/app/index.tsx b/mobile/app/index.tsx index bb37f4a1..8cb0a5c3 100644 --- a/mobile/app/index.tsx +++ b/mobile/app/index.tsx @@ -1,5 +1,5 @@ import { useEffect, useState } from "react"; -import { ScrollView } from "react-native"; +import { ScrollView, View } from "react-native"; import { useNavigation, useRouter } from "expo-router"; import Button from "@gno/components/button"; import Layout from "@gno/components/layout"; @@ -11,6 +11,7 @@ import { loggedIn, useAppDispatch } from "@gno/redux"; import { KeyInfo } from "@buf/gnolang_gnonative.bufbuild_es/gnonativetypes_pb"; import { useGnoNativeContext } from "@gnolang/gnonative"; import Spacer from "@gno/components/spacer"; +import * as Application from "expo-application"; export default function Root() { const route = useRouter(); @@ -23,6 +24,8 @@ export default function Root() { const navigation = useNavigation(); const dispatch = useAppDispatch(); + const appVersion = Application.nativeApplicationVersion; + useEffect(() => { const unsubscribe = navigation.addListener("focus", async () => { try { @@ -83,21 +86,30 @@ export default function Root() { <> - + + dSocial + Decentralized Social Network + Powered by GnoNative + v{appVersion} + + + {accounts && accounts.length > 0 && ( <> - Please, select one of the existing accounts to start: + Please, select one of the existing accounts to start: + + + - - - Or use one of these options: )} - - + + + Or create a new account: + {reenterPassword ? ( diff --git a/mobile/components/settings/account/account-balance.tsx b/mobile/components/settings/account/account-balance.tsx index f8fa69e1..e2d698ea 100644 --- a/mobile/components/settings/account/account-balance.tsx +++ b/mobile/components/settings/account/account-balance.tsx @@ -3,6 +3,7 @@ import { KeyInfo } from "@buf/gnolang_gnonative.bufbuild_es/gnonativetypes_pb"; import Text from "@gno/components/text"; import { useGnoNativeContext } from "@gnolang/gnonative"; import { useSearch } from "@gno/hooks/use-search"; +import * as Application from "expo-application"; interface Props { activeAccount: KeyInfo | undefined; @@ -47,6 +48,8 @@ export function AccountBalance({ activeAccount }: Props) { return ( <> + Version: + {Application.nativeApplicationVersion} Active Account: {activeAccount.name} Address: diff --git a/mobile/package-lock.json b/mobile/package-lock.json index eaf3f8bf..0f519dc6 100644 --- a/mobile/package-lock.json +++ b/mobile/package-lock.json @@ -19,8 +19,10 @@ "base-64": "^1.0.0", "date-fns": "^3.6.0", "expo": "~51.0.8", + "expo-application": "~5.9.1", "expo-clipboard": "~6.0.3", - "expo-constants": "~16.0.1", + "expo-constants": "~16.0.2", + "expo-linear-gradient": "~13.0.2", "expo-linking": "~6.3.1", "expo-router": "~3.5.14", "expo-splash-screen": "~0.27.4", @@ -5496,12 +5498,11 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "license": "MIT", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -7036,6 +7037,14 @@ "expo": "bin/cli" } }, + "node_modules/expo-application": { + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/expo-application/-/expo-application-5.9.1.tgz", + "integrity": "sha512-uAfLBNZNahnDZLRU41ZFmNSKtetHUT9Ua557/q189ua0AWV7pQjoVAx49E4953feuvqc9swtU3ScZ/hN1XO/FQ==", + "peerDependencies": { + "expo": "*" + } + }, "node_modules/expo-asset": { "version": "10.0.6", "resolved": "https://registry.npmjs.org/expo-asset/-/expo-asset-10.0.6.tgz", @@ -7059,11 +7068,12 @@ } }, "node_modules/expo-constants": { - "version": "16.0.1", - "resolved": "https://registry.npmjs.org/expo-constants/-/expo-constants-16.0.1.tgz", - "integrity": "sha512-s6aTHtglp926EsugWtxN7KnpSsE9FCEjb7CgEjQQ78Gpu4btj4wB+IXot2tlqNwqv+x7xFe5veoPGfJDGF/kVg==", + "version": "16.0.2", + "resolved": "https://registry.npmjs.org/expo-constants/-/expo-constants-16.0.2.tgz", + "integrity": "sha512-9tNY3OVO0jfiMzl7ngb6IOyR5VFzNoN5OOazUWoeGfmMqVB5kltTemRvKraK9JRbBKIw+SOYLEmF0sEqgFZ6OQ==", "dependencies": { - "@expo/config": "~9.0.0-beta.0" + "@expo/config": "~9.0.0", + "@expo/env": "~0.3.0" }, "peerDependencies": { "expo": "*" @@ -7096,6 +7106,14 @@ "expo": "*" } }, + "node_modules/expo-linear-gradient": { + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/expo-linear-gradient/-/expo-linear-gradient-13.0.2.tgz", + "integrity": "sha512-EDcILUjRKu4P1rtWcwciN6CSyGtH7Bq4ll3oTRV7h3h8oSzSilH1g6z7kTAMlacPBKvMnkkWOGzW6KtgMKEiTg==", + "peerDependencies": { + "expo": "*" + } + }, "node_modules/expo-linking": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/expo-linking/-/expo-linking-6.3.1.tgz", @@ -7297,10 +7315,9 @@ "integrity": "sha512-e6eB7zN6UBSwGVwrbWVH+gdLnkW9WwHhmq2YDK1Sh30pzx1onRVGBvogTlUeWxwTa+L86NYdo4hFkh7O8ZjSnA==" }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "license": "MIT", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -8353,7 +8370,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -12680,7 +12696,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, diff --git a/mobile/package.json b/mobile/package.json index 423308a9..c5b1791a 100644 --- a/mobile/package.json +++ b/mobile/package.json @@ -23,7 +23,7 @@ "date-fns": "^3.6.0", "expo": "~51.0.8", "expo-clipboard": "~6.0.3", - "expo-constants": "~16.0.1", + "expo-constants": "~16.0.2", "expo-linking": "~6.3.1", "expo-router": "~3.5.14", "expo-splash-screen": "~0.27.4", @@ -44,7 +44,9 @@ "react-redux": "^9.1.0", "styled-components": "^6.1.8", "text-encoding": "^0.7.0", - "web-streams-polyfill": "^3.3.2" + "web-streams-polyfill": "^3.3.2", + "expo-application": "~5.9.1", + "expo-linear-gradient": "~13.0.2" }, "devDependencies": { "@babel/core": "^7.20.0",