Skip to content

Commit

Permalink
update buttons view
Browse files Browse the repository at this point in the history
  • Loading branch information
Ridel1e committed Aug 29, 2023
1 parent c9b0b3a commit 0fe37be
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 59 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spectrumlabs/interface",
"version": "5.0.30",
"version": "5.0.32",
"private": false,
"scripts": {
"start": "vite",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ export const ActionsColumn: FC<ActionsColumnProps> = ({ ammPool }) => {
if (!position) {
return;
}
console.log({
lpAmount: position.availableLp,
xAmount: position.availableX,
yAmount: position.availableY,
percent: 100,
});
redeem(
position.pool,
{
Expand All @@ -56,7 +50,7 @@ export const ActionsColumn: FC<ActionsColumnProps> = ({ ammPool }) => {
).subscribe();
}}
>
{moreThan('l') && <Trans>Withdraw Liquidity</Trans>}
{moreThan('l') && <Trans>Remove liquidity</Trans>}
</Button>
);
}
Expand Down
94 changes: 43 additions & 51 deletions src/pages/PoolOverview/PoolInfoView/PoolInfoView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,57 +170,26 @@ export const PoolInfoView: FC<PoolInfoProps> = ({ position }) => {
}}
>
<Flex>
{isDeprecatedPool(position.pool.id) ? (
<Flex.Item flex={1} marginRight={2}>
<Button
type="primary"
size="large"
disabled={position.empty}
style={{
background: 'var(--spectrum-warning-color)',
borderColor: 'var(--spectrum-warning-color)',
}}
onClick={() => {
redeem(
position.pool,
{
lpAmount: position.availableLp,
xAmount: position.availableX,
yAmount: position.availableY,
percent: 100,
},
true,
).subscribe();
}}
block
>
{s ? (
<Trans>Withdraw</Trans>
) : (
<Trans>Withdraw Liquidity</Trans>
)}
</Button>
</Flex.Item>
) : (
<Flex.Item flex={1} marginRight={2}>
<Button
type="primary"
size="large"
icon={<PlusOutlined />}
onClick={handleAddLiquidity}
disabled={applicationConfig.blacklistedPools.includes(
<Flex.Item flex={1} marginRight={2}>
<Button
type="primary"
size="large"
icon={<PlusOutlined />}
onClick={handleAddLiquidity}
disabled={
applicationConfig.blacklistedPools.includes(
position.pool.id,
)}
block
>
{s ? (
<Trans>Increase</Trans>
) : (
<Trans>Increase Liquidity</Trans>
)}
</Button>
</Flex.Item>
)}
) || isDeprecatedPool(position.pool.id)
}
block
>
{s ? (
<Trans>Increase</Trans>
) : (
<Trans>Increase Liquidity</Trans>
)}
</Button>
</Flex.Item>
<Flex.Item flex={1}>
<Button
type="default"
Expand All @@ -229,7 +198,30 @@ export const PoolInfoView: FC<PoolInfoProps> = ({ position }) => {
}
size="large"
block
onClick={handleRemovePositionClick}
style={
isDeprecatedPool(position.pool.id)
? {
background: 'var(--spectrum-warning-color)',
borderColor: 'var(--spectrum-warning-color)',
}
: undefined
}
onClick={
isDeprecatedPool(position.pool.id)
? () => {
redeem(
position.pool,
{
lpAmount: position.availableLp,
xAmount: position.availableX,
yAmount: position.availableY,
percent: 100,
},
true,
).subscribe();
}
: handleRemovePositionClick
}
>
{s ? <Trans>Remove</Trans> : <Trans>Remove Liquidity</Trans>}
</Button>
Expand Down

0 comments on commit 0fe37be

Please sign in to comment.