Skip to content

Commit

Permalink
fix pool info view page
Browse files Browse the repository at this point in the history
  • Loading branch information
Ridel1e committed Oct 12, 2023
1 parent 2cbc6ee commit 7ae01d8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
21 changes: 13 additions & 8 deletions src/pages/PoolOverview/PoolInfoView/PoolInfoView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,12 @@ export const PoolInfoView: FC<PoolInfoProps> = ({ position }) => {
<FarmsButton onClick={handleFarmsButtonClick} />
)}
</Flex.Item>
{!isDeprecatedPool(position.pool.id) && (
<Button onClick={handleSwap} size="large" type="primary">
<Trans>Swap</Trans>
</Button>
)}
{!isDeprecatedPool(position.pool.id) &&
!position.pool.unverified && (
<Button onClick={handleSwap} size="large" type="primary">
<Trans>Swap</Trans>
</Button>
)}
</Flex>
</PageHeader>
</Flex.Item>
Expand Down Expand Up @@ -179,7 +180,9 @@ export const PoolInfoView: FC<PoolInfoProps> = ({ position }) => {
disabled={
applicationConfig.blacklistedPools.includes(
position.pool.id,
) || isDeprecatedPool(position.pool.id)
) ||
isDeprecatedPool(position.pool.id) ||
position.pool.unverified
}
block
>
Expand All @@ -199,15 +202,17 @@ export const PoolInfoView: FC<PoolInfoProps> = ({ position }) => {
size="large"
block
style={
isDeprecatedPool(position.pool.id)
isDeprecatedPool(position.pool.id) ||
position.pool.unverified
? {
background: 'var(--spectrum-warning-color)',
borderColor: 'var(--spectrum-warning-color)',
}
: undefined
}
onClick={
isDeprecatedPool(position.pool.id)
isDeprecatedPool(position.pool.id) ||
position.pool.unverified
? () => {
redeem(
position.pool,
Expand Down
5 changes: 4 additions & 1 deletion src/pages/PoolOverview/PoolOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { useParamsStrict } from '../../common/hooks/useParamsStrict';
import { IsErgo } from '../../components/IsErgo/IsErgo.tsx';
import { Page } from '../../components/Page/Page';
import { getPositionByAmmPoolId } from '../../gateway/api/positions';
import { useSelectedNetwork } from '../../gateway/common/network';
import { useGuard } from '../../hooks/useGuard';
import { isCardano } from '../../utils/network.ts';
import { getAmmPoolConfidenceAnalyticByAmmPoolId } from './AmmPoolConfidenceAnalytic';
Expand All @@ -20,6 +21,7 @@ export const PoolOverview: React.FC = () => {
const navigate = useNavigate();
const { poolId } = useParamsStrict<{ poolId: PoolId }>();
const [position, loading] = useObservable(getPositionByAmmPoolId(poolId), []);
const [selectedNetwork] = useSelectedNetwork();
const { valBySize } = useDevice();
const [poolConfidenceAnalytic] = useObservable(
getAmmPoolConfidenceAnalyticByAmmPoolId(poolId),
Expand All @@ -36,7 +38,8 @@ export const PoolOverview: React.FC = () => {
withBackButton
backTo="../../../liquidity"
>
{position && poolConfidenceAnalytic ? (
{position &&
(poolConfidenceAnalytic || selectedNetwork.name !== 'ergo') ? (
<Flex col={valBySize(true, true, false)}>
<Flex.Item
flex={valBySize(undefined, undefined, 1)}
Expand Down

0 comments on commit 7ae01d8

Please sign in to comment.