Skip to content

Commit

Permalink
feat(admin): add back button on user account settings v3
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricss committed Aug 29, 2024
1 parent f51c83f commit 45b9dee
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useCallback, useEffect } from "react";
import { useForm, useWatch } from "react-hook-form";

import { z } from "zod";
import { useFeatureflipping } from "@/components/feature-flipping/featureFlipping";

export const userAccountFormSchema = z.object({
firstname: z
Expand Down Expand Up @@ -43,6 +44,9 @@ export const UserAccountForm = ({
defaultValues?: UserAccountFormData;
emailFieldDisabled?: boolean;
}) => {
const { isFeatureActive } = useFeatureflipping();
const isSettingsV3Enabled = isFeatureActive("AAP_SETTINGS_V3");

const methods = useForm<UserAccountFormData>({
resolver: zodResolver(userAccountFormSchema),
defaultValues: defaultValues || {
Expand Down Expand Up @@ -191,7 +195,10 @@ export const UserAccountForm = ({
)}
</Select>
</fieldset>
<FormButtons formState={formState} />
<FormButtons
formState={formState}
backUrl={isSettingsV3Enabled ? "/agencies-settings" : undefined}
/>
</form>
</>
);
Expand Down

0 comments on commit 45b9dee

Please sign in to comment.