From 9e2fbfde8e9c2256e1817f79d119e0dd7bed7b7d Mon Sep 17 00:00:00 2001 From: William Carroll Date: Fri, 11 Dec 2020 22:47:04 +0000 Subject: Move the habit-screens project into //website I'd like to eventually deploy this to wpcarro.dev. Coming soon! --- website/habit-screens/src/Main.elm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 website/habit-screens/src/Main.elm (limited to 'website/habit-screens/src/Main.elm') diff --git a/website/habit-screens/src/Main.elm b/website/habit-screens/src/Main.elm new file mode 100644 index 000000000000..2ddedb913357 --- /dev/null +++ b/website/habit-screens/src/Main.elm @@ -0,0 +1,29 @@ +module Main exposing (main) + +import Browser +import Habits +import Html exposing (..) +import State +import Time + + +subscriptions : State.Model -> Sub State.Msg +subscriptions model = + -- once per minute + Time.every (1000 * 60) (\_ -> State.MaybeAdjustWeekday) + + +view : State.Model -> Html State.Msg +view model = + case model.view of + State.Habits -> + Habits.render model + + +main = + Browser.element + { init = \() -> State.init + , subscriptions = subscriptions + , update = State.update + , view = view + } -- cgit 1.4.1