Skip to content

Commit

Permalink
add support label
Browse files Browse the repository at this point in the history
  • Loading branch information
vkulinich-cl committed Dec 23, 2024
1 parent 5e2ea3a commit 783e1c1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
4 changes: 3 additions & 1 deletion src/components/InfoTooltip/InfoTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type InfoTooltipProps = {
children?: ReactNode
type?: "default" | "black"
side?: Tooltip.TooltipContentProps["side"]
align?: Tooltip.TooltipContentProps["align"]
asChild?: boolean
preventDefault?: boolean
}
Expand All @@ -18,6 +19,7 @@ export function InfoTooltip({
children,
type = "default",
side = "bottom",
align = "start",
asChild = false,
preventDefault,
}: InfoTooltipProps) {
Expand Down Expand Up @@ -49,7 +51,7 @@ export function InfoTooltip({
<SContent
type={type}
side={side}
align="start"
align={align}
sideOffset={3}
alignOffset={-10}
collisionPadding={12}
Expand Down
30 changes: 19 additions & 11 deletions src/components/ReferendumCard/Referenda.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
useSupportThreshold,
} from "./Referenda.utils"
import Skeleton from "react-loading-skeleton"
import { InfoTooltip } from "components/InfoTooltip/InfoTooltip"

export const OpenGovReferenda = ({
id,
Expand Down Expand Up @@ -168,17 +169,24 @@ export const OpenGovReferenda = ({

<Spacer size={16} />
<div sx={{ flex: "column", gap: 8 }}>
<SProgressBarContainer>
<div css={{ position: "relative" }}>
<LinearProgress
size="small"
withoutLabel
percent={barPercentage}
colorCustom="#B3D7FA"
/>
<SThresholdLine percentage={markPercentage.toString()} />
</div>
</SProgressBarContainer>
<InfoTooltip
text={t("referenda.support", {
value: t("value.percentage", { value: barPercentage }),
})}
align="center"
>
<SProgressBarContainer>
<div css={{ position: "relative" }}>
<LinearProgress
size="small"
withoutLabel
percent={barPercentage}
colorCustom="#B3D7FA"
/>
<SThresholdLine percentage={markPercentage.toString()} />
</div>
</SProgressBarContainer>
</InfoTooltip>
<div sx={{ flex: "row", justify: "space-between" }}>
<div sx={{ flex: "row", gap: 2 }}>
<Text fs={11} css={{ color: "#DFB1F3" }}>
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1244,6 +1244,7 @@
"claimingRange.modal.description1": "After joining a farm, a portion of the accumulated rewards is locked. These rewards unlock over time as you remain in the farm and follow loyalty factor curve",
"claimingRange.modal.description2": "Claiming forfeits the locked part of the rewards. Use this setting to tweak your preference over claiming faster or losing less rewards (default). This allows you to compound your rewards with ease.",
"referenda.ongoing": "Ongoing Referenda",
"referenda.support": "Support: {{value}}",
"referenda.empty.title": "No Referenda",
"referenda.empty.desc.first": "Nothing here.",
"referenda.empty.desc.second": " Currently there are no ongoing referenda to vote in.",
Expand Down

0 comments on commit 783e1c1

Please sign in to comment.