@@ -26,30 +26,35 @@ docs = flip element {} $ withRouter $ toReactComponent identity component { rend
2626 column_
2727 [ h2_ " Demo 1"
2828 , example $
29- tabs
30- { currentLocation: URL $ " #" <> props.location.pathname <> props.location.search <> props.location.hash
31- , useHash: true
32- , navigate: Just \url ->
33- let
34- parts = urlParts url
35- newUrl = parts.path <> parts.query <> parts.hash.path <> parts.hash.query
36- newUrlNoHash = fromMaybe " " $ flip index 1 $ split (Pattern " #" ) newUrl
37- in
38- runEffectFn1 props.history.push $ URL $ newUrlNoHash
39- , queryKey: TabKey " demo1"
40- , style: R .css {}
41- , tabStyle: R .css {}
42- , selectedTabStyle: R .css {}
43- , tabs: 1 .. 6 <#> \i ->
44- let
45- label = " Tab with a long title " <> show i
46- in
47- { content: \_ -> empty
48- , id: TabId (toLower label)
49- , label
50- , count: (7 *(i - 1 ) * (i - 1 ) `mod` 4) * 7 <$ guard (i `mod` 3 /= 1 )
51- , testId: Nothing
52- }
29+ R .div
30+ { style: R .css { maxWidth: " 800px" }
31+ , children:
32+ [ tabs
33+ { currentLocation: URL $ " #" <> props.location.pathname <> props.location.search <> props.location.hash
34+ , useHash: true
35+ , navigate: Just \url ->
36+ let
37+ parts = urlParts url
38+ newUrl = parts.path <> parts.query <> parts.hash.path <> parts.hash.query
39+ newUrlNoHash = fromMaybe " " $ flip index 1 $ split (Pattern " #" ) newUrl
40+ in
41+ runEffectFn1 props.history.push $ URL $ newUrlNoHash
42+ , queryKey: TabKey " demo1"
43+ , style: R .css {}
44+ , tabStyle: R .css {}
45+ , selectedTabStyle: R .css {}
46+ , tabs: 1 .. 10 <#> \i ->
47+ let
48+ label = " Tab with a long title " <> show i
49+ in
50+ { content: \_ -> empty
51+ , id: TabId (toLower label)
52+ , label
53+ , count: (7 *(i - 1 ) * (i - 1 ) `mod` 4) * 7 <$ guard (i `mod` 3 /= 1 )
54+ , testId: Nothing
55+ }
56+ }
57+ ]
5358 }
5459
5560 , h2_ " Demo 2"
0 commit comments