Skip to content

Commit

Permalink
Do not add validation marker to organizer location step
Browse files Browse the repository at this point in the history
  • Loading branch information
Anahkiasen committed Oct 12, 2023
1 parent 6c1abe5 commit 8c2a512
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions src/pages/steps/AdditionalInformationStep/PhysicalLocationStep.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import React, { useEffect } from 'react';
import React from 'react';
import { useTranslation } from 'react-i18next';

import { useChangeLocationMutation } from '@/hooks/api/organizers';
import {
TabContentProps,
ValidationStatus,
} from '@/pages/steps/AdditionalInformationStep/AdditionalInformationStep';
import { isLocationSet, LocationStep } from '@/pages/steps/LocationStep';
import type { FormData } from '@/pages/create/OfferForm';
import { TabContentProps } from '@/pages/steps/AdditionalInformationStep/AdditionalInformationStep';
import { LocationStep } from '@/pages/steps/LocationStep';
import { StepProps } from '@/pages/steps/Steps';
import { StackProps } from '@/ui/Stack';

Expand All @@ -16,19 +14,10 @@ function PhysicalLocationStep({
onValidationChange,
...props
}: PhysicalLocationStepProps) {
const location = props.watch('location');
const changeLocation = useChangeLocationMutation();
const { i18n } = useTranslation();

useEffect(() => {
onValidationChange(
location?.streetAndNumber
? ValidationStatus.SUCCESS
: ValidationStatus.WARNING,
);
}, [onValidationChange, location]);

const onChange = (updatedLocation: typeof location) => {
const onChange = (updatedLocation: FormData['location']) => {
props.onSuccessfulChange(updatedLocation);
if (!updatedLocation.streetAndNumber) {
return;
Expand Down

0 comments on commit 8c2a512

Please sign in to comment.