mirror of
https://github.com/codex-storage/codex-marketplace-ui.git
synced 2025-02-24 05:38:18 +00:00
Disable next button on error
This commit is contained in:
parent
710fecbda7
commit
55d569bed4
@ -38,7 +38,9 @@ export function AvailabilityCreate({ space }: Props) {
|
||||
const components = [
|
||||
AvailabilityForm,
|
||||
AvailabilityConfirm,
|
||||
error ? () => <AvailabilityError error={error} /> : AvailabilitySuccess,
|
||||
error
|
||||
? () => <AvailabilityError dispatch={dispatch} error={error} />
|
||||
: AvailabilitySuccess,
|
||||
];
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -1,11 +1,23 @@
|
||||
import { Placeholder } from "@codex-storage/marketplace-ui-components";
|
||||
import {
|
||||
Placeholder,
|
||||
StepperAction,
|
||||
} 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({ error }: Props) {
|
||||
export function AvailabilityError({ dispatch, error }: Props) {
|
||||
useEffect(() => {
|
||||
dispatch({
|
||||
isNextEnable: false,
|
||||
type: "toggle-next",
|
||||
});
|
||||
}, [dispatch]);
|
||||
|
||||
return (
|
||||
<Placeholder
|
||||
Icon={<ErrorIcon />}
|
||||
|
Loading…
x
Reference in New Issue
Block a user