diff --git a/package-lock.json b/package-lock.json index 6ad30f2..dee7ce7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,8 +9,8 @@ "version": "0.0.7", "license": "MIT", "dependencies": { - "@codex-storage/marketplace-ui-components": "^0.0.25", - "@codex-storage/sdk-js": "^0.0.10", + "@codex-storage/marketplace-ui-components": "^0.0.26", + "@codex-storage/sdk-js": "^0.0.12", "@sentry/browser": "^8.32.0", "@sentry/react": "^8.31.0", "@tanstack/react-query": "^5.51.15", @@ -374,9 +374,9 @@ "dev": true }, "node_modules/@codex-storage/marketplace-ui-components": { - "version": "0.0.25", - "resolved": "https://registry.npmjs.org/@codex-storage/marketplace-ui-components/-/marketplace-ui-components-0.0.25.tgz", - "integrity": "sha512-oWR/E0yNWK/Lj2LI3lAqKDzuMw6sTUyYfkhZBbV4yK/4VnGtIIoW0OU+jggishJYAwh3y4s71OfMjWaGGafWlQ==", + "version": "0.0.26", + "resolved": "https://registry.npmjs.org/@codex-storage/marketplace-ui-components/-/marketplace-ui-components-0.0.26.tgz", + "integrity": "sha512-x8niBv1HRJU6VnKJ5+tv3+yYMxOj0tnMdNaPGzHVXMTHpj5WeHRcqUR1UhxxxnIlnsOjhmjX2tVUYPxpAz+OEw==", "dependencies": { "lucide-react": "^0.453.0" }, @@ -398,9 +398,9 @@ } }, "node_modules/@codex-storage/sdk-js": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/@codex-storage/sdk-js/-/sdk-js-0.0.10.tgz", - "integrity": "sha512-DUq4YJF9r+45CaUf+ry0I6cawsfQA2RWbHmxASh9UuUu8L2xNlAbk8Uc2zmMr2HiixGDwO6b+BCtwZkDLBhTPQ==", + "version": "0.0.12", + "resolved": "https://registry.npmjs.org/@codex-storage/sdk-js/-/sdk-js-0.0.12.tgz", + "integrity": "sha512-WjMZ9fkeVFBdDlFViWRDIirk2s4nX0U5r4WixAeieAkDBlRq5nqWcm9rqz5/8u8EQudgk/y3p0vPZc8cpyK4bA==", "dependencies": { "valibot": "^0.32.0" }, diff --git a/package.json b/package.json index 1954636..ee72e3e 100644 --- a/package.json +++ b/package.json @@ -24,8 +24,8 @@ "React" ], "dependencies": { - "@codex-storage/marketplace-ui-components": "^0.0.25", - "@codex-storage/sdk-js": "^0.0.11", + "@codex-storage/marketplace-ui-components": "^0.0.26", + "@codex-storage/sdk-js": "^0.0.12", "@sentry/browser": "^8.32.0", "@sentry/react": "^8.31.0", "@tanstack/react-query": "^5.51.15", diff --git a/src/components/ErrorCircleIcon/ErrorCircleIcon.tsx b/src/components/ErrorCircleIcon/ErrorCircleIcon.tsx new file mode 100644 index 0000000..79d0658 --- /dev/null +++ b/src/components/ErrorCircleIcon/ErrorCircleIcon.tsx @@ -0,0 +1,21 @@ +type Props = { + className?: string; +}; + +export function ErrorCircleIcon({ className = "" }: Props) { + return ( + + + + ); +} diff --git a/src/components/ManifestFetch/ManifestFetch.tsx b/src/components/ManifestFetch/ManifestFetch.tsx index 054081b..99bfa22 100644 --- a/src/components/ManifestFetch/ManifestFetch.tsx +++ b/src/components/ManifestFetch/ManifestFetch.tsx @@ -2,23 +2,26 @@ import { Button, Input } from "@codex-storage/marketplace-ui-components"; import "./ManifestFetch.css"; import { ChangeEvent, useState } from "react"; import { CodexSdk } from "../../sdk/codex"; -import { useQuery } from "@tanstack/react-query"; +import { useQuery, useQueryClient } from "@tanstack/react-query"; import { Promises } from "../../utils/promises"; export function ManifestFetch() { const [cid, setCid] = useState(""); + const queryClient = useQueryClient(); const { refetch } = useQuery({ - queryFn: () => - CodexSdk.data() + queryFn: () => { + return CodexSdk.data() .fetchManifest(cid) .then((s) => { if (s.error === false) { setCid(""); + queryClient.invalidateQueries({ queryKey: ["cids"] }); } return Promises.rejectOnError(s); - }), - queryKey: ["cids"], + }); + }, + queryKey: ["manifest"], // Disable the fetch to make it available on refetch only enabled: false, @@ -44,6 +47,7 @@ export function ManifestFetch() {
{text}
+
diff --git a/src/components/OnBoarding/OnBoardingStepThree.css b/src/components/OnBoarding/OnBoardingStepThree.css
index 0d49e69..0c56661 100644
--- a/src/components/OnBoarding/OnBoardingStepThree.css
+++ b/src/components/OnBoarding/OnBoardingStepThree.css
@@ -27,10 +27,6 @@
cursor: pointer;
}
-.onboarding-check-refresh--fetching {
- animation: rotateAnimation 2s linear infinite;
-}
-
.onboarding-group {
display: flex;
align-items: center;
@@ -43,6 +39,75 @@
padding-left: 1rem;
}
+.onboarding-deviceCheck {
+ margin-top: 1rem;
+ margin-bottom: 1rem;
+ font-family: Azeret Mono;
+ font-size: 14px;
+ font-weight: 400;
+ line-height: 16.34px;
+ display: inline-block;
+}
+
+.onboarding--deviceCheck-block {
+ flex: 0.3;
+}
+
+.onboarding-displayName {
+ margin-bottom: 1.75rem;
+}
+
+.onboarding-healthCheck-item {
+ display: flex;
+ align-items: center;
+ padding: 16px 0;
+ gap: 16px;
+ border-top: 1px solid #3c3d3e;
+ border-bottom: 1px solid #3c3d3e;
+}
+
+.onboarding-healthCheck-itemText {
+ font-family: Inter;
+ font-size: 16px;
+ font-weight: 500;
+ line-height: 24px;
+ letter-spacing: -0.011em;
+}
+
+.onboarding-healthChecks {
+ margin-bottom: 32px;
+}
+
+.onboarding-healthCheck-icon {
+ display: flex;
+ align-items: center;
+ width: 20px;
+ height: 20px;
+ justify-content: center;
+}
+
+.onboarding-refresh {
+ position: relative;
+ top: 14px;
+ cursor: pointer;
+}
+
+.onboarding-refresh--fetching {
+ animation: rotate 2s linear infinite;
+}
+
+.onboarding-portContainer,
+.onboarding-addressContainer {
+ position: relative;
+}
+
+.onboarding--addressSuccessIcon {
+ position: absolute;
+ top: 53px;
+ bottom: 0;
+ right: 18px;
+}
+
@keyframes rotate {
from {
transform: rotate(0deg); /* Start at 0 degrees */
diff --git a/src/components/OnBoarding/OnBoardingStepThree.tsx b/src/components/OnBoarding/OnBoardingStepThree.tsx
index c104a8b..2de83bc 100644
--- a/src/components/OnBoarding/OnBoardingStepThree.tsx
+++ b/src/components/OnBoarding/OnBoardingStepThree.tsx
@@ -1,20 +1,21 @@
-import { CheckIcon, RefreshCcw, Save, ShieldAlert, X } from "lucide-react";
import { classnames } from "../../utils/classnames";
import "./OnBoardingStepThree.css";
import { usePortForwarding } from "../../hooks/usePortForwarding";
-import { useCodexConnection } from "../../hooks/useCodexConnection";
-import {
- Alert,
- ButtonIcon,
- Input,
- SimpleText,
-} from "@codex-storage/marketplace-ui-components";
-import { useEffect, useState } from "react";
+import { Input, SimpleText } from "@codex-storage/marketplace-ui-components";
+import { ClipboardEvent, useEffect, useState } from "react";
import { CodexSdk } from "../../sdk/codex";
import { useQueryClient } from "@tanstack/react-query";
import { usePersistence } from "../../hooks/usePersistence";
import { useDebug } from "../../hooks/useDebug";
import { DebugUtils } from "../../utils/debug";
+import { AlphaIcon } from "./AlphaIcon";
+import { OnBoardingUtils } from "../../utils/onboarding";
+import { RefreshIcon } from "../RefreshIcon/RefreshIcon";
+import { HealthCheckIcon } from "./HealthCheckIcon";
+import { HealthCheckItem } from "./HealthCheckItem";
+import { Strings } from "../../utils/strings";
+import { SuccessCheckIcon } from "../SuccessCheckIcon/SuccessCheckIcon";
+import { ErrorCircleIcon } from "../ErrorCircleIcon/ErrorCircleIcon";
type Props = {
online: boolean;
@@ -30,6 +31,7 @@ export function OnBoardingStepThree({ online, onStepValid }: Props) {
const persistence = usePersistence(codex.isSuccess);
const [url, setUrl] = useState(CodexSdk.url);
const queryClient = useQueryClient();
+ const [isInvalid, setIsInvalid] = useState(false);
useEffect(() => {
onStepValid(online && portForwarding.enabled && codex.isSuccess);
@@ -38,179 +40,180 @@ export function OnBoardingStepThree({ online, onStepValid }: Props) {
useEffect(() => {
if (codex.isSuccess) {
persistence.refetch();
+ portForwarding.refetch();
}
- }, [codex.isSuccess]);
+ }, [persistence, portForwarding, codex.isSuccess]);
- const onChange = (e: React.FormEvent Internet connection Port forwarding Codex Codex connection Marketplace
-
+ Device Health Check
-
+ Nice to meet {displayName},
+
+ Let’s establish our connection.
+
+
+
+
+ Let’s get you setup.
+
+ What do you want to be called?
+