Content.res
1open Preact
2
3// Content overlay close button, common to WaypointEdit, Login, etc.
4module CloseButton = {
5 @jsx.component
6 let make = (~onClose: option<unit => unit>=?) => {
7 <div className="text-gray-600 self-end w-fit cursor-pointer" title="Close">
8 <button
9 className="cursor-pointer"
10 onClick={_ => {
11 State.content->Signal.set(None)
12 switch onClose {
13 | Some(fn) => fn()
14 | None => ()
15 }
16 }}
17 >
18 <Icons.X />
19 </button>
20 </div>
21 }
22}