swarm-ui: a start page at / and the hive directory at /hives
/ is now the swarm's name over the digital-rain backdrop the hive dashboard's home has, and the swarm name in the header links to it. The hive directory moves to /hives, where the nav's hives tab points. The swarm name is read once per page load by a shared hook, the header and the start page both use it. Closes #5252
This commit is contained in:
parent
be2e64fa89
commit
417125b33c
1 changed files with 240 additions and 37 deletions
20
frontend/packages/swarm-ui/src/pages/StartPage.tsx
Normal file
20
frontend/packages/swarm-ui/src/pages/StartPage.tsx
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
// <StartPage> — `/`, the swarm's landing page: the swarm's name over the
|
||||
// digital-rain backdrop, and nothing else. The header's swarm name links
|
||||
// here. The hive roster that used to be `/` is now `/hives`.
|
||||
import { MatrixRain } from "../shell/MatrixRain.js";
|
||||
import { useSwarmName } from "../shell/useSwarmName.js";
|
||||
import "./StartPage.css";
|
||||
|
||||
// Same fallback as the header and the page title, so an unnamed swarm shows
|
||||
// one label everywhere.
|
||||
const DEFAULT_NAME = "hyperhive swarm";
|
||||
|
||||
export function StartPage() {
|
||||
const name = useSwarmName() ?? DEFAULT_NAME;
|
||||
return (
|
||||
<div class="start-page">
|
||||
<MatrixRain />
|
||||
<h1 class="start-page-name">{name}</h1>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue