Skip to content

An open-source, self-hosted system for apps built with web technologies.

The Desktop waits with React UI's Spinner, the System's official one

zohayrslileh79bf9385c3df
diff --git a/source/client/view/components/loading.tsx b/source/client/view/components/loading.tsx
index d870ffd..6b5872d 100644
--- a/source/client/view/components/loading.tsx
+++ b/source/client/view/components/loading.tsx
@@ -1,5 +1,4 @@
-import { Surface, type SurfaceProps } from "@phreshos/react-ui"
-import Spinner from "./spinner"
+import { Spinner, Surface, type SurfaceProps } from "@phreshos/react-ui"
type LoadingProps = Omit<SurfaceProps, "material">
@@ -19,7 +18,7 @@ export default function ({ className, style, children, ...props }: LoadingProps)
<div className="m-auto grid justify-items-center gap-3" role={described ? "status" : undefined}>
- <Spinner aria-hidden={described ? true : undefined} className="size-6" />
+ {described ? <Spinner decorative /> : <Spinner label="Loading" />}
{described && <span data-loading-message className="text-sm opacity-60">{children}</span>}
diff --git a/source/client/view/components/spinner.tsx b/source/client/view/components/spinner.tsx
deleted file mode 100644
index 00be9ae..0000000
--- a/source/client/view/components/spinner.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import { ComponentProps } from "react"
-import { useReducedMotion } from "@libs/react-motion"
-
-export default function ({ className, children, ...props }: ComponentProps<"div">) {
-
- const reducedMotion = useReducedMotion()
-
- return <div
-
- role="status"
-
- className={`rounded-full border-2 border-current border-t-transparent ${reducedMotion ? "" : "animate-spin"} ${className ?? ""}`}
-
- {...props}
-
- >
-
- {children ?? <span className="sr-only">Loading</span>}
-
- </div>
-}
diff --git a/source/client/view/structure/desktop/windows/process-window.tsx b/source/client/view/structure/desktop/windows/process-window.tsx
index e9ebbf3..feec91a 100644
--- a/source/client/view/structure/desktop/windows/process-window.tsx
+++ b/source/client/view/structure/desktop/windows/process-window.tsx
@@ -4,7 +4,7 @@ import { type PaintMargins, type WindowSurfaceSize } from "@client/view/componen
import { type PresentationAnimation, type DesktopMoveGestureController } from "@client/view/components/desktop-host/presentation"
import { type PresentationGeometryRepresentation } from "@client/view/components/window-manager/presentations"
import { type Position, type Size, type TaskbarPosition, type Theme, type PresentationSurface, type WindowLayer } from "@phreshos/core"
-import Spinner from "@client/view/components/spinner"
+import { Spinner } from "@phreshos/react-ui"
import Window from "./window"
import useDragHold from "../drag-hold"
import ProgramFrame, { programFrameSource } from "@client/view/components/program-frame"
@@ -208,11 +208,7 @@ export default memo(function ({ identity, record, assetId, client, title, header
progress layer. Neither paints a backdrop or Surface. */}
{progress && <div className="pointer-events-none absolute inset-0 z-10 grid">
- <Spinner className="m-auto size-6">
-
- <span className="sr-only">{progress}</span>
-
- </Spinner>
+ <Spinner label={progress} className="m-auto" />
</div>}