@colisweb/rescript-toolkit 1.30.0 → 1.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/ui/Toolkit__Ui_Layout.res +28 -13
package/package.json
CHANGED
|
@@ -23,6 +23,19 @@ module Footer = {
|
|
|
23
23
|
</footer>
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
module NavOpenContext = {
|
|
27
|
+
let context = React.createContext(false)
|
|
28
|
+
|
|
29
|
+
module Provider = {
|
|
30
|
+
let provider = React.Context.provider(context)
|
|
31
|
+
|
|
32
|
+
@react.component
|
|
33
|
+
let make = (~value, ~children) => {
|
|
34
|
+
React.createElement(provider, {"value": value, "children": children})
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
26
39
|
module App = {
|
|
27
40
|
let localStorageNavKey = "@colisweb/navOpen"
|
|
28
41
|
|
|
@@ -149,19 +162,21 @@ module App = {
|
|
|
149
162
|
|
|
150
163
|
let hideMenu = React.useCallback(_ => setOpen(_ => false))
|
|
151
164
|
|
|
152
|
-
<
|
|
153
|
-
<
|
|
154
|
-
|
|
155
|
-
<
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
className
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
165
|
+
<NavOpenContext.Provider value={isNavOpen}>
|
|
166
|
+
<div>
|
|
167
|
+
<TopNavigationBar username logout logoutLabel toggleMenu onLogoClick />
|
|
168
|
+
<div className="flex">
|
|
169
|
+
<LeftNavigationBar isNavOpen ?bottom hideMenu> sideNavRender </LeftNavigationBar>
|
|
170
|
+
<main
|
|
171
|
+
className={cx([
|
|
172
|
+
className,
|
|
173
|
+
"flex-initial w-full transition-all duration-300 ease-in-out mt-16 z-20",
|
|
174
|
+
isNavOpen ? "navOpen lg:pl-64" : "lg:pl-16",
|
|
175
|
+
])}>
|
|
176
|
+
children
|
|
177
|
+
</main>
|
|
178
|
+
</div>
|
|
164
179
|
</div>
|
|
165
|
-
</
|
|
180
|
+
</NavOpenContext.Provider>
|
|
166
181
|
}
|
|
167
182
|
}
|