From 90527517e418846bc5373380a0077b772e16db00 Mon Sep 17 00:00:00 2001 From: Tan Le Date: Tue, 11 Jun 2024 14:57:01 +0700 Subject: [PATCH] chore: use version from package.json --- apps/wallet/package.json | 2 +- .../Authentication/Invitation/index.tsx | 24 ++++++++++++++----- .../screens/Authentication/Login/index.tsx | 2 +- apps/wallet/src/state/app.ts | 8 +++---- packages/core/utils/entity.ts | 2 +- 5 files changed, 25 insertions(+), 13 deletions(-) diff --git a/apps/wallet/package.json b/apps/wallet/package.json index 7818cc4af..8570a9331 100644 --- a/apps/wallet/package.json +++ b/apps/wallet/package.json @@ -1,6 +1,6 @@ { "name": "@walless/wallet", - "version": "1.1.10", + "version": "1.1.11", "private": true, "scripts": { "dev": "metacraft", diff --git a/apps/wallet/src/screens/Authentication/Invitation/index.tsx b/apps/wallet/src/screens/Authentication/Invitation/index.tsx index 0a6e94b0d..add12a190 100644 --- a/apps/wallet/src/screens/Authentication/Invitation/index.tsx +++ b/apps/wallet/src/screens/Authentication/Invitation/index.tsx @@ -16,7 +16,7 @@ import { showError } from 'modals/Error'; import { appState } from 'state/app'; import assets from 'utils/assets'; import { validateInvitationCode } from 'utils/auth'; -import { useSafeAreaInsets } from 'utils/hooks'; +import { useSafeAreaInsets, useSnapshot } from 'utils/hooks'; import { navigate } from 'utils/navigation'; import { hideNativeKeyboard } from 'utils/system'; @@ -26,6 +26,7 @@ import InvitationHeader from './InvitationHeader'; export const InvitationScreen: FC = () => { const [error, setError] = useState(); const [input, setInput] = useState(''); + const { config } = useSnapshot(appState); const logoSize = 120; const minLength = 3; @@ -114,11 +115,16 @@ export const InvitationScreen: FC = () => { - + + + + Powered by walless.io, version@{config.version} + + ); @@ -173,4 +179,10 @@ const styles = StyleSheet.create({ fontWeight: '400', textAlign: 'center', }, + poweredText: { + fontSize: 12, + color: '#5D6A73', + marginTop: 6, + textAlign: 'center', + }, }); diff --git a/apps/wallet/src/screens/Authentication/Login/index.tsx b/apps/wallet/src/screens/Authentication/Login/index.tsx index d781aab16..9408ea1f6 100644 --- a/apps/wallet/src/screens/Authentication/Login/index.tsx +++ b/apps/wallet/src/screens/Authentication/Login/index.tsx @@ -37,7 +37,7 @@ export const LoginScreen: FC = () => { - Powered by walless.io, version@{config?.version} + Powered by walless.io, version@{config.version} diff --git a/apps/wallet/src/state/app.ts b/apps/wallet/src/state/app.ts index b02096e78..11f088909 100644 --- a/apps/wallet/src/state/app.ts +++ b/apps/wallet/src/state/app.ts @@ -10,13 +10,14 @@ import { defaultNetworkClusters } from 'engine/utils'; import { defaultConfig, defaultRemoteConfig } from 'utils/constants'; import { proxy, subscribe } from 'valtio'; +import packageJSON from '../../package.json'; + import { bootstrap, initAfterSignIn, launchApp } from './bootstrap'; export interface AppState { - version: string; + config: Config; invitationCode?: string; profile: UserProfile; - config: Config; remoteConfig: RemoteConfig; networkClusters: NetworkClusterMap; jwtAuth?: string; @@ -31,9 +32,8 @@ export interface AppState { } export const appState = proxy({ - version: '1.0.0', + config: { ...defaultConfig, version: packageJSON.version }, profile: {}, - config: defaultConfig, remoteConfig: defaultRemoteConfig, networkClusters: defaultNetworkClusters, navigationDisplay: { diff --git a/packages/core/utils/entity.ts b/packages/core/utils/entity.ts index fda4042f0..0098808c6 100644 --- a/packages/core/utils/entity.ts +++ b/packages/core/utils/entity.ts @@ -24,7 +24,7 @@ export interface Setting { export type NetworkClusterMap = Record; export interface Config { - version?: string; + version: string; hideBalance: boolean; latestLocation: string; notificationToken?: string;