Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/Bridge/BridgeInputsWidget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const BridgeInputsWidget: React.FC<BridgeInputsWidgetProps> = (props) => {
</Tooltip>
<TextInput
isNumeric={true}
value={amount?.toExact() ?? ''}
value={amount?.toExact()}
onChange={(value: any) => {
handleInput(value);
}}
Expand Down
13 changes: 11 additions & 2 deletions src/components/Pools/AddLiquidity/ConfirmPoolDrawer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
TransactionCompleted,
} from 'src/components';
import Drawer from 'src/components/Drawer';
import { ONE_BIPS } from 'src/constants';
import { Field } from 'src/state/pmint/atom';
import { SpaceType } from 'src/state/pstake/types';
import { useHederaPGLAssociated } from 'src/state/pwallet/hooks/hedera';
Expand Down Expand Up @@ -79,6 +80,14 @@ const ConfirmSwapDrawer: React.FC<Props> = (props) => {
currencies[Field.CURRENCY_A]?.symbol
} and ${parsedAmounts[Field.CURRENCY_B]?.toSignificant(6)} ${currencies[Field.CURRENCY_B]?.symbol}`;

function getShareOfPool() {
if (poolTokenPercentage?.lessThan(ONE_BIPS)) {
return '<0.001%';
} else {
return `${poolTokenPercentage?.toFixed(4) ?? 0}%`;
}
}

function renderAssociatButton() {
return (
<Button variant="primary" isDisabled={Boolean(isLoadingAssociate)} onClick={onAssociate}>
Expand Down Expand Up @@ -199,7 +208,7 @@ const ConfirmSwapDrawer: React.FC<Props> = (props) => {
</Text>

<Text fontSize="14px" color="text1" ml="10px">
{noLiquidity ? '100' : poolTokenPercentage?.toSignificant(4)}%
{noLiquidity ? '100%' : getShareOfPool()}
</Text>
</Box>
</Box>
Expand Down Expand Up @@ -249,7 +258,7 @@ const ConfirmSwapDrawer: React.FC<Props> = (props) => {

<Stat
title={t('addLiquidity.shareOfPool')}
stat={`${noLiquidity ? '100' : poolTokenPercentage?.toFixed(6)}%`}
stat={noLiquidity ? '100%' : getShareOfPool()}
titlePosition="top"
titleFontSize={14}
statFontSize={[16, 20]}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Pools/AddLiquidityModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ const AddLiquidityModal = ({ isOpen, onClose }: AddLiquidityModalProps) => {
}

return (
<Modal isOpen={isOpen} onDismiss={onClose} overlayBG={theme.modalBG2}>
<Modal isOpen={isOpen} onDismiss={onClose} overlayBG={theme.modalBG2} closeOnClickOutside={false}>
<Wrapper>
<Box p={10} display="flex" justifyContent="space-between" alignItems="center" width="100%">
<Text color="text1" fontSize={[24, 18]} fontWeight={500}>
Expand Down
13 changes: 11 additions & 2 deletions src/components/Pools/PoolImportModal/PositionCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Currency, JSBI, Pair, Percent } from '@pangolindex/sdk';
import React from 'react';
import { useTranslation } from 'react-i18next';
import { Box, Button, DoubleCurrencyLogo, Stat, Text } from 'src/components';
import { BIG_INT_ZERO } from 'src/constants';
import { BIG_INT_ZERO, ONE_BIPS } from 'src/constants';
import { usePairTotalSupplyHook } from 'src/data/multiChainsHooks';
import { useChainId, usePangolinWeb3 } from 'src/hooks';
import { usePairBalanceHook } from 'src/state/pwallet/hooks';
Expand Down Expand Up @@ -44,6 +44,15 @@ const PositionCard = ({ pair, onManagePoolsClick }: PositionCardProps) => {
JSBI.greaterThanOrEqual(totalPoolTokens.raw, userPoolBalance.raw)
? pair.getLiquidityValues(totalPoolTokens, userPoolBalance, { feeOn: false })
: [undefined, undefined];

function getShareOfPool() {
if (poolTokenPercentage?.lessThan(ONE_BIPS)) {
return '<0.001%';
} else {
return `${poolTokenPercentage?.toFixed(4) ?? 0}%`;
}
}

return (
<Wrapper>
<Text fontSize={16} color="oceanBlue">
Expand Down Expand Up @@ -81,7 +90,7 @@ const PositionCard = ({ pair, onManagePoolsClick }: PositionCardProps) => {
<Box>
<Stat
title={t('positionCard.poolShare')}
stat={`${poolTokenPercentage ? poolTokenPercentage.toFixed(6) + '%' : '-'}`}
stat={`${poolTokenPercentage ? getShareOfPool() : '-'}`}
titlePosition="top"
titleFontSize={14}
statFontSize={[20, 16]}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Pools/PoolImportModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const PoolImportModal = ({ isOpen, onClose, onManagePoolsClick }: ImportPoolModa
}, [setShowSearch]);

return (
<Modal isOpen={isOpen} onDismiss={onClose} overlayBG={theme.modalBG2}>
<Modal isOpen={isOpen} onDismiss={onClose} overlayBG={theme.modalBG2} closeOnClickOutside={false}>
<Wrapper>
<Box p={10} display="flex" justifyContent="space-between" alignItems="center" width="100%">
<Text color="text1" fontSize={[24, 18]} fontWeight={500}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { BridgeCurrency } from '@pangolindex/sdk';
import React, { useCallback } from 'react';
import { HelpCircle } from 'react-feather';
import { Text } from '..';
import { BridgeCurrencyLogo, BridgeCurrencyRowRoot } from './styled';

Expand All @@ -20,7 +21,11 @@ const BridgeCurrencyRow: React.FC<Props> = (props) => {

return (
<BridgeCurrencyRowRoot style={style} onClick={handleSelect} disabled={isSelected} selected={otherSelected}>
<BridgeCurrencyLogo src={bridgeCurrency?.logo} size={24} />
{bridgeCurrency?.logo && bridgeCurrency?.logo?.length > 0 ? (
<BridgeCurrencyLogo src={bridgeCurrency?.logo} size={24} />
) : (
<HelpCircle size={24} style={{ marginRight: '10px' }} />
)}
<Text color="bridge.text" fontSize={14} title={bridgeCurrency?.name}>
{bridgeCurrency?.symbol}
</Text>
Expand Down
1 change: 1 addition & 0 deletions src/components/SelectBridgeCurrencyDrawer/styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const BridgeCurrencyRowRoot = styled.div<{ disabled: boolean; selected: b
grid-gap: 16px;
align-items: center;
padding: 10px 30px;
overflow: hidden;

&:hover {
background-color: ${({ theme, disabled }) =>
Expand Down