Merge branch 'add-availability'

This commit is contained in:
Arnaud 2024-09-24 10:33:10 +02:00
commit badf370f18
No known key found for this signature in database
GPG Key ID: 69D6CE281FCAE663
2 changed files with 9 additions and 14 deletions

View File

@ -1,23 +1,11 @@
import {
Placeholder,
StepperAction,
} from "@codex-storage/marketplace-ui-components";
import { Placeholder } from "@codex-storage/marketplace-ui-components";
import { ErrorIcon } from "../ErrorIcon/ErrorIcon";
import { Dispatch, useEffect } from "react";
type Props = {
error: Error;
dispatch: Dispatch<StepperAction>;
};
export function AvailabilityError({ dispatch, error }: Props) {
useEffect(() => {
dispatch({
isNextEnable: false,
type: "toggle-next",
});
}, [dispatch]);
export function AvailabilityError({ error }: Props) {
return (
<Placeholder
Icon={<ErrorIcon />}

View File

@ -65,11 +65,18 @@ export function useAvailabilityMutation(
setError(error);
WebStorage.set("availability-step", state.step - 1);
dispatch({
type: "next",
step: state.step,
isBackEnable: true,
});
dispatch({
type: "toggle-next",
isNextEnable: false,
});
},
});