forked from osmosis-labs/osmosis-frontend
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mattupham/collect and reinvest (osmosis-labs#2136)
* base func * Add tsdoc * Add coin and types to call * Remove space * Test collect and reinvest * Convert to CoinPretty * Update buttons * Update add button disabled states * Remove LD redirect * get pools in price store (osmosis-labs#2166) * Enable redirect * Rename --------- Co-authored-by: Jon Ator <[email protected]>
- Loading branch information
Showing
6 changed files
with
174 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,49 @@ | ||
import classNames from "classnames"; | ||
import React from "react"; | ||
|
||
import { Icon } from "~/components/assets"; | ||
import { Button } from "~/components/buttons"; | ||
import { Tooltip } from "~/components/tooltip"; | ||
|
||
export const RewardsCard: React.FC<{ | ||
title: string; | ||
tooltipContent: string; | ||
disabledTooltipContent?: string; | ||
onClick: () => void; | ||
image?: JSX.Element; | ||
containerClasses?: string; | ||
disabled: boolean; | ||
}> = ({ | ||
title, | ||
tooltipContent, | ||
disabledTooltipContent, | ||
onClick, | ||
image = null, | ||
containerClasses = "", | ||
disabled, | ||
}) => { | ||
return ( | ||
<div | ||
className={classNames( | ||
"flex w-full flex-grow cursor-pointer flex-col rounded-xl border-2 border-osmoverse-600", | ||
containerClasses | ||
)} | ||
<Button | ||
disabled={disabled} | ||
mode="unstyled" | ||
className="relative flex min-h-[50px] w-full flex-grow cursor-pointer flex-col !items-end justify-start overflow-hidden rounded-xl border-2 border-osmoverse-600 !p-0 disabled:cursor-not-allowed disabled:opacity-75" | ||
onClick={onClick} | ||
> | ||
{image} | ||
<div className="relative z-10 flex items-center justify-end p-4"> | ||
<div className="z-10 flex items-center gap-2 p-4"> | ||
<span className="text-osmoverse-white text-sm">{title}</span> | ||
<div className="pl-2 text-osmoverse-600 sm:hidden"> | ||
<Tooltip content={tooltipContent}> | ||
<Icon id="info" height="14px" width="14px" fill="#958FC0" /> | ||
</Tooltip> | ||
</div> | ||
{disabled && ( | ||
<div className="text-osmoverse-600 sm:hidden"> | ||
<Tooltip content={disabledTooltipContent}> | ||
<Icon id="info" height="14px" width="14px" fill="#EF3456" /> | ||
</Tooltip> | ||
</div> | ||
)} | ||
{!disabled && ( | ||
<div className="text-osmoverse-600 sm:hidden"> | ||
<Tooltip content={tooltipContent}> | ||
<Icon id="info" height="14px" width="14px" fill="#958FC0" /> | ||
</Tooltip> | ||
</div> | ||
)} | ||
</div> | ||
</div> | ||
</Button> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters