-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathNavigation.example.purs
106 lines (102 loc) · 3.05 KB
/
Navigation.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
module Lumi.Components.Examples.Navigation where
import Prelude
import Data.Maybe (Maybe(..))
import Data.NonEmpty ((:|))
import Effect.Console (log)
import Lumi.Components.Column (column_)
import Lumi.Components.Example (example)
import Lumi.Components.Navigation (navigation)
import Lumi.Components.Text (h2_)
import React.Basic.Classic (JSX)
import Web.HTML.History (URL(..))
docs :: JSX
docs =
column_
[ h2_ "Compact navigation"
, example $
navigation
{ navLinks:
{ text: "Home"
, href: URL "/"
, subNavLinks: []
} :|
[ { text: "Customers"
, href: URL "/customers"
, subNavLinks: []
}
, { text: "Products"
, href: URL "/products"
, subNavLinks:
[ { text: "Products"
, href: URL "/products"
}
, { text: "Categories"
, href: URL "/categories"
}
]
}
, { text: "Orders"
, href: URL "/orders"
, subNavLinks: []
}
, { text: "Help"
, href: URL "/help"
, subNavLinks: []
}
]
, user:
{ src: "https://s3.amazonaws.com/lumi-flapjack-staging/avatars/vfhpnqairr/thumbnail_1517878176349.png"
, name: Just "Flexo"
, email: Just "[email protected]"
, id: "flexo-1234"
}
, client:
{ name: Nothing
}
, compact: true
, onCartClick: Nothing
, cartAmount: Nothing
, onLogoutClick: Just $ log "logout click"
, logo: mempty
}
, h2_ "Responsive navigation"
, example $
navigation
{ navLinks:
{ text: "Items"
, href: URL "/items"
, subNavLinks: []
} :|
[ { text: "Orders"
, href: URL "/orders"
, subNavLinks: []
}
, { text: "Shipments"
, href: URL "/shipments"
, subNavLinks: []
}
, { text: "Billing"
, href: URL "/billing"
, subNavLinks: []
}
, { text: "Shop"
, href: URL "/shop"
, subNavLinks: []
}
]
, user:
{ src: "https://s3.amazonaws.com/lumi-flapjack-staging/avatars/vfhpnqairr/thumbnail_1517878176349.png"
, name: Just $ "Flexo"
, email: Just $ "[email protected]"
, id: "flexo-1234"
}
, client:
{ name: Just "Lumi"
}
, compact: false
, onCartClick: Just $ log "cart click"
, cartAmount: Just 2
, onLogoutClick: Just $ log "logout click"
, logo: mempty
}
]