diff --git a/dokusho/package.json b/dokusho/package.json index 721e55c..06697d1 100644 --- a/dokusho/package.json +++ b/dokusho/package.json @@ -13,14 +13,13 @@ }, "scripts": { "start": "react-scripts start", - "build": "toolbox react-scripts build", + "build": "react-toolbox-themr react-scripts build", "test": "react-scripts test --env=jsdom", "coverage": "react-scripts test --env=jsdom --coverage", "ci": "react-scripts test --env=jsdom --coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", "eject": "react-scripts eject", "prepare": "npm link bs-platform", - "clean": "rm -rf lib && rm -rf node_modules", - "toolbox": "react-toolbox-themr" + "clean": "rm -rf lib && rm -rf node_modules" }, "devDependencies": { "@astrada/reason-react-toolbox": "^0.4.2", diff --git a/dokusho/src/app/DateSelector.re b/dokusho/src/app/DateSelector.re index a7841aa..c62c173 100644 --- a/dokusho/src/app/DateSelector.re +++ b/dokusho/src/app/DateSelector.re @@ -1,9 +1,23 @@ -let component = ReasonReact.statelessComponent("DateSelector"); +let component = ReasonReact.reducerComponent("DateSelector"); -let make = (~today: string, _children) => { +let getDate = Js.Date.make; + +let make = (~onChangeSelect, _children) => { ...component, - render: (_) => -
- -
+ initialState: () => getDate(), + reducer: (state, _ext) => + ReasonReact.Update({ state }), + render: ( + {state, reduce}) => +
+ + { + onChangeSelect(date); + (reduce(() => { date }))(); + } + )/> +
}; \ No newline at end of file diff --git a/dokusho/src/app/Dokusho.re b/dokusho/src/app/Dokusho.re index a2a020f..076ccd3 100644 --- a/dokusho/src/app/Dokusho.re +++ b/dokusho/src/app/Dokusho.re @@ -43,7 +43,7 @@ module Dokusho { /> ChangeSelection(selected))) /> - + ()) />