Last active
May 24, 2020 13:55
-
-
Save alex35mil/4c4cfdbba432c696c8e2e70fe201c45a to your computer and use it in GitHub Desktop.
FCM
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
<TextField | |
icon=(module IconOk) | |
value | |
onChange=change | |
/> |
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
module type Component = { | |
[@react.component] | |
let make: (~color: Color.t, ~className: string=?) => React.element; | |
}; | |
[@react.component] | |
let make = (~className="", ~children) => { | |
<Svg className={...}> | |
children | |
</Svg> | |
}; |
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
[@react.component] | |
let make = (~color, ~className=?) => { | |
<Icon size ?className> | |
<path fill={color->Icon.Color.toString} /> | |
</Icon> | |
}; |
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
[@react.component] | |
let make = | |
( | |
~value: string, | |
~icon: option(module Icon.Component)=?, | |
~onChange: option(ReactEvent.Form.t => unit)=?, | |
) => | |
<> | |
<input value ?onChange /> | |
{ | |
switch (icon) { | |
| Some(icon) => | |
let (module Icon) = icon; | |
<Icon color={...} />; | |
| None => React.null | |
} | |
} | |
</>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment