Skip to content

Commit

Permalink
Added Create Pool message on button
Browse files Browse the repository at this point in the history
  • Loading branch information
Sniezka1927 committed Jan 30, 2024
1 parent b824263 commit a146a91
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
13 changes: 0 additions & 13 deletions .trunk/trunk.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/AnimatedButton/AnimatedButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const AnimatedButton: React.FC<Props> = ({
className
}) => {
const classes = useStyles()

console.log(disabled)
const getMessage = () => {
if (progress === 'none') {
return <p className={classes.buttonContent}>{content}</p>
Expand Down
13 changes: 8 additions & 5 deletions src/components/NewPosition/DepositSelector/DepositSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,17 @@ export const DepositSelector: React.FC<IDepositSelector> = ({
if (tokenAIndex === tokenBIndex) {
return 'Select different tokens'
}
console.log(tokenAIndex, tokenBIndex, tokenAInputState.value, tokenBInputState.value, tokens)
console.log(poolIndex, canCreateNewPool)

if (
(poolIndex === null && !canCreateNewPool) ||
(poolIndex !== null && !canCreateNewPosition)
) {
if (poolIndex !== null && !canCreateNewPosition) {
return 'Insufficient lamports'
}

if (poolIndex === null && !canCreateNewPool) {
return 'Create pool'
}

if (
!tokenAInputState.blocked &&
printBNtoBN(tokenAInputState.value, tokens[tokenAIndex].decimals).gt(
Expand Down Expand Up @@ -398,7 +401,7 @@ export const DepositSelector: React.FC<IDepositSelector> = ({
onAddLiquidity()
}
}}
disabled={getButtonMessage() !== 'Add Liquidity'}
disabled={getButtonMessage() !== 'Add Liquidity' && getButtonMessage() !== 'Create pool'}
content={getButtonMessage()}
progress={progress}
/>
Expand Down

0 comments on commit a146a91

Please sign in to comment.