-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUtils.re
25 lines (21 loc) · 899 Bytes
/
Utils.re
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
external toJson: 'a => Js.Json.t = "%identity";
/** material ui */
let spacingPx = (ind, theme) =>
theme->MaterialUi.Theme.Theme.spacingGet(ind);
let getInputValue = (e): string => ReactEvent.Form.target(e)##value;
let getBreakpoint = (breakpoint, theme) => {
let muiBreakpoint =
switch (breakpoint) {
| `XS => "xs"->MaterialUi.ThemeHelpers.stringToBreakpoint
| `SM => "sm"->MaterialUi.ThemeHelpers.stringToBreakpoint
| `MD => "md"->MaterialUi.ThemeHelpers.stringToBreakpoint
| `LG => "lg"->MaterialUi.ThemeHelpers.stringToBreakpoint
| `XL => "xl"->MaterialUi.ThemeHelpers.stringToBreakpoint
| `Int(x) => x->MaterialUi.ThemeHelpers.intToBreakpoint
};
theme
->MaterialUi.ThemeHelpers.Theme.breakpointsGet
->MaterialUi.ThemeHelpers.Breakpoints.upGet
->MaterialUi.ThemeHelpers.jsonToBreakpointFunc(muiBreakpoint)
|> Js.String.replace("@media", "");
};