11open ReactNative ;
2+ open ReactMultiversal ;
23
34let styles =
45 StyleSheet . create(
@@ -24,16 +25,16 @@ let styles =
2425 () ,
2526 ),
2627 "barWrapper" : style(~backgroundColor= Consts . Colors . dark, () ),
27- "logo " :
28+ "logoLink " :
2829 style(
29- ~flex = 1 .,
30- ~flexDirection = ` row ,
30+ ~flexGrow = 1 .,
31+ ~flexShrink = 1 . ,
3132 ~position= ` relative ,
3233 ~zIndex= 1 ,
33- ~paddingHorizontal= pt(10 . ),
34- ~alignItems= ` center ,
3534 () ,
3635 ),
36+ "logo" :
37+ style(~flexGrow= 1 ., ~flexDirection= ` row , ~alignItems= ` center , () ),
3738 "logoText" :
3839 style(
3940 ~fontSize= 18 .,
@@ -43,15 +44,16 @@ let styles =
4344 ),
4445 "links" :
4546 style(
46- ~flex= 1 .,
47+ ~flexGrow= 1 .,
48+ ~flexShrink= 1 .,
4749 ~flexDirection= ` row ,
50+ ~flexWrap= ` wrap ,
4851 ~justifyContent= ` center ,
4952 ~alignItems= ` center ,
5053 () ,
5154 ),
5255 "link" :
5356 style(
54- ~padding= pt(10 . ),
5557 ~fontSize= 18 .,
5658 ~lineHeight= 18 . *. 1 . 7 ,
5759 ~fontWeight= `_300 ,
@@ -65,7 +67,14 @@ let styles =
6567 () ,
6668 ),
6769 "icons" :
68- style(~flex= 1 ., ~flexDirection= ` row , ~justifyContent= ` flexEnd , () ),
70+ style(
71+ ~flexGrow= 1 .,
72+ ~flexShrink= 1 .,
73+ ~flexDirection= ` row ,
74+ ~flexWrap= ` wrap ,
75+ ~justifyContent= ` flexEnd ,
76+ () ,
77+ ),
6978 "icon" :
7079 style(
7180 ~display= ` flex ,
@@ -83,23 +92,28 @@ let styles =
8392[@ react . component ]
8493let make = (~currentLocation) => {
8594 <View style= styles##menu>
86- <Container style= styles##bar wrapperStyle= styles##barWrapper>
87- <ViewLink style= styles##logo href= {Consts . baseUrl ++ "/" }>
88- <SVGBsReactNative
89- width= {36 .-> ReactFromSvg . Size . pt}
90- height= {36 .-> ReactFromSvg . Size . pt}
91- fill= Consts . Colors . lightest
92- />
93- <Text style= styles##logoText>
94- {(" " ++ Consts . title)-> ReasonReact . string}
95- </Text >
95+ <Container
96+ maxWidth= {1000 .-> Style . pt}
97+ style= styles##bar
98+ wrapperStyle= styles##barWrapper>
99+ <ViewLink href= {Consts . baseUrl ++ "/" } style= styles##logoLink>
100+ <SpacedView style= styles##logo vertical= XS >
101+ <SVGBsReactNative
102+ width= {36 .-> ReactFromSvg . Size . pt}
103+ height= {36 .-> ReactFromSvg . Size . pt}
104+ fill= Consts . Colors . lightest
105+ />
106+ <Text style= styles##logoText>
107+ {(" " ++ Consts . title)-> ReasonReact . string}
108+ </Text >
109+ </SpacedView >
96110 </ViewLink >
97- <View style= styles##links>
111+ <SpacedView style= styles##links vertical = XS >
98112 {Consts . menuLinks
99113 -> Belt . Array . map(item => {
100114 let isActive =
101115 item. isActive(currentLocation## pathname, item. link);
102- <TextLink
116+ <ViewLink
103117 key= {item. link}
104118 href= {item. link}
105119 style= Style . (
@@ -108,12 +122,14 @@ let make = (~currentLocation) => {
108122 isActive ? Some (styles## linkActive) : None ,
109123 |] )
110124 )>
111- item.text-> React . string
112- </TextLink >;
125+ <SpacedView vertical= None horizontal= S >
126+ <Text > item.text-> React . string </Text >
127+ </SpacedView >
128+ </ViewLink >;
113129 })
114130 -> React . array}
115- </View >
116- <View style= styles##icons>
131+ </SpacedView >
132+ <SpacedView style= styles##icons vertical = XS >
117133 {Consts . socialLinks
118134 -> Belt . Array . map(item =>
119135 <ViewLink
@@ -125,11 +141,14 @@ let make = (~currentLocation) => {
125141 ~iconColor= Consts . Colors . light,
126142 ~iconSize= 22 .-> Svg . Size . pt,
127143 )}
128- <Text style= styles##link> item.name-> React . string </Text >
144+ <WindowSizeFilter . NotSmall >
145+ <Spacer size= XS />
146+ <Text style= styles##link> item.name-> React . string </Text >
147+ </WindowSizeFilter . NotSmall >
129148 </ViewLink >
130149 )
131150 -> ReasonReact . array}
132- </View >
151+ </SpacedView >
133152 </Container >
134153 </View >;
135154};
0 commit comments