Skip to content

Commit f5e718a

Browse files
authored
Merge pull request #282 from UW-Macrostrat/david-updates
Site Updates
2 parents 9276bba + ad2934e commit f5e718a

File tree

36 files changed

+667
-386
lines changed

36 files changed

+667
-386
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"@macrostrat/api-types": "^1.1.0",
6767
"@macrostrat/color-utils": "^1.1.0",
6868
"@macrostrat/column-components": "^1.1.0",
69-
"@macrostrat/column-views": "^2.0.0",
69+
"@macrostrat/column-views": "^2.0.1",
7070
"@macrostrat/data-components": "^0.1.0",
7171
"@macrostrat/data-sheet": "^2.0.2",
7272
"@macrostrat/feedback-components": "^1.0.1",

packages/sift/src/js/index.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,17 @@ function SiftRouter() {
111111
}
112112

113113
class App extends React.Component {
114+
componentDidMount() {
115+
const { pathname, hash } = window.location;
116+
117+
if (
118+
(pathname === "/sift" || pathname === "/sift/") &&
119+
hash.startsWith("#/")
120+
) {
121+
const cleanPath = hash.replace("#", "");
122+
window.location.replace(`/sift${cleanPath}`);
123+
}
124+
}
114125
constructor(props) {
115126
super(props);
116127
this.state = {

pages/+Page.ts renamed to pages/+Page.client.ts

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export function Page() {
1919
]),
2020
]),
2121
h("div.buttons", [
22-
// h(LinkCard, { title: 'Search', href: '/sift/#/' }),
2322
h(LinkCard, { title: "Geologic Map", href: "/map/#3/40.78/-94.13" }, [
2423
h("p", { className: "long" }, [
2524
h("div.temp", {}, [
@@ -62,22 +61,17 @@ export function Page() {
6261
h(LinkCard, { title: "Projects", href: "/projects" }, [
6362
h("p", "Projects for specific regions or geological problems"),
6463
]),
65-
h(
66-
LinkCard,
67-
{
68-
title: h("h3", [
69-
h(Image, {
70-
className: "rockd-png",
71-
src: "rockd.png",
72-
width: "22px",
73-
height: "22px",
74-
}),
75-
h("span", " Rockd"),
76-
]),
77-
href: "https://rockd.org",
78-
},
79-
h("p", "Go mobile!")
80-
),
64+
h(LinkCard, { title: "Rockd", href: "https://rockd.org" }, [
65+
h("h3.rock-info", [
66+
h(Image, {
67+
className: "rockd-png",
68+
src: "rockd.png",
69+
width: "22px",
70+
height: "22px",
71+
}),
72+
h("span", " Go Mobile!"),
73+
]),
74+
]),
8175
h(
8276
LinkCard,
8377
{ title: "Documentation", href: "/docs" },

pages/+Page.module.sass

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
.nohighlight
22
color: white
33

4-
.main-navbar
5-
width: 100%
6-
margin: 1em 0 2em
7-
display: flex
8-
flex-direction: row
9-
gap: 1em
10-
114
.start
125
width: 100%
136
display: flex
@@ -54,7 +47,6 @@
5447

5548
.cover-image
5649
position: absolute
57-
z-index: 5
5850
left: 0px
5951
top: 0px
6052
height: 50vh
@@ -113,6 +105,8 @@
113105
flex-direction: column
114106
width: 100%
115107
padding: 0 20%
108+
border-top: 2px solid var(--text-emphasized-color)
109+
border-bottom: 2px solid var(--text-emphasized-color)
116110

117111
.country_container
118112
height: 100vh
@@ -415,3 +409,8 @@
415409

416410
.hide
417411
display: none
412+
413+
.rock-info
414+
display: flex
415+
align-items: center
416+
gap: .5em

pages/_error/+Page.ts

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import h from "./main.module.styl";
22
import { CenteredContentPage } from "~/layouts";
3-
import { PageHeader } from "~/components";
3+
import { Link, PageHeader } from "~/components";
44
import { usePageContext } from "vike-react/usePageContext";
55
import { ClientOnly } from "vike-react/ClientOnly";
66
import { Spinner, Button, Card } from "@blueprintjs/core";
@@ -10,17 +10,6 @@ import { LinkCard } from "~/components";
1010
export function Page() {
1111
const ctx = usePageContext();
1212
const is404 = ctx.is404;
13-
14-
return h(CenteredContentPage, [h(PageHeader), h(PageContent)]);
15-
}
16-
17-
function PageContent() {
18-
const ctx = usePageContext();
19-
const is404 = ctx.is404;
20-
const path = ctx.urlPathname;
21-
const statusCode = ctx.abortStatusCode;
22-
const reason = ctx.abortReason;
23-
2413
if (is404) {
2514
return h("div.error404", [
2615
h(BlankImage, {
@@ -34,15 +23,27 @@ function PageContent() {
3423
h("h2", "The rock you are looking for doesn't exist. Keep digging."),
3524
h("div.buttons", [
3625
h(
37-
"button",
26+
LinkCard,
3827
{ className: "btn", onClick: () => history.back() },
3928
"Go back"
4029
),
41-
h("a", { className: "btn", href: "/" }, "Go home"),
30+
h(LinkCard, { className: "btn", href: "/" }, "Go home"),
4231
]),
4332
]),
4433
]);
45-
} else if (statusCode == 401) {
34+
}
35+
36+
return h(CenteredContentPage, [h(PageHeader), h(PageContent)]);
37+
}
38+
39+
function PageContent() {
40+
const ctx = usePageContext();
41+
const is404 = ctx.is404;
42+
const path = ctx.urlPathname;
43+
const statusCode = ctx.abortStatusCode;
44+
const reason = ctx.abortReason;
45+
46+
if (statusCode == 401) {
4647
return h([
4748
h("h1", [h("code.bp5-code", "401"), " Unauthorized"]),
4849
h("p", [reason]),

pages/about/+Page.client.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import { Image, Navbar, Footer } from "../index";
22
import { Divider } from "@blueprintjs/core";
33
import h from "./main.module.sass";
4+
import { ContentPage } from "~/layouts";
45

56
export function Page() {
67
return h("div", [
78
h(Navbar),
8-
h("div.body", [
9+
h(ContentPage, [
910
h("h1.title-about", "About Macrostrat"),
10-
h(Divider, { className: "divider", style: { margin: "0 0 0 20%" } }),
11+
h(Divider, { className: "divider" }),
1112
h("div.table", [
1213
h("dv.table-row", [
1314
h("p", "Summary"),
@@ -71,7 +72,7 @@ export function Page() {
7172

7273
h("a", { href: "https://rockd.org" }, [
7374
h("div.app-box", [
74-
h(Image, { src: "rockd.jpg" }),
75+
h(Image, { src: "rockd.png" }),
7576
h("div.app-background-text", [
7677
"Rockd",
7778
h("p.blurb", "A mobile field book, Macrostrat style."),

pages/about/main.module.sass

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
h1
22
margin: 0
33

4-
.body
5-
padding-top: 5vh
6-
74
.apps
85
padding: 75px 0
96

@@ -18,8 +15,6 @@ a:hover
1815
.app-box
1916
height: 15vh
2017
display: flex
21-
width: 60%
22-
margin: 0 20%
2318
position: relative
2419
color: var(--text-color)
2520

@@ -46,23 +41,18 @@ a:hover
4641
font-family: "Maven Pro", sans-serif
4742
text-align: center
4843
background-color: #4BABBf
49-
width: 60%
50-
margin: 0 20%
5144
color: white
5245

5346

5447
.title-about
5548
font-size: 72px
5649
font-family: "Maven Pro", sans-serif
5750
text-align: left
58-
margin-left: 20%
5951
padding: 0
6052

6153

6254
.api
6355
height: 200px
64-
width: 60%
65-
margin-left: 20%
6656

6757
.api-circle
6858
float: left
@@ -114,17 +104,13 @@ a:hover
114104
position: relative
115105
padding-bottom: 0
116106

117-
.divider
118-
width: 60%
119-
background-color: black
120-
121107
.rock-border
122108
width: 100%
123109
margin: 0
124110
padding: 0
125111

126112
.table
127-
margin: 30px 20%
113+
margin: 30px 0
128114
.table-row
129115
display: grid
130116
grid-template-columns: 40% 60%

pages/columns/+Page.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ import {
55
PageBreadcrumbs,
66
StickyHeader,
77
} from "~/components";
8-
import { AnchorButton, ButtonGroup, InputGroup } from "@blueprintjs/core";
8+
import { AnchorButton, ButtonGroup, Card } from "@blueprintjs/core";
99
import { Tag } from "@macrostrat/data-components";
1010
import { useState } from "react";
1111
import h from "./main.module.sass";
1212
import { useData } from "vike-react/useData";
1313
import { ClientOnly } from "vike-react/ClientOnly";
1414
import { navigate } from "vike/client/router";
15+
import { SearchBar } from "../index";
1516

1617
export function Page(props) {
1718
return h(ColumnListPage, props);
@@ -74,15 +75,10 @@ function ColumnListPage({ title = "Columns", linkPrefix = "/" }) {
7475
h("div.main", [
7576
h(StickyHeader, [
7677
h(PageBreadcrumbs, { showLogo: true }),
77-
h("div.search-bar", [
78-
h(InputGroup, {
79-
placeholder: "Search columns...",
80-
onValueChange: handleInputChange,
81-
leftIcon: "search",
82-
large: true,
83-
fill: true,
84-
}),
85-
]),
78+
h(SearchBar, {
79+
placeholder: "Search columns...",
80+
onChange: handleInputChange,
81+
}),
8682
]),
8783
h(
8884
"div.column-groups",

pages/columns/@column/column-inspector/modal-panel.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,8 @@ export function ModalUnitPanel(props) {
5656
onSelectUnit,
5757
columnUnits: unitData,
5858
features,
59+
onClickItem: (unit) => {
60+
console.log("Clicked unit:", unit);
61+
},
5962
});
6063
}

pages/dev/test-site/+config.ts

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

0 commit comments

Comments
 (0)