Skip to content

Commit ec39581

Browse files
committed
starting to develop select column
1 parent 31f732f commit ec39581

File tree

3 files changed

+19
-114
lines changed

3 files changed

+19
-114
lines changed

pages/columns/+Page.client.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import { Divider, AnchorButton, Tag, Card, Collapse, Icon } from "@blueprintjs/c
44
import { useData } from "vike-react/useData";
55
import { useState } from "react";
66
import "./main.scss";
7-
import { hyperStyled } from "@macrostrat/hyper";
8-
import styles from "./index.module.sass";
7+
import h from "@macrostrat/hyper";
98
import {
109
MapAreaContainer,
1110
MapMarker,
@@ -21,9 +20,6 @@ import { navigate } from "vike/client/router";
2120
import { useMapRef } from "@macrostrat/mapbox-react";
2221
import { ColumnMap } from "../index";
2322

24-
const h = hyperStyled(styles);
25-
26-
2723
export function Page(props) {
2824
return h(ColumnListPage, props);
2925
}

pages/columns/index.module.sass

Lines changed: 0 additions & 108 deletions
This file was deleted.

pages/lex/intervals/@id/+Page.client.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import { ContentPage } from "~/layouts";
88
import { usePageContext } from 'vike-react/usePageContext';
99
import { titleCase } from "../../index";
1010
import { ColumnMap } from "../../../index";
11+
import { navigate } from "vike/client/router";
12+
import { useState, useCallback } from "react";
1113

1214
export function Page() {
1315
const pageContext = usePageContext();
@@ -85,18 +87,33 @@ function References({ id }) {
8587
}
8688

8789
function Map({id}) {
90+
const [selectedUnitID, setSelectedUnitID] = useState(null);
8891
const data = useAPIResult(SETTINGS.apiV2Prefix + "/columns?int_id=" + id + "&response=long&format=geojson")?.success.data;
8992

9093
if (!data) {
9194
return h("div", "Loading...");
9295
}
96+
97+
/*
98+
const onSelectColumn = useCallback(
99+
(col_id: number) => {
100+
// do nothing
101+
// We could probably find a more elegant way to do this
102+
setSelectedUnitID(null);
103+
navigate(`/columns/${col_id}`, {
104+
overwriteLastHistoryEntry: true,
105+
});
106+
},
107+
[setSelectedUnitID]
108+
);
109+
*/
93110

94111
return h("div.page-container", [
95112
h(ColumnMap, {
96113
className: "column-map",
97114
inProcess: true,
98115
projectID: null,
99-
selectedColumn: null,
116+
selectedColumn: selectedUnitID,
100117
onSelectColumn: () => {},
101118
columns: data.features,
102119
}),

0 commit comments

Comments
 (0)