Skip to content

Commit

Permalink
Improved display when choosing the split on the new phase modal when …
Browse files Browse the repository at this point in the history
…there are multiple variations
  • Loading branch information
Auz committed Dec 7, 2021
1 parent 0fb524a commit d184df5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/front-end/components/Experiment/NewPhaseForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ const NewPhaseForm: FC<{
refreshWatching();
});

const maxSplitCols = experiment.variations.length > 2 ? 6 : 3;
const splitCols = Math.max(
Math.round(12 / experiment.variations.length - 1),
maxSplitCols
);

return (
<Modal
header={firstPhase ? "Start Experiment" : "New Experiment Phase"}
Expand Down Expand Up @@ -129,13 +135,7 @@ const NewPhaseForm: FC<{
<label>Traffic Split</label>
<div className="row">
{experiment.variations.map((v, i) => (
<div
className={`col-${Math.max(
Math.round(12 / experiment.variations.length - 1),
3
)} mb-2`}
key={i}
>
<div className={`col-${splitCols} mb-2`} key={i}>
<Field
type="number"
min="0"
Expand Down

1 comment on commit d184df5

@vercel
Copy link

@vercel vercel bot commented on d184df5 Dec 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

app – ./packages/front-end/

app-growthbook.vercel.app
app-git-main-growthbook.vercel.app
app-ruby.vercel.app
app.growthbook.io

Please sign in to comment.