Skip to content

Commit 9c1d066

Browse files
committed
feat: overhaul header, persistent display, etc
1 parent a439744 commit 9c1d066

File tree

1 file changed

+30
-24
lines changed
  • app/components/Home/components/Section/components/SectionViz

1 file changed

+30
-24
lines changed

app/components/Home/components/Section/components/SectionViz/NodeDetails.tsx

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import React from "react";
2+
import { Link as DXLink } from "@databiosphere/findable-ui/lib/components/Links/components/Link/link";
23
import { TaxonomyNode } from "./data";
34
import { HierarchyNode } from "d3";
45
import { RoundedPaper } from "@databiosphere/findable-ui/lib/components/common/Paper/paper.styles";
5-
import { ChevronRightRounded, ArrowBackRounded } from "@mui/icons-material";
6+
import {
7+
ChevronRightRounded,
8+
ArrowBackRounded,
9+
ViewListOutlined,
10+
} from "@mui/icons-material";
611

712
// Define additional properties used by D3 during transitions
813
interface D3TransitionNode {
@@ -146,6 +151,17 @@ export const NodeDetails: React.FC<NodeDetailsProps> = ({
146151

147152
// Create the filter URL for this node if possible
148153
const filterUrl = createFilterUrl(nodeRank, nodeName);
154+
// Fallback URL to the main assemblies page
155+
const linkUrl = filterUrl || "/data/assemblies";
156+
157+
// Create the appropriate display text based on node type
158+
let filterLinkText = "Browse All Assemblies";
159+
if (!isRoot) {
160+
const assemblyCount = countLeafNodes(node);
161+
const assemblySuffix = assemblyCount > 1 ? "ies" : "y";
162+
filterLinkText = `View ${assemblyCount} Assembl${assemblySuffix} for ${nodeName}`;
163+
}
164+
149165

150166
return (
151167
<div
@@ -158,29 +174,19 @@ export const NodeDetails: React.FC<NodeDetailsProps> = ({
158174
>
159175
<div style={{ flex: "1", marginTop: "20px" }}>
160176
<RoundedPaper>
161-
{/* View Assemblies Row - Always visible within the card */}
162-
{!isRoot && filterUrl ? (
163-
<div
164-
style={{
165-
borderBottom: "1px solid #eee",
166-
padding: "12px 16px",
167-
}}
168-
>
169-
<a
170-
href={filterUrl}
171-
rel="noopener noreferrer"
172-
style={{
173-
color: "#1976d2",
174-
display: "block",
175-
fontSize: "14px",
176-
textDecoration: "none",
177-
}}
178-
>
179-
View {countLeafNodes(node)} Assembl
180-
{countLeafNodes(node) > 1 ? "ies" : "y"} for {nodeName}
181-
</a>
182-
</div>
183-
) : null}
177+
<div
178+
style={{
179+
alignItems: "center",
180+
borderBottom: "1px solid #e0e0e0",
181+
borderTopLeftRadius: "8px",
182+
borderTopRightRadius: "8px",
183+
display: "flex",
184+
padding: "12px 16px",
185+
}}
186+
>
187+
<ViewListOutlined style={{ marginRight: "8px" }} />
188+
<DXLink label={filterLinkText} url={linkUrl} />
189+
</div>
184190

185191
<div
186192
style={{

0 commit comments

Comments
 (0)