Rename 'creature' to 'cluster'. (#223)
This fixes #222. Note that it only renames it in the UI, not in the code or the TOML metadata, as that would require a ton of changes, and possibly break old links.pull/228/head
rodzic
6277fc9157
commit
9572aab1ed
|
@ -1,6 +1,7 @@
|
||||||
import React, { MouseEvent, useContext } from "react";
|
import React, { MouseEvent, useContext } from "react";
|
||||||
import { Helmet } from "react-helmet";
|
import { Helmet } from "react-helmet";
|
||||||
import type { PageName } from "./pages";
|
import type { PageName } from "./pages";
|
||||||
|
import { getFriendlyPageName } from "./pages/friendly-page-names";
|
||||||
|
|
||||||
import "./page.css";
|
import "./page.css";
|
||||||
|
|
||||||
|
@ -38,7 +39,7 @@ const PageLink: React.FC<{ page: PageName }> = ({ page }) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<a href={href} onClick={handleClick}>
|
<a href={href} onClick={handleClick}>
|
||||||
{page}
|
{getFriendlyPageName(page)}
|
||||||
</a>
|
</a>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -51,7 +52,11 @@ const Navbar: React.FC<{}> = (props) => {
|
||||||
<ul className="navbar">
|
<ul className="navbar">
|
||||||
{pc.allPages.map((pageName) => (
|
{pc.allPages.map((pageName) => (
|
||||||
<li key={pageName}>
|
<li key={pageName}>
|
||||||
{pc.currPage === pageName ? pageName : <PageLink page={pageName} />}
|
{pc.currPage === pageName ? (
|
||||||
|
getFriendlyPageName(pageName)
|
||||||
|
) : (
|
||||||
|
<PageLink page={pageName} />
|
||||||
|
)}
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -313,7 +313,7 @@ export const CreaturePageWithDefaults: React.FC<
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page title="Creature!">
|
<Page title="Cluster!">
|
||||||
<div className="sidebar">
|
<div className="sidebar">
|
||||||
<CompositionContextWidget ctx={compCtx} onChange={setCompCtx} />
|
<CompositionContextWidget ctx={compCtx} onChange={setCompCtx} />
|
||||||
<RandomizerWidget
|
<RandomizerWidget
|
||||||
|
@ -330,7 +330,7 @@ export const CreaturePageWithDefaults: React.FC<
|
||||||
</div>
|
</div>
|
||||||
<div className="thingy">
|
<div className="thingy">
|
||||||
<NumericSlider
|
<NumericSlider
|
||||||
label="Random creature complexity"
|
label="Random cluster complexity"
|
||||||
min={0}
|
min={0}
|
||||||
max={MAX_COMPLEXITY_LEVEL}
|
max={MAX_COMPLEXITY_LEVEL}
|
||||||
step={1}
|
step={1}
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
import type { PageName } from ".";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the human-friendly page name of the given page, which we'd
|
||||||
|
* like to show to end-users.
|
||||||
|
*/
|
||||||
|
export function getFriendlyPageName(pageName: PageName): string {
|
||||||
|
if (pageName === "creature") return "cluster";
|
||||||
|
return pageName;
|
||||||
|
}
|
|
@ -16,6 +16,7 @@ import { createPageWithStateSearchParams } from "../page-with-shareable-state";
|
||||||
import { svgScale, SvgTransform } from "../svg-transform";
|
import { svgScale, SvgTransform } from "../svg-transform";
|
||||||
import { CreatureDesign } from "./creature-page/core";
|
import { CreatureDesign } from "./creature-page/core";
|
||||||
import { deserializeCreatureDesign } from "./creature-page/serialization";
|
import { deserializeCreatureDesign } from "./creature-page/serialization";
|
||||||
|
import { getFriendlyPageName } from "./friendly-page-names";
|
||||||
|
|
||||||
import "./gallery-page.css";
|
import "./gallery-page.css";
|
||||||
import {
|
import {
|
||||||
|
@ -128,7 +129,7 @@ const GalleryCompositionView: React.FC<GalleryComposition> = (props) => {
|
||||||
<a href={url} target="_blank">
|
<a href={url} target="_blank">
|
||||||
{props.title}
|
{props.title}
|
||||||
</a>{" "}
|
</a>{" "}
|
||||||
{props.kind} by {props.ownerName}
|
{getFriendlyPageName(props.kind)} by {props.ownerName}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
Ładowanie…
Reference in New Issue