Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2148 from LiskHQ/2147-locked-tokens-not-visible-o…
Browse files Browse the repository at this point in the history
…n-mobile

Locked tokens not visible on mobile
  • Loading branch information
ManuGowda committed Nov 27, 2023
2 parents f4d2316 + 43ad42f commit 817af81
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 10 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ android {
applicationId "io.lisk.mobile"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 83
versionCode 84
versionName "3.0.0"
missingDimensionStrategy 'react-native-camera', 'mlkit'
}
Expand Down
4 changes: 2 additions & 2 deletions ios/Lisk.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Lisk/Lisk.entitlements;
CURRENT_PROJECT_VERSION = 73;
CURRENT_PROJECT_VERSION = 74;
DEVELOPMENT_TEAM = 58UK9RE9TP;
ENABLE_BITCODE = NO;
EXCLUDED_ARCHS = arm64;
Expand Down Expand Up @@ -1402,7 +1402,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Lisk/Lisk.entitlements;
CURRENT_PROJECT_VERSION = 73;
CURRENT_PROJECT_VERSION = 74;
DEVELOPMENT_TEAM = 58UK9RE9TP;
EXCLUDED_ARCHS = arm64;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
Expand Down
14 changes: 11 additions & 3 deletions src/modules/Accounts/components/TokenList/TokenList.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable max-statements */
/* eslint-disable complexity */
import React, { useMemo, useState } from 'react';
import React, { useEffect, useMemo, useState } from 'react';
import { View } from 'react-native';
import i18next from 'i18next';
import { useNavigation } from '@react-navigation/native';
Expand All @@ -11,6 +11,7 @@ import { LabelButton } from 'components/shared/toolBox/button';
import { colors } from 'constants/styleGuide';
import CaretSvg from 'assets/svgs/CaretSvg';

import { useCurrentApplication } from 'modules/BlockchainApplication/hooks/useCurrentApplication';
import InfiniteScrollList from 'components/shared/InfiniteScrollList';
import ResultScreen from 'components/screens/ResultScreen';
import EmptyTokensIllustrationSvg from 'assets/svgs/EmptyTokensIllustrationSvg';
Expand All @@ -30,6 +31,13 @@ export default function TokenList({ mode = 'overview', address, style }) {
const [activeTab, setActiveTab] = useState(0);

const [currentAccount] = useCurrentAccount();
const [currentApplication] = useCurrentApplication();

const currentApplicationChainID = currentApplication?.data?.chainID;

useEffect(() => {
setActiveTab(0);
}, [currentApplicationChainID]);

const navigation = useNavigation();

Expand Down Expand Up @@ -63,10 +71,10 @@ export default function TokenList({ mode = 'overview', address, style }) {
});
}
if (amount) {
res.push({ symbol: token.symbol, amount });
res.push({ ...token, availableBalance: amount });
}
});
return lockedTokens;
return res;
}, [tokensData?.data]);

const { styles } = useTheme({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function TokenListTabs({
</P>
)}

{lockedTokens && (
{!!lockedTokens?.length && (
<TouchableOpacity
style={[styles.tabItem, activeTab === 1 && styles.theme.tabItemActive]}
onPress={onLockedTokensClick}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import WavesPatternSvg from 'assets/svgs/WavesPatternSvg';
import UrlSvg from 'assets/svgs/UrlSvg';
import PinSvg from 'assets/svgs/PinSvg';
import { colors } from 'constants/styleGuide';
import { fromBeddowsToLsk } from 'utilities/conversions.utils';

import { usePinApplications } from '../../hooks/usePinApplications';
import { useApplicationsExplorer } from '../../hooks/useApplicationsExplorer';
import { useApplicationsManagement } from '../../hooks/useApplicationsManagement';
Expand Down Expand Up @@ -132,11 +134,13 @@ export default function ApplicationDetails({ route }) {
</View>

<DataRenderer
data={data.deposited}
data={data.escrowedLSK}
renderData={(deposited) => (
<View style={[styles.row, styles.depositedContainer]}>
<P style={styles.deposited}>{i18next.t('application.details.deposited')}:</P>
<P style={styles.amount}>{`${deposited.toLocaleString('en-US')} LSK`}</P>
<P style={styles.amount}>{`${fromBeddowsToLsk(deposited).toLocaleString(
'en-US'
)} LSK`}</P>
</View>
)}
hideOnEmpty
Expand Down
5 changes: 4 additions & 1 deletion src/modules/SendToken/components/SummaryStep/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import getSendTokenSummaryStepStyles from './styles';
export default function SendTokenSummaryStep({ form, prevStep, transaction, reset: resetSteps }) {
const navigation = useNavigation();
const bookmarks = useSelector(selectBookmarkList);
const modal = useModal();

const senderApplicationChainID = form.watch('senderApplicationChainID');
const recipientApplicationChainID = form.watch('recipientApplicationChainID');
Expand Down Expand Up @@ -52,8 +53,10 @@ export default function SendTokenSummaryStep({ form, prevStep, transaction, rese
modal.close();
};

const handleAddAddressToBookmarkPress = () =>
const handleAddAddressToBookmarkPress = () => {
modal.close();
navigation.navigate({ name: 'AddBookmark', params: { address: recipientAccountAddress } });
};

const isRecipientAccountBookmarked = !!bookmarks.find(
(bookmark) => bookmark.address === recipientAccountAddress
Expand Down

0 comments on commit 817af81

Please sign in to comment.