Skip to content

Commit 4a4fd16

Browse files
authored
Merge pull request #107 from UW-Macrostrat/unit-details-panel
Unit details panel clicking
2 parents a7c48a0 + 8335f37 commit 4a4fd16

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

packages/column-views/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format
44
is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this
55
project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [2.1.2] - 2025-06-26
8+
9+
- UnitDetailsPanel strat name and interval now clickable
10+
711
## [2.1.1] - 2025-06-26
812

913
- Remove local reference

packages/column-views/src/unit-details/panel.module.sass

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,5 @@
8080
.sep
8181
margin: 0 0.3em
8282

83+
.clickable
84+
cursor: pointer

packages/column-views/src/unit-details/panel.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,14 @@ function UnitDetailsContent({
255255
{
256256
label: "Stratigraphic name",
257257
},
258-
h("span.strat-name-id", unit.strat_name_id),
258+
h(
259+
"span",
260+
{
261+
className: "strat-name-id" + (onClickItem ? " clickable" : ""),
262+
onClick: (e) => onClickItem(e, { strat_name_id: unit.strat_name_id }),
263+
},
264+
unit.strat_name_id,
265+
),
259266
),
260267
outcropField,
261268
h.if(features.has(UnitDetailsFeature.AdjacentUnits))([
@@ -531,7 +538,7 @@ function IntervalProportions({ unit, onClickItem }) {
531538

532539
const handleClick = (event: MouseEvent) => {
533540
if (onClickItem) {
534-
onClickItem({ event, data: interval0 });
541+
onClickItem(event, interval0);
535542
}
536543
};
537544

packages/column-views/stories/unit-details.stories.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ function UnitDetailsExt({
3333

3434
return h(
3535
LithologiesProvider,
36-
h(UnitDetailsPanel, { onClickItem: (e) => console.log(e), unit, ...rest }),
36+
h(UnitDetailsPanel, {
37+
onClickItem: (e, data) => console.log(data),
38+
unit,
39+
...rest,
40+
}),
3741
);
3842
}
3943

0 commit comments

Comments
 (0)