This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Belt; | |
[@bs.deriving abstract] | |
type queryConfig('data, 'key, 'fnParamsFilter) = { | |
[@bs.optional] | |
retry: int, | |
[@bs.optional] | |
retryDelay: int, | |
[@bs.optional] | |
initialData: unit => 'data, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type viewport = ReactMapGL.viewport; | |
type datum = { | |
coordinates: array(float), | |
/**The following fields are custom. They're based on our nodes data */ | |
node_type: string, | |
region: string, | |
node_status: string, | |
id: string, | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[@bs.module "react-json-view"] [@react.component] | |
external make: (~src: 'a, ~label: string) => React.element = "default"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**To bind to formik we'll need to most likely use Js.Dict.t type to accomodate the variable property fields | |
* https://github.com/jaredpalmer/formik/blob/master/packages/formik/src/types.tsx | |
* Functors might also be an option: https://2ality.com/2018/01/functors-reasonml.html | |
*/ | |
type values('v) = 'v; | |
type errors('e) = 'e; | |
type touched('t) = 't; | |
type state('v, 'e, 't, 's) = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type dayjs; | |
[@bs.module] external dayjs: string => dayjs = "dayjs"; | |
[@bs.send] external format: (dayjs, string) => string = "format"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Css; | |
let defaultAnimationFrame = (position: int) => ( | |
position, | |
[transform(`scale((1.0, 1.0)))], | |
); | |
let loaderAnimation = | |
keyframes([ | |
defaultAnimationFrame(0), | |
defaultAnimationFrame(20), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[@bs.module "react"] | |
external useMemo8: | |
([@bs.uncurry] (unit => 'any), ('a, 'b, 'c, 'd, 'e, 'f, 'g, 'h)) => 'any = | |
"useMemo"; | |
[@bs.module "react"] | |
external useCallback4: | |
([@bs.uncurry] ('input => 'output), ('a, 'b, 'c, 'd)) => | |
React.callback('input, 'output) = | |
"useCallback"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type width = string; | |
type height = string; | |
type latitude = float; | |
type longitude = float; | |
type zoom = int; | |
type viewport = { | |
. | |
"width": width, | |
"height": height, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type formatUSDProps = { | |
amount: float, | |
decimalPlaces: int, | |
}; | |
[@bs.module] external formatUSDUtil: formatUSDProps => float = "format-usd"; | |
let format0 = amount => formatUSDUtil({amount, decimalPlaces: 0}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let handleEnterPressOnKeyDown = (event, callback) => { | |
ReactEvent.Synthetic.persist(event); | |
if (event->ReactEvent.Keyboard.which == 13 | |
|| event->ReactEvent.Keyboard.keyCode == 13) { | |
callback(); | |
}; | |
}; | |
let handleArrowUpPressOnKeyDown = (event, callback) => { | |
ReactEvent.Synthetic.persist(event); |