Skip to content

Commit 4b150eb

Browse files
committed
website: make header looks better on small screen
1 parent e1371e6 commit 4b150eb

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

website/src/Consts.re

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
let baseUrl = "/reason-react-native";
22
let title = {j|Reason React Native|j};
3+
let titleShort = {j|RRN|j};
34
let defaultTitle = title ++ {j|, Reason bindings for React Native.|j};
45
let titleTemplate = {j|%s - |j} ++ title;
56

website/src/components/HeaderLarge.re

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,25 @@ let make = (~currentLocation) => {
101101
style=styles##bar
102102
wrapperStyle=styles##barWrapper>
103103
<ViewLink href={Consts.baseUrl ++ "/"} style=styles##logoLink>
104-
<SpacedView style=styles##logo vertical=XS>
104+
<SpacedView style=styles##logo vertical=XS horizontal=XS>
105105
<SVGBsReactNative
106106
width={36.->ReactFromSvg.Size.pt}
107107
height={36.->ReactFromSvg.Size.pt}
108108
fill=Consts.Colors.lightest
109109
/>
110-
<Text style=styles##logoText>
111-
{(" " ++ Consts.title)->ReasonReact.string}
112-
</Text>
110+
<WindowSizeFilter.Small>
111+
<Text style=styles##logoText>
112+
{(" " ++ Consts.titleShort)->ReasonReact.string}
113+
</Text>
114+
</WindowSizeFilter.Small>
115+
<WindowSizeFilter.NotSmall>
116+
<Text style=styles##logoText>
117+
{(" " ++ Consts.title)->ReasonReact.string}
118+
</Text>
119+
</WindowSizeFilter.NotSmall>
113120
</SpacedView>
114121
</ViewLink>
115-
<SpacedView style=styles##links vertical=XS>
122+
<SpacedView style=styles##links vertical=XS horizontal=XS>
116123
{Consts.menuLinks
117124
->Belt.Array.map(item => {
118125
let isActive =
@@ -133,7 +140,7 @@ let make = (~currentLocation) => {
133140
})
134141
->React.array}
135142
</SpacedView>
136-
<SpacedView style=styles##search vertical=XS>
143+
<SpacedView style=styles##search vertical=XS horizontal=XS>
137144
<input
138145
id="SearchInput"
139146
placeholder="Search"
@@ -147,7 +154,7 @@ let make = (~currentLocation) => {
147154
)}
148155
/>
149156
</SpacedView>
150-
<SpacedView style=styles##icons vertical=XS>
157+
<SpacedView style=styles##icons vertical=XS horizontal=XS>
151158
{Consts.socialLinks
152159
->Belt.Array.map(item =>
153160
<ViewLink

0 commit comments

Comments
 (0)