Skip to content

Commit

Permalink
chore: use version from package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
tanlethanh committed Jun 11, 2024
1 parent c5d8511 commit 9052751
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 13 deletions.
2 changes: 1 addition & 1 deletion apps/wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@walless/wallet",
"version": "1.1.10",
"version": "1.1.11",
"private": true,
"scripts": {
"dev": "metacraft",
Expand Down
24 changes: 18 additions & 6 deletions apps/wallet/src/screens/Authentication/Invitation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -26,6 +26,7 @@ import InvitationHeader from './InvitationHeader';
export const InvitationScreen: FC = () => {
const [error, setError] = useState<string>();
const [input, setInput] = useState<string>('');
const { config } = useSnapshot(appState);

const logoSize = 120;
const minLength = 3;
Expand Down Expand Up @@ -114,11 +115,16 @@ export const InvitationScreen: FC = () => {
<HadWalletAccount onLoginPress={handleLoginPress} />
</KeyboardAvoidingView>

<Anchor
titleStyle={styles.getInvitationText}
title="Get invitation code"
href="https://twitter.com/walless_wallet/status/1694255782651658737"
/>
<View>
<Anchor
titleStyle={styles.getInvitationText}
title="Get invitation code"
href="https://twitter.com/walless_wallet/status/1694255782651658737"
/>
<Text style={styles.poweredText}>
Powered by walless.io, version@{config.version}
</Text>
</View>
</View>
</TouchableWithoutFeedback>
);
Expand Down Expand Up @@ -173,4 +179,10 @@ const styles = StyleSheet.create({
fontWeight: '400',
textAlign: 'center',
},
poweredText: {
fontSize: 12,
color: '#5D6A73',
marginTop: 6,
textAlign: 'center',
},
});
2 changes: 1 addition & 1 deletion apps/wallet/src/screens/Authentication/Login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const LoginScreen: FC = () => {
<Anchor href="https://walless.io/faq/login" title="Help page" />
</View>
<Text style={styles.poweredText}>
Powered by walless.io, version@{config?.version}
Powered by walless.io, version@{config.version}
</Text>
</View>
</View>
Expand Down
8 changes: 4 additions & 4 deletions apps/wallet/src/state/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -31,9 +32,8 @@ export interface AppState {
}

export const appState = proxy<AppState>({
version: '1.0.0',
config: { ...defaultConfig, version: packageJSON.version },
profile: {},
config: defaultConfig,
remoteConfig: defaultRemoteConfig,
networkClusters: defaultNetworkClusters,
navigationDisplay: {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/utils/entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface Setting {
export type NetworkClusterMap = Record<Networks, NetworkCluster>;

export interface Config {
version?: string;
version: string;
hideBalance: boolean;
latestLocation: string;
notificationToken?: string;
Expand Down

0 comments on commit 9052751

Please sign in to comment.