on master help sign in
id: hide parent on galaxy pages
commit0458f071ce890a2aac1b65785473b3f7338adec8 authorMatilde Park <matilde.park@urbit.org> dateSat 23 Apr 2022, 20:35 (5 years ago) parent1b17a1d
1 file changed+12−6
pages/id/[id].js+12−6
pages/id/[id].js+12−6
@@ -19,11 +19,15 @@ const IdPage = ({ data, markdown, network, params }) => {
1919 return <ErrorPage />;
2020 }
2121
22+ // Parent ID, grabbed from network or fallback to the default sponsor for that node
2223 const parent = network ? network.sponsor["urbit-id"] : ob.sein(id);
24+ // Galaxy name above that parent
2325 const galaxy =
2426 ob.clan(id) === "planet"
2527 ? network?.sponsor?.sponsor?.["urbit-id"] || ob.sein(parent)
2628 : null;
29+ // Galaxies shouldn't show parents, so store it as boolean here for reference.
30+ const isGalaxy = ob.clan(id) === "galaxy";
2731
2832 return (
2933 <Container>
@@ -65,12 +69,14 @@ const IdPage = ({ data, markdown, network, params }) => {
6569 {network ? "Spawned/Owned" : "Unspawned"}
6670 </p>
6771 </div>
68− <div className="flex flex-col">
69− <p className="font-bold text-wall-400">Parent</p>
70− <Link href={`/id/${parent}`}>
71− <a className="type-ui font-mono text-green-400">{parent}</a>
72− </Link>
73− </div>
72+ {!isGalaxy && (
73+ <div className="flex flex-col">
74+ <p className="font-bold text-wall-400">Parent</p>
75+ <Link href={`/id/${parent}`}>
76+ <a className="type-ui font-mono text-green-400">{parent}</a>
77+ </Link>
78+ </div>
79+ )}
7480 {galaxy && (
7581 <div className="flex flex-col">
7682 <p className="font-bold text-wall-400">Galaxy</p>