1
- export function Header ( ) {
1
+ import { useRef } from "preact/hooks" ;
2
+ export function Header ( ) {
3
+ const ref = useRef < HTMLDialogElement > ( ) ;
2
4
return (
3
5
< div class = "page-header" >
4
6
< h1 class = "page-header__headline" > Grδdient</ h1 >
7
+ < dialog
8
+ ref = { ref }
9
+ onCancel = { ( e ) => e . preventDefault ( ) }
10
+ class = "dialog dialog--about"
11
+ >
12
+ < div class = "dialog--header" >
13
+ < h2 > About OSM Gradient</ h2 >
14
+ < button
15
+ class = "dialog__close-button"
16
+ type = "button"
17
+ title = "Close Modal"
18
+ onClick = { ( ) => ref . current . close ( ) }
19
+ >
20
+ < svg
21
+ xmlns = "http://www.w3.org/2000/svg"
22
+ width = "24"
23
+ height = "24"
24
+ viewBox = "0 0 24 24"
25
+ fill = "none"
26
+ stroke = "currentColor"
27
+ stroke-width = "2"
28
+ stroke-linecap = "round"
29
+ stroke-linejoin = "round"
30
+ class = "feather feather-x"
31
+ >
32
+ < line x1 = "18" y1 = "6" x2 = "6" y2 = "18" />
33
+ < line x1 = "6" y1 = "6" x2 = "18" y2 = "18" />
34
+ </ svg >
35
+ </ button >
36
+ </ div >
37
+ < small >
38
+ Visualize OpenStreetMap features created, modified or deleted every hour
39
+ using change data prepared by OSMCha as a FlatGeobuf. This visualization
40
+ does not use a server.
41
+ </ small >
42
+ </ dialog >
43
+ < button
44
+ class = "dialog__open-button"
45
+ type = "button"
46
+ title = "Open Modal"
47
+ onClick = { ( ) => ref . current . showModal ( ) }
48
+ >
49
+ < svg
50
+ xmlns = "http://www.w3.org/2000/svg"
51
+ width = "24"
52
+ height = "24"
53
+ viewBox = "0 0 24 24"
54
+ fill = "none"
55
+ stroke = "currentColor"
56
+ stroke-width = "2"
57
+ stroke-linecap = "round"
58
+ stroke-linejoin = "round"
59
+ class = "feather feather-info"
60
+ >
61
+ < circle cx = "12" cy = "12" r = "10" />
62
+ < line x1 = "12" y1 = "16" x2 = "12" y2 = "12" />
63
+ < line x1 = "12" y1 = "8" x2 = "12.01" y2 = "8" />
64
+ </ svg >
65
+ About
66
+ </ button >
5
67
</ div >
6
- )
7
- }
68
+ ) ;
69
+ }
0 commit comments