Minor cleanup

This commit is contained in:
Ozzie Gooen 2020-02-13 22:04:13 +00:00
parent b06ac56efd
commit 2b0e00ea3b
4 changed files with 15 additions and 8 deletions

View File

@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Foretold.io</title> <title>Estiband</title>
<link href="https://fonts.googleapis.com/css?family=Lato:300,400,700,900" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Lato:300,400,700,900" rel="stylesheet">
<link href="./styles/index.css" rel="stylesheet"> <link href="./styles/index.css" rel="stylesheet">
<script src="./Index.re" defer></script> <script src="./Index.re" defer></script>

View File

@ -30,6 +30,9 @@ module Value = {
| Probability(r) => (r *. 100. |> Js.Float.toFixed) ++ "%" | Probability(r) => (r *. 100. |> Js.Float.toFixed) ++ "%"
| DateTime(r) => r |> MomentRe.Moment.defaultFormat | DateTime(r) => r |> MomentRe.Moment.defaultFormat
| FloatPoint(r) => r |> Js.Float.toFixed | FloatPoint(r) => r |> Js.Float.toFixed
| Conditional(r) => r.name
| ConditionalArray(r) =>
r |> E.A.fmap(r => r.name) |> Js.Array.joinWith(",")
}; };
}; };

View File

@ -59,7 +59,7 @@ let make =
className="max-w-sm rounded overflow-hidden shadow-sm py-1 px-2 rounded mb-3 bg-gray-200"> className="max-w-sm rounded overflow-hidden shadow-sm py-1 px-2 rounded mb-3 bg-gray-200">
{r |> ReasonReact.string} {r |> ReasonReact.string}
<button <button
className="bg-blue-500 hover:bg-blue-700 text-white py-1 px-2 rounded" className="bg-blue-500 hover:bg-blue-700 text-white py-0 px-1 rounded"
onClick={e => { onClick={e => {
ReactEvent.Synthetic.preventDefault(e); ReactEvent.Synthetic.preventDefault(e);
onChange( onChange(
@ -77,10 +77,10 @@ let make =
); );
(); ();
}}> }}>
{"true" |> ReasonReact.string} {"True" |> ReasonReact.string}
</button> </button>
<button <button
className="hover:bg-red-700 text-white py-1 px-2 rounded bg-red-500" className="hover:bg-red-700 text-white py-0 px-1 rounded bg-red-500"
onClick={e => { onClick={e => {
ReactEvent.Synthetic.preventDefault(e); ReactEvent.Synthetic.preventDefault(e);
onChange( onChange(
@ -97,7 +97,7 @@ let make =
), ),
); );
}}> }}>
{"false" |> ReasonReact.string} {"False" |> ReasonReact.string}
</button> </button>
</div> </div>
) )

View File

@ -152,6 +152,7 @@ module Interface = {
Some(DateTime(intendedYear)), Some(DateTime(intendedYear)),
Some(DateTime(currentYear)), Some(DateTime(currentYear)),
Some(SelectSingle(output)), Some(SelectSingle(output)),
_,
|] => |] =>
choiceFromString(fund) choiceFromString(fund)
|> E.O.fmap(fund => |> E.O.fmap(fund =>
@ -230,11 +231,14 @@ module Interface = {
(), (),
), ),
TypeWithMetadata.make( TypeWithMetadata.make(
~name="Conditional on World Ending", ~name="Conditionals",
~id="worldEnd", ~id="conditionals",
~type_= ~type_=
Conditionals( Conditionals(
Prop.Type.makeConditionals([||], [|"Foo", "Bar", "Char"|]), Prop.Type.makeConditionals(
[||],
[|"Global Existential Event"|],
),
), ),
(), (),
), ),