This commit is contained in:
Jared Lockhart 2022-11-18 16:04:38 -05:00
Родитель 9f11aadb74
Коммит 9e5c34db4e
1 изменённых файлов: 28 добавлений и 0 удалений

Просмотреть файл

@ -73,6 +73,10 @@ export const FormAudience = ({
const config = useConfig();
const { fieldMessages, fieldWarnings } = useReviewCheck(experiment);
const [populationPercent, setPopulationPercent] = useState<number>(
parseFloat(experiment!.populationPercent || "0"),
);
const [locales, setLocales] = useState<string[]>(
experiment!.locales.map((v) => "" + v.id!),
);
@ -353,11 +357,35 @@ export const FormAudience = ({
"populationPercent",
POSITIVE_NUMBER_FIELD,
)}
aria-describedby="populationPercent-unit"
type="hidden"
min="0"
max="100"
step="1"
value={populationPercent}
/>
<Form.Control
aria-describedby="populationPercent-unit"
type="range"
min="0"
max="100"
step="1"
value={populationPercent}
onChange={(e) =>
setPopulationPercent(parseFloat(e.target.value))
}
className="mb-3"
/>
<Form.Control
aria-describedby="populationPercent-unit"
type="number"
min="0"
max="100"
step="1"
value={populationPercent}
onChange={(e) =>
setPopulationPercent(parseFloat(e.target.value))
}
/>
<InputGroup.Append>
<InputGroup.Text id="populationPercent-unit">%</InputGroup.Text>