File tree Expand file tree Collapse file tree 4 files changed +56
-0
lines changed Expand file tree Collapse file tree 4 files changed +56
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ const componentLoaders = [
7575 "Pagination" ,
7676 "Pill" ,
7777 "Progress" ,
78+ "Responsive" ,
7879 "Row" ,
7980 "Select" ,
8081 "Slider" ,
Original file line number Diff line number Diff line change 1+ module Lumi.Components.Examples.Responsive where
2+
3+ import Prelude
4+
5+ import Lumi.Components.Column (column_ )
6+ import Lumi.Components.Example (example )
7+ import Lumi.Components.Responsive (desktop , mobile )
8+ import Lumi.Components.Text (body_ , h2_ )
9+ import React.Basic (JSX )
10+
11+ docs :: JSX
12+ docs =
13+ column_ $
14+ [ h2_ " Desktop and mobile"
15+ , example $
16+ column_
17+ [ mobile $ body_ " Mobile: this text only is only visible on mobile-sized screens."
18+ , desktop $ body_ " Desktop: this text only is only visible on desktop-sized screens."
19+ ]
20+ ]
Original file line number Diff line number Diff line change 1+ module Lumi.Components.Responsive where
2+
3+ import Prelude
4+
5+ import JSS (JSS , jss )
6+ import React.Basic (JSX , element )
7+ import React.Basic.DOM (unsafeCreateDOMComponent )
8+
9+ mobile :: JSX -> JSX
10+ mobile = lumiMobileElement <<< { children: _ }
11+ where
12+ lumiMobileElement = element (unsafeCreateDOMComponent " lumi-mobile" )
13+
14+ desktop :: JSX -> JSX
15+ desktop = lumiDesktopElement <<< { children: _ }
16+ where
17+ lumiDesktopElement = element (unsafeCreateDOMComponent " lumi-desktop" )
18+
19+ styles :: JSS
20+ styles = jss
21+ { " @global" :
22+ { " @media (max-width: 860px)" :
23+ { " lumi-desktop" :
24+ { " display" : " none"
25+ }
26+ }
27+ , " @media (min-width: 861px)" :
28+ { " lumi-mobile" :
29+ { " display" : " none"
30+ }
31+ }
32+ }
33+ }
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ import Lumi.Components.NativeSelect as NativeSelect
3434import Lumi.Components.Navigation as Navigation
3535import Lumi.Components.Pagination as Pagination
3636import Lumi.Components.Pill as Pill
37+ import Lumi.Components.Responsive as Responsive
3738import Lumi.Components.Row as Row
3839import Lumi.Components.Select as Select
3940import Lumi.Components.Slider as Slider
@@ -87,6 +88,7 @@ attachGlobalComponentStyles = do
8788 , Navigation .styles
8889 , Pagination .styles
8990 , Pill .styles
91+ , Responsive .styles
9092 , Row .styles
9193 , Select .styles
9294 , Slider .styles
You can’t perform that action at this time.
0 commit comments