Skip to content

Commit

Permalink
fix: uniswap warning width and data in it (#3000)
Browse files Browse the repository at this point in the history
  • Loading branch information
bigint committed Jun 4, 2023
1 parent 88d0cae commit 05ebb72
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ const CollectModule: FC<CollectModuleProps> = ({
) : null
) : (
<WarningMessage
className="mt-5"
className="mt-5 w-full"
message={<Uniswap module={collectModule} />}
/>
)
Expand Down
13 changes: 8 additions & 5 deletions apps/web/src/components/Shared/Uniswap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,21 @@ interface UniswapProps {
}

const Uniswap: FC<UniswapProps> = ({ module }) => {
const amount = module?.amount?.value ?? module?.fee?.amount?.value;
const currency =
module?.amount?.asset?.symbol ?? module?.fee?.amount?.asset?.symbol;
const assetAddress =
module?.amount?.asset?.address ?? module?.fee?.amount?.asset?.address;

return (
<div className="space-y-1">
<div className="text-sm">
<Trans>
You don't have enough <b>{module?.amount?.asset?.symbol}</b>
You don't have enough <b>{currency}</b>
</Trans>
</div>
<Link
href={getUniswapURL(
parseFloat(module?.amount?.value),
module?.amount?.asset?.address
)}
href={getUniswapURL(parseFloat(amount), assetAddress)}
onClick={() => {
Leafwatch.track(PUBLICATION.COLLECT_MODULE.OPEN_UNISWAP);
}}
Expand Down

2 comments on commit 05ebb72

@vercel
Copy link

@vercel vercel bot commented on 05ebb72 Jun 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

prerender – ./apps/prerender

prerender-git-main-lenster.vercel.app
prerender-lenster.vercel.app
prerender.lenster.xyz

@vercel
Copy link

@vercel vercel bot commented on 05ebb72 Jun 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

web – ./apps/web

web-git-main-lenster.vercel.app
web-lenster.vercel.app
lenster.vercel.app
lenster.xyz

Please sign in to comment.