Skip to content

Commit

Permalink
fix(mobile): add signer_about_url to config (#858)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorokin0andrey authored May 15, 2024
1 parent 1bc16b0 commit 028a71e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
8 changes: 6 additions & 2 deletions packages/mobile/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export type AppConfigVars = {
tonapiTestnetHost: string;
tronapiHost: string;
tronapiTestnetHost: string;
signerStoreUrl: string;

batteryHost: string;
batteryTestnetHost: string;
Expand All @@ -70,6 +69,9 @@ export type AppConfigVars = {
exclude_jetton_chart_periods: boolean;
devmode_enabled: boolean;

signer_store_url: string;
signer_about_url: string;

tonkeeper_pro_url: string;
notcoin_jetton_master: string;
notcoin_nft_collection: string;
Expand Down Expand Up @@ -99,7 +101,6 @@ const defaultConfig: Partial<AppConfigVars> = {
holdersService: 'https://card-dev.whales-api.com',
tronapiHost: 'https://tron.tonkeeper.com',
tronapiTestnetHost: 'https://testnet-tron.tonkeeper.com',
signerStoreUrl: 'https://play.google.com/store/apps/details?id=com.tonapps.signer',

batteryHost: 'https://battery.tonkeeper.com',
batteryTestnetHost: 'https://testnet-battery.tonkeeper.com',
Expand All @@ -122,6 +123,9 @@ const defaultConfig: Partial<AppConfigVars> = {
exclude_jetton_chart_periods: true,
devmode_enabled: false,

signer_store_url: 'https://play.google.com/store/apps/details?id=com.tonapps.signer',
signer_about_url: 'https://tonkeeper.com',

tonkeeper_pro_url: 'https://tonkeeper.com/pro',
notcoin_jetton_master:
'0:2f956143c461769579baef2e32cc2d7bc18283f40d20bb03e432cd603ac33ffc',
Expand Down
14 changes: 11 additions & 3 deletions packages/mobile/src/screens/PairSignerScreen/PairSignerScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { check, PERMISSIONS, RESULTS, request } from 'react-native-permissions';
import { DarkTheme } from '@tonkeeper/uikit/src/styles/themes/dark';
import * as S from '../../core/ScanQR/ScanQR.style';
import { config } from '$config';
import { useNestedAutoScroll } from '$uikit/DraggableFlashList/hooks/useNestedAutoScroll';
import { DeeplinkOrigin, useDeeplinking } from '$libs/deeplinking';
import { delay } from '@tonkeeper/core';
import { useIsFocused } from '@react-navigation/native';
Expand Down Expand Up @@ -66,11 +65,15 @@ export const PairSignerScreen: FC = () => {
setFlashlightOn(!isFlashlightOn);
}, [isFlashlightOn]);

const openAbout = useCallback(() => {
Linking.openURL(config.get('signer_about_url')).catch(null);
}, []);

const openSigner = useCallback(async () => {
try {
await Linking.openURL(SIGNER_SCHEME);
} catch {
Linking.openURL(config.get('signerStoreUrl')).catch(useNestedAutoScroll);
Linking.openURL(config.get('signer_store_url')).catch(null);
}
}, []);

Expand Down Expand Up @@ -201,7 +204,12 @@ export const PairSignerScreen: FC = () => {
<Screen.Header
rightContent={
<View style={styles.headerButtonContainer}>
<Button size="header" color="secondary" title={t('pairSigner.about')} />
<Button
size="header"
color="secondary"
title={t('pairSigner.about')}
onPress={openAbout}
/>
</View>
}
trasnparent
Expand Down

0 comments on commit 028a71e

Please sign in to comment.