Skip to content

Commit

Permalink
feat: display version number (#97)
Browse files Browse the repository at this point in the history
* feat: display version number
* feat: display version on settings screen

---------

Signed-off-by: Iuri Pereira <689440+iuricmp@users.noreply.github.com>
  • Loading branch information
iuricmp authored Jun 17, 2024
1 parent 3142d5f commit 1ce7cc1
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 29 deletions.
8 changes: 6 additions & 2 deletions mobile/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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]"
Expand Down
3 changes: 2 additions & 1 deletion mobile/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
28 changes: 20 additions & 8 deletions mobile/app/index.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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();
Expand All @@ -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 {
Expand Down Expand Up @@ -83,21 +86,30 @@ export default function Root() {
<>
<Layout.Container>
<Layout.BodyAlignedBotton>
<ScrollView>
<View style={{ alignItems: "center" }}>
<Text.Title>dSocial</Text.Title>
<Text.Body>Decentralized Social Network</Text.Body>
<Text.Body>Powered by GnoNative</Text.Body>
<Text.Caption1>v{appVersion}</Text.Caption1>
</View>

<ScrollView style={{ marginTop: 24 }}>
{accounts && accounts.length > 0 && (
<>
<Text.Body>Please, select one of the existing accounts to start:</Text.Body>
<Text.Caption1>Please, select one of the existing accounts to start:</Text.Caption1>
<SideMenuAccountList accounts={accounts} changeAccount={onChangeAccountHandler} />
<SideMenuAccountList accounts={accounts} changeAccount={onChangeAccountHandler} />
<SideMenuAccountList accounts={accounts} changeAccount={onChangeAccountHandler} />
<SideMenuAccountList accounts={accounts} changeAccount={onChangeAccountHandler} />
<Spacer />
<Ruller />
<Spacer />
<Text.Body>Or use one of these options:</Text.Body>
</>
)}

<Spacer />
<Button.Link title="Sign up" href="sign-up" />
</ScrollView>
<Ruller />
<Spacer />
<Text.Caption1>Or create a new account:</Text.Caption1>
<Button.Link title="Sign up" href="sign-up" />
</Layout.BodyAlignedBotton>
</Layout.Container>
{reenterPassword ? (
Expand Down
3 changes: 3 additions & 0 deletions mobile/components/settings/account/account-balance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -47,6 +48,8 @@ export function AccountBalance({ activeAccount }: Props) {

return (
<>
<Text.Subheadline>Version:</Text.Subheadline>
<Text.Body>{Application.nativeApplicationVersion}</Text.Body>
<Text.Subheadline>Active Account:</Text.Subheadline>
<Text.Body>{activeAccount.name}</Text.Body>
<Text.Subheadline>Address:</Text.Subheadline>
Expand Down
47 changes: 31 additions & 16 deletions mobile/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 1ce7cc1

Please sign in to comment.