mirror of
https://github.com/codex-storage/codex-marketplace-ui.git
synced 2025-02-22 20:58:30 +00:00
Add spinner while fetching health checks
This commit is contained in:
parent
33d925e6f0
commit
04f99c1b67
@ -3,7 +3,7 @@ import { useEffect, useState } from "react";
|
|||||||
import { useDebug } from "../../hooks/useDebug";
|
import { useDebug } from "../../hooks/useDebug";
|
||||||
import { usePersistence } from "../../hooks/usePersistence";
|
import { usePersistence } from "../../hooks/usePersistence";
|
||||||
import { usePortForwarding } from "../../hooks/usePortForwarding";
|
import { usePortForwarding } from "../../hooks/usePortForwarding";
|
||||||
import { Input } from "@codex-storage/marketplace-ui-components";
|
import { Input, Spinner } from "@codex-storage/marketplace-ui-components";
|
||||||
import { classnames } from "../../utils/classnames";
|
import { classnames } from "../../utils/classnames";
|
||||||
import "./HealthChecks.css";
|
import "./HealthChecks.css";
|
||||||
import { CodexSdk } from "../../sdk/codex";
|
import { CodexSdk } from "../../sdk/codex";
|
||||||
@ -165,7 +165,9 @@ export function HealthChecks({ online, onStepValid }: Props) {
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<span>
|
<span>
|
||||||
{portForwarding.enabled ? (
|
{portForwarding.isFetching ? (
|
||||||
|
<Spinner></Spinner>
|
||||||
|
) : portForwarding.enabled ? (
|
||||||
<SuccessCircleIcon></SuccessCircleIcon>
|
<SuccessCircleIcon></SuccessCircleIcon>
|
||||||
) : (
|
) : (
|
||||||
<ErrorCircleIcon width={16} />
|
<ErrorCircleIcon width={16} />
|
||||||
@ -175,7 +177,9 @@ export function HealthChecks({ online, onStepValid }: Props) {
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<span>
|
<span>
|
||||||
{codex.isSuccess ? (
|
{codex.isFetching ? (
|
||||||
|
<Spinner></Spinner>
|
||||||
|
) : codex.isSuccess ? (
|
||||||
<SuccessCircleIcon></SuccessCircleIcon>
|
<SuccessCircleIcon></SuccessCircleIcon>
|
||||||
) : (
|
) : (
|
||||||
<ErrorCircleIcon width={16} />
|
<ErrorCircleIcon width={16} />
|
||||||
@ -185,7 +189,9 @@ export function HealthChecks({ online, onStepValid }: Props) {
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<span>
|
<span>
|
||||||
{persistence.enabled ? (
|
{persistence.isFetching ? (
|
||||||
|
<Spinner></Spinner>
|
||||||
|
) : persistence.enabled ? (
|
||||||
<SuccessCircleIcon></SuccessCircleIcon>
|
<SuccessCircleIcon></SuccessCircleIcon>
|
||||||
) : (
|
) : (
|
||||||
<WarningIcon />
|
<WarningIcon />
|
||||||
|
@ -3,7 +3,7 @@ import { CodexSdk } from "../sdk/codex";
|
|||||||
import { Promises } from "../utils/promises";
|
import { Promises } from "../utils/promises";
|
||||||
|
|
||||||
export function useDebug(throwOnError: boolean) {
|
export function useDebug(throwOnError: boolean) {
|
||||||
const { data, isError, isPending, refetch, isSuccess } = useQuery({
|
const { data, isError, isPending, refetch, isSuccess, isFetching } = useQuery({
|
||||||
queryFn: () =>
|
queryFn: () =>
|
||||||
CodexSdk.debug()
|
CodexSdk.debug()
|
||||||
.info()
|
.info()
|
||||||
@ -27,5 +27,5 @@ export function useDebug(throwOnError: boolean) {
|
|||||||
throwOnError,
|
throwOnError,
|
||||||
});
|
});
|
||||||
|
|
||||||
return { data, isPending, isError, isSuccess, refetch };
|
return { data, isPending, isError, isSuccess, refetch, isFetching };
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user