Skip to content
Snippets Groups Projects
Unverified Commit a21b5f02 authored by Alexander Lesnenko's avatar Alexander Lesnenko Committed by GitHub
Browse files

fix progress bar text alignment and missing translations (#19249)

parent 411e69e4
No related branches found
No related tags found
No related merge requests found
import React from "react";
import { t } from "ttag";
import { scaleLinear } from "@visx/scale";
import { Group } from "@visx/group";
import { ClipPath } from "@visx/clip-path";
......@@ -111,7 +112,7 @@ const ProgressBar = ({
color="white"
x={layout.iconSize + 16}
y={layout.barHeight / 2}
dominantBaseline="central"
verticalAnchor="middle"
fill="white"
>
{barText}
......@@ -144,7 +145,7 @@ const ProgressBar = ({
{formatNumber(0, format)}
</Text>
<Text fontSize={layout.fontSize} textAnchor="end" x={xMax}>
{`Goal ${formatNumber(data.goal, format)}`}
{t`Goal ${formatNumber(data.goal, format)}`}
</Text>
</Group>
</svg>
......
import Color from "color";
import { t } from "ttag";
import { measureText } from "metabase/static-viz/lib/text";
import { ProgressBarData } from "./types";
......@@ -31,9 +32,9 @@ export const getColors = (
export const getBarText = ({ value, goal }: ProgressBarData) => {
if (value === goal) {
return "Goal met";
return t`Goal met`;
} else if (value > goal) {
return "Goal exceeded";
return t`Goal exceeded`;
}
return null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment