Skip to content
This repository has been archived by the owner on Apr 10, 2023. It is now read-only.

Commit

Permalink
fix: fix editing multivariant rule in UI (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
markphelps authored Feb 22, 2023
1 parent 383288d commit 9dd6b07
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/components/rules/EditRuleForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { useSuccess } from '~/data/hooks/success';
import { IEvaluatable } from '~/types/Evaluatable';
import { ISegment } from '~/types/Segment';
import { IVariant } from '~/types/Variant';
import Loading from '../Loading';

type RuleFormProps = {
setOpen: (open: boolean) => void;
Expand Down Expand Up @@ -89,7 +88,7 @@ export default function EditRuleForm(props: RuleFormProps) {
});
}}
>
{(formik) => {
{(_formik) => {
return (
<Form className="flex h-full flex-col overflow-y-scroll bg-white shadow-xl">
<div className="flex-1">
Expand Down Expand Up @@ -141,7 +140,7 @@ export default function EditRuleForm(props: RuleFormProps) {
<div className="space-y-1 px-4 sm:grid sm:grid-cols-3 sm:gap-4 sm:space-y-0 sm:px-6 sm:py-5">
<div>
<label
htmlFor="segmentKey"
htmlFor="ruleType"
className="block text-sm font-medium text-gray-900 sm:mt-px sm:pt-2"
>
Type
Expand Down Expand Up @@ -280,15 +279,8 @@ export default function EditRuleForm(props: RuleFormProps) {
<div className="flex-shrink-0 border-t border-gray-200 px-4 py-5 sm:px-6">
<div className="flex justify-end space-x-3">
<Button onClick={() => setOpen(false)}>Cancel</Button>
<Button
primary
type="submit"
disabled={
!(formik.dirty && formik.isValid && !formik.isSubmitting)
}
className="min-w-[80px]"
>
{formik.isSubmitting ? <Loading isPrimary /> : 'Update'}
<Button primary type="submit" className="min-w-[80px]">
Update
</Button>
</div>
</div>
Expand Down

0 comments on commit 9dd6b07

Please sign in to comment.