Skip to content

Commit

Permalink
[issue-935] Upgrade UI - Update sorting modal & remove console log
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenduythuc committed Aug 16, 2023
1 parent b03d663 commit 415b187
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 20 deletions.
5 changes: 3 additions & 2 deletions src/components/Modal/common/PoolSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import useGetNominatorInfo from 'hooks/screen/Staking/useGetNominatorInfo';
import { PREDEFINED_STAKING_POOL } from '@subwallet/extension-base/constants';
import { PoolSelectorField } from 'components/Field/PoolSelector';
import { PoolSelectorDetailModal } from 'components/Modal/common/PoolSelectorDetailModal';
import { ArrowCounterClockwise, MagnifyingGlass, SortAscending, SortDescending } from 'phosphor-react-native';
import { ArrowsClockwise, MagnifyingGlass, SortAscending, SortDescending } from 'phosphor-react-native';
import { BasicSelectModal } from 'components/common/SelectModal/BasicSelectModal';
import { ModalRef } from 'types/modalRef';
import { useSubWalletTheme } from 'hooks/useSubWalletTheme';
Expand Down Expand Up @@ -249,7 +249,8 @@ export const PoolSelector = ({ chain, onSelectItem, from, poolLoading, selectedP
renderCustomItem={renderSortingItem}>
{
<Button
icon={<Icon phosphorIcon={ArrowCounterClockwise} size={'md'} />}
style={{ marginTop: 16 }}
icon={<Icon phosphorIcon={ArrowsClockwise} size={'md'} />}
onPress={() => {
setSortSelection(SortKey.DEFAULT);
sortingModalRef?.current?.onCloseModal();
Expand Down
10 changes: 2 additions & 8 deletions src/components/Modal/common/ValidatorSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@ import useGetNominatorInfo from 'hooks/screen/Staking/useGetNominatorInfo';
import { useSelectValidators } from 'hooks/screen/Transaction/useSelectValidators';
import useGetChainStakingMetadata from 'hooks/screen/Staking/useGetChainStakingMetadata';
import { _STAKING_CHAIN_GROUP } from '@subwallet/extension-base/services/chain-service/constants';
import {
ArrowCounterClockwise,
CheckCircle,
MagnifyingGlass,
SortAscending,
SortDescending,
} from 'phosphor-react-native';
import { ArrowsClockwise, CheckCircle, MagnifyingGlass, SortAscending, SortDescending } from 'phosphor-react-native';
import { useSubWalletTheme } from 'hooks/useSubWalletTheme';
import { ValidatorSelectorField } from 'components/Field/ValidatorSelector';
import { ValidatorSelectorDetailModal } from 'components/Modal/common/ValidatorSelectorDetailModal';
Expand Down Expand Up @@ -272,7 +266,7 @@ export const ValidatorSelector = ({
{
<Button
style={{ marginTop: 16 }}
icon={<Icon phosphorIcon={ArrowCounterClockwise} size={'md'} />}
icon={<Icon phosphorIcon={ArrowsClockwise} size={'md'} />}
onPress={() => {
setSortSelection(SortKey.DEFAULT);
sortingModalRef?.current?.onCloseModal();
Expand Down
1 change: 0 additions & 1 deletion src/hooks/modal/useConfirmModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ const useConfirmModal = (onComplete: VoidFunction): Result => {
}, [onComplete]);

const onCancelModal = useCallback(() => {
console.log('8000');
rejectRef.current?.(new Error('User cancel request'));
promiseRef.current = undefined;
}, []);
Expand Down
1 change: 0 additions & 1 deletion src/hooks/qr/usePayloadScanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ const usePayloadScanner = (showAlertMessage: (message: string) => void): Process
const unsignedData = checkMultiFramesData(parsedData);

if (unsignedData === null) {
console.log('Unsigned data is null');

return showAlertMessage('');
}
Expand Down
1 change: 0 additions & 1 deletion src/screens/Home/Crypto/BuyToken.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export const BuyToken = ({
} = useBuyToken(tokenGroupSlug, groupSymbol);

const selectedAccount = useGetAccountByAddress(selectedBuyAccount);
console.log('selectedBuyToken', selectedBuyToken);
const symbol = useMemo(() => {
return selectedBuyToken ? PREDEFINED_TRANSAK_TOKEN_BY_SLUG[selectedBuyToken].symbol : '';
}, [selectedBuyToken]);
Expand Down
2 changes: 0 additions & 2 deletions src/screens/Home/Staking/Balance/StakingBalanceList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ const StakingBalanceList = () => {
{ label: i18n.filterOptions.pooled, value: FilterValue.POOLED },
];
const stakingList = useMemo(() => {
console.log(data);
if (!data.length) {
return [];
}
Expand All @@ -100,7 +99,6 @@ const StakingBalanceList = () => {
const secondValue =
// @ts-ignore
new BigNumber(secondItem.staking.balance).dividedBy(BN_TEN.pow(secondItem.decimals)).toFixed() * secondPrice;
console.log(firstValue, secondValue);
return secondValue - firstValue;
});
return result;
Expand Down
1 change: 0 additions & 1 deletion src/screens/Transaction/Stake/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ export const Stake = ({
value: currentValue,
} = formState.data;

console.log('asset', asset);
const chainState = useFetchChainState(chain);
const chainStakingMetadata = useGetChainStakingMetadata(chain);
const nominatorMetadataList = useGetNominatorInfo(chain, currentStakingType as StakingType, from);
Expand Down
6 changes: 3 additions & 3 deletions src/utils/permission/camera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ export const requestCameraPermission = async (onPressCancel?: () => void) => {

switch (result) {
case RESULTS.UNAVAILABLE:
console.log('Images: This feature is not available (on this device / in this context)');
// Images: This feature is not available (on this device / in this context)
break;
case RESULTS.DENIED:
request(getCameraPermission()).then(() => onPressCancel && onPressCancel());
console.log('Images: The permission has not been requested / is denied but requestable');
// Images: The permission has not been requested / is denied but requestable
break;
case RESULTS.GRANTED:
console.log('Images: The permission is granted');
// Images: The permission is granted
return result;
case RESULTS.BLOCKED:
Alert.alert(i18n.common.notify, i18n.common.cannotScanQRCodeWithoutPermission, [
Expand Down
1 change: 0 additions & 1 deletion src/utils/walletConnect/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ export const connectWalletConnect = (wcUrl: string, toast?: ToastType) => {
runned[wcUrl] = true;
addConnection({ uri: wcUrl }).catch(e => {
const errMessage = (e as Error).message;
console.log('e----------', errMessage);
const message = errMessage.includes('Pairing already exists')
? i18n.errorMessage.connectionAlreadyExist
: i18n.errorMessage.failToAddConnection;
Expand Down

0 comments on commit 415b187

Please sign in to comment.