mirror of
https://github.com/codex-storage/codex-marketplace-ui.git
synced 2025-02-22 12:48:32 +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 { usePersistence } from "../../hooks/usePersistence";
|
||||
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 "./HealthChecks.css";
|
||||
import { CodexSdk } from "../../sdk/codex";
|
||||
@ -165,7 +165,9 @@ export function HealthChecks({ online, onStepValid }: Props) {
|
||||
</li>
|
||||
<li>
|
||||
<span>
|
||||
{portForwarding.enabled ? (
|
||||
{portForwarding.isFetching ? (
|
||||
<Spinner></Spinner>
|
||||
) : portForwarding.enabled ? (
|
||||
<SuccessCircleIcon></SuccessCircleIcon>
|
||||
) : (
|
||||
<ErrorCircleIcon width={16} />
|
||||
@ -175,7 +177,9 @@ export function HealthChecks({ online, onStepValid }: Props) {
|
||||
</li>
|
||||
<li>
|
||||
<span>
|
||||
{codex.isSuccess ? (
|
||||
{codex.isFetching ? (
|
||||
<Spinner></Spinner>
|
||||
) : codex.isSuccess ? (
|
||||
<SuccessCircleIcon></SuccessCircleIcon>
|
||||
) : (
|
||||
<ErrorCircleIcon width={16} />
|
||||
@ -185,7 +189,9 @@ export function HealthChecks({ online, onStepValid }: Props) {
|
||||
</li>
|
||||
<li>
|
||||
<span>
|
||||
{persistence.enabled ? (
|
||||
{persistence.isFetching ? (
|
||||
<Spinner></Spinner>
|
||||
) : persistence.enabled ? (
|
||||
<SuccessCircleIcon></SuccessCircleIcon>
|
||||
) : (
|
||||
<WarningIcon />
|
||||
|
@ -3,7 +3,7 @@ import { CodexSdk } from "../sdk/codex";
|
||||
import { Promises } from "../utils/promises";
|
||||
|
||||
export function useDebug(throwOnError: boolean) {
|
||||
const { data, isError, isPending, refetch, isSuccess } = useQuery({
|
||||
const { data, isError, isPending, refetch, isSuccess, isFetching } = useQuery({
|
||||
queryFn: () =>
|
||||
CodexSdk.debug()
|
||||
.info()
|
||||
@ -27,5 +27,5 @@ export function useDebug(throwOnError: boolean) {
|
||||
throwOnError,
|
||||
});
|
||||
|
||||
return { data, isPending, isError, isSuccess, refetch };
|
||||
return { data, isPending, isError, isSuccess, refetch, isFetching };
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user