Skip to content

Commit

Permalink
Merge pull request #1687 from galacticcouncil/add-badge
Browse files Browse the repository at this point in the history
Add badge
  • Loading branch information
vkulinich-cl authored Oct 1, 2024
2 parents e982fed + c78b515 commit 1fdc604
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/sections/pools/stablepool/components/PathOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { theme } from "theme"
import { Text } from "components/Typography/Text/Text"
import { SBlock } from "./PathOption.styled"
import { CheckBox } from "./CheckBox"
import { Badge } from "components/Badge/Badge"
import { useTranslation } from "react-i18next"

type Props = {
selected: boolean
Expand All @@ -14,6 +16,7 @@ type Props = {
subheading?: string
icon: ReactNode
disabled?: boolean
isFarms?: boolean
}

export const PathOption = ({
Expand All @@ -24,7 +27,10 @@ export const PathOption = ({
subheading,
icon,
disabled,
isFarms,
}: Props) => {
const { t } = useTranslation()

const color = disabled ? "whiteish500" : "white"

return (
Expand All @@ -37,6 +43,9 @@ export const PathOption = ({
<Heading fs={15} lh={20} fw={500} color={color}>
{heading}
</Heading>
{isFarms && (
<Badge>{t("farms.modal.joinedFarms.available.label")}</Badge>
)}
</div>
<CheckBox disabled={disabled} selected={selected} />
</div>
Expand Down
1 change: 1 addition & 0 deletions src/sections/pools/stablepool/transfer/TransferModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ export const TransferModal = ({ onClose, defaultPage, farms }: Props) => {
<TransferOptions
disableOmnipool={!canAddLiquidity}
onSelect={setSelectedOption}
farms={farms}
selected={selectedOption}
/>
<Button
Expand Down
4 changes: 4 additions & 0 deletions src/sections/pools/stablepool/transfer/TransferOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@ import { PathOption } from "sections/pools/stablepool/components/PathOption"
import { ListItem } from "sections/pools/stablepool/components/ListItem"
import { useTranslation } from "react-i18next"
import { Text } from "components/Typography/Text/Text"
import { Farm } from "api/farms"

export type Option = "OMNIPOOL" | "STABLEPOOL"

type Props = {
selected: Option
onSelect: (selected: Option) => void
disableOmnipool?: boolean
farms: Farm[]
}

export const TransferOptions = ({
selected,
onSelect,
disableOmnipool,
farms,
}: Props) => {
const { t } = useTranslation()
return (
Expand All @@ -28,6 +31,7 @@ export const TransferOptions = ({
subheading={t("liquidity.stablepool.add.benefits")}
icon={<WaterRippleIcon />}
disabled={disableOmnipool}
isFarms={!!farms.length}
>
<ListItem>
{t("liquidity.stablepool.add.stablepoolAndOmnipool.benefit1")}
Expand Down

0 comments on commit 1fdc604

Please sign in to comment.