-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathPagination.example.purs
57 lines (50 loc) · 1.63 KB
/
Pagination.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
module Lumi.Components.Examples.Pagination where
import Prelude
import Data.Maybe (Maybe(..))
import Lumi.Components.Column (column_)
import Lumi.Components.Pagination (defaults, pagination)
import Lumi.Components.Example (example)
import React.Basic.Classic (JSX, createComponent, make)
import React.Basic.DOM as R
docs :: JSX
docs = unit # make (createComponent "PaginationExample")
{ initialState
, render
}
where
initialState =
{ currentPage: 0
}
render self =
column_ $
[ example
$ pagination defaults
{ currentPage = self.state.currentPage
, pages = 53
, onChange = self.setState <<< flip _{ currentPage = _ }
, details = Just $ R.text "531 results"
}
, example
$ pagination defaults
{ currentPage = self.state.currentPage
, pages = 4
, onChange = self.setState <<< flip _{ currentPage = _ }
, details = Just $ R.text "40 results"
}
, example
$ pagination defaults
{ currentPage = self.state.currentPage
, pages = 0
, onChange = self.setState <<< flip _{ currentPage = _ }
, details = Just $ R.text "0 results"
}
, example
$ pagination defaults
{ currentPage = self.state.currentPage
, pages = 40
, onChange = self.setState <<< flip _{ currentPage = _ }
, focusWindow = 4
, marginPages = 3
, details = Just $ R.text "408 results"
}
]