-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathLink.example.purs
37 lines (35 loc) · 1.08 KB
/
Link.example.purs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
module Lumi.Components.Examples.Link where
import Prelude
import Data.Maybe (Maybe(..))
import Effect.Console (log)
import Effect.Uncurried (mkEffectFn1)
import Lumi.Components.Column (column_)
import Lumi.Components.Link (link, defaults)
import Lumi.Components.Text (body_)
import Lumi.Components.Example (example)
import React.Basic.Classic (JSX)
import React.Basic.DOM as R
import Web.HTML.History (URL(..))
docs :: JSX
docs =
column_
[ example
$ R.div
{ onClick: mkEffectFn1 \_ -> log "Propagated"
, style: R.css { display: "flex", flexDirection: "column" }
, children:
[ link
defaults
{ href = URL "#/link"
, navigate = pure $ log "link clicked"
, text = body_ "Click here"
}
, link
defaults
{ href = URL "#/input"
, target = Just "_blank"
, text = body_ "This should open in a new tab"
}
]
}
]