@@ -10,9 +10,20 @@ import mapboxgl from "mapbox-gl";
1010import { SETTINGS } from "@macrostrat-web/settings" ;
1111import { rockdApiURL , rockdApiOldURL } from "@macrostrat-web/settings" ;
1212import { useState } from "react" ;
13+ import { navigate } from "vike/client/router" ;
1314
1415export function Footer ( ) {
15- const isDarkMode = useDarkMode ( ) . isEnabled ;
16+ const footerLinks1 = [
17+ { href : "/" , icon : "home" , text : "Home" } ,
18+ { href : "/explore" , icon : "geosearch" , text : "Explore" } ,
19+ { href : "/trip/1" , icon : "route" , text : "Trip" } ,
20+ ] ;
21+
22+ const footerLinks2 = [
23+ { href : "/metrics" , icon : "chart" , text : "Metrics" } ,
24+ { href : "/terms" , icon : "manual" , text : "Terms and Conditions" } ,
25+ { href : "/privacy" , icon : "lock" , text : "Privacy" } ,
26+ ] ;
1627
1728 return h ( "div" , { className : "footer" } , [
1829 h ( "div" , { className : "titles" } , [
@@ -32,83 +43,32 @@ export function Footer() {
3243 ] ) ,
3344 ] ) ,
3445 h ( "div" , { className : "footer-links" } , [
35- h ( "ul" , [
36- h (
37- "li" ,
38- h ( "a" , { href : "/" } , [
39- h ( Icon , {
40- className : "footer-icon" + ( isDarkMode ? "icon-dark-mode" : "" ) ,
41- icon : "home" ,
42- style : { color : "white" } ,
43- } ) ,
44- h ( "p" , "Home" ) ,
45- ] )
46- ) ,
47- h (
48- "li" ,
49- h ( "a" , { href : "/explore" } , [
50- h ( Icon , {
51- className : "footer-icon" + ( isDarkMode ? "icon-dark-mode" : "" ) ,
52- icon : "geosearch" ,
53- style : { color : "white" } ,
54- } ) ,
55- h ( "p" , "Explore" ) ,
56- ] )
57- ) ,
58- h (
59- "li" ,
60- h ( "a" , { href : "/trip/1" } , [
61- h ( Icon , {
62- className : "footer-icon" + ( isDarkMode ? "icon-dark-mode" : "" ) ,
63- icon : "route" ,
64- style : { color : "white" } ,
65- } ) ,
66- h ( "p" , "Trip" ) ,
67- ] )
68- ) ,
69- ] ) ,
70- h ( "ul" , [
71- h (
72- "li" ,
73- h ( "a" , { href : "/metrics" } , [
74- h ( Icon , {
75- className : "footer-icon" + ( isDarkMode ? "icon-dark-mode" : "" ) ,
76- icon : "chart" ,
77- style : { color : "white" } ,
78- } ) ,
79- h ( "p" , "Metrics" ) ,
80- ] )
81- ) ,
82- h (
83- "li" ,
84- h ( "a" , { href : "/terms" } , [
85- h ( Icon , {
86- className : "footer-icon" + ( isDarkMode ? "icon-dark-mode" : "" ) ,
87- icon : "manual" ,
88- style : { color : "white" } ,
89- } ) ,
90- h ( "p" , "Terms and Conditions" ) ,
91- ] )
92- ) ,
93- h (
94- "li" ,
95- h ( "a" , { href : "/privacy" } , [
96- h ( Icon , {
97- className : "footer-icon" + ( isDarkMode ? "icon-dark-mode" : "" ) ,
98- icon : "lock" ,
99- style : { color : "white" } ,
100- } ) ,
101- h ( "p" , "Privacy" ) ,
102- ] )
103- ) ,
104- ] ) ,
46+ h ( "ul" , footerLinks1 . map ( ( props ) => h ( FooterLink , props ) ) ) ,
47+ h ( "ul" , footerLinks2 . map ( ( props ) => h ( FooterLink , props ) ) ) ,
10548 ] ) ,
10649 h ( "div.dark-mode" , [
10750 h ( DarkModeButton , { className : "dark-mode-button" , showText : true } ) ,
10851 ] ) ,
10952 ] ) ;
11053}
11154
55+ function FooterLink ( { href, icon, text } ) {
56+ const isDarkMode = useDarkMode ( ) . isEnabled ;
57+
58+ return h ( "li" , { onClick : ( e ) => {
59+ e . preventDefault ( ) ;
60+ window . open ( href , "_self" ) ;
61+ } } , [
62+ h ( Icon , {
63+ className : "footer-icon" ,
64+ icon,
65+ style : { color : isDarkMode ? "black" : "white" } ,
66+ } ) ,
67+ h ( "p" , text ) ,
68+ ] ) ;
69+ }
70+
71+
11272export function Image ( props : ImageProps ) {
11373 const { src, className, width, height, onClick, alt } = props
11474 const [ hasError , setHasError ] = useState ( false ) ;
0 commit comments