commit 0b7b65cf5e8857c33a57110eb0bfce2f9c7576b6 parent 53f64308ed4a5070e64be71fe6bcc7d49797209b Author: Yohanes Bandung <bandungpenting@gmail.com> Date: Sun, 18 Aug 2019 22:10:51 +0700 feature(CurViScene) => completed curviscene links Diffstat:
| M | build/index.html | | | 2 | +- |
| M | src/CurViScene.re | | | 16 | ++++++++++++++-- |
| M | src/Styled.re | | | 15 | ++++++++++++--- |
| A | src/Template.re | | | 12 | ++++++++++++ |
4 files changed, 39 insertions(+), 6 deletions(-)
diff --git a/build/index.html b/build/index.html @@ -2,7 +2,7 @@ <html lang="en"> <head> <meta charset="UTF-8"> - <title>ReasonReact Examples</title> + <title>YBBond</title> </head> <body> diff --git a/src/CurViScene.re b/src/CurViScene.re @@ -91,7 +91,14 @@ let make = () => { }, { variant: Default, - text: <span> {ReasonReact.string("Jakarta, Indonesia")} </span>, + text: + <span> + {ReasonReact.string("from ")} + <Link + href="https://goo.gl/maps/gMGbA5juGAx" + text="Jakarta, Indonesia" + /> + </span>, }, |] />; @@ -109,7 +116,12 @@ let make = () => { { variant: Default, text: - <span> {ReasonReact.string("bandungpenting@gmail.com")} </span>, + <span> + <Link + href="mailto:bandungpenting@gmail.com" + text="bandungpenting@gmail.com" + /> + </span>, }, { variant: Default, diff --git a/src/Styled.re b/src/Styled.re @@ -1,5 +1,10 @@ open Utils; +module Styles = { + open Css; + let toggler = style([cursor(`pointer), userSelect(`none)]); +}; + type state = {dark: bool}; type action = | ToggleDark; @@ -69,8 +74,12 @@ body { <React.Fragment> <style dangerouslySetInnerHTML={dangerousHtml(setStyle)} /> - <button onClick={_ => dispatch(ToggleDark)}> - {ReasonReact.string("hai")} - </button> + <div onClick={_ => dispatch(ToggleDark)} className=Styles.toggler> + <p> + {ReasonReact.string( + (state.dark ? {j|☑|j} : {j|☐|j}) ++ " Dark Mode", + )} + </p> + </div> </React.Fragment>; }; diff --git a/src/Template.re b/src/Template.re @@ -0,0 +1,12 @@ +[@react.component] +let make = (~content, ~title, ()) => {j| + <!DOCTYPE html> + <html> + <head> + <title>$title</title> + </head> + <body> + <div id="react-root">$content</div> + </body> + </html> +|j};