mirror of
https://gitlab.com/upRootNutrition/website.git
synced 2025-06-15 12:05:12 -05:00
82 lines
1.3 KiB
Elm
82 lines
1.3 KiB
Elm
module Pages.Contact exposing (Model, Msg, page)
|
|
|
|
import Config.Identity as ID exposing (..)
|
|
import Config.Theme as T exposing (..)
|
|
import Effect exposing (Effect)
|
|
import Element exposing (..)
|
|
import Element.Background as B
|
|
import Element.Font as F
|
|
import Element.Events as E
|
|
import Page exposing (Page)
|
|
import Route exposing (Route)
|
|
import Shared
|
|
import View exposing (View)
|
|
|
|
|
|
page : Shared.Model -> Route () -> Page Model Msg
|
|
page shared route =
|
|
Page.new
|
|
{ init = init
|
|
, update = update
|
|
, subscriptions = subscriptions
|
|
, view = view
|
|
}
|
|
|
|
|
|
|
|
-- INIT
|
|
|
|
|
|
type alias Model =
|
|
{ num : Int }
|
|
|
|
|
|
init : () -> ( Model, Effect Msg )
|
|
init () =
|
|
( { num = 0 }
|
|
, Effect.none
|
|
)
|
|
|
|
|
|
|
|
-- UPDATE
|
|
|
|
|
|
type Msg
|
|
= Inc
|
|
| Dec
|
|
|
|
|
|
update : Msg -> Model -> ( Model, Effect Msg )
|
|
update msg model =
|
|
case msg of
|
|
Inc ->
|
|
( { model | num = model.num + 1 }
|
|
, Effect.none
|
|
)
|
|
|
|
Dec ->
|
|
( { model | num = model.num - 1 }
|
|
, Effect.none
|
|
)
|
|
|
|
|
|
|
|
-- SUBSCRIPTIONS
|
|
|
|
|
|
subscriptions : Model -> Sub Msg
|
|
subscriptions model =
|
|
Sub.none
|
|
|
|
|
|
|
|
-- VIEW
|
|
|
|
|
|
view : Model -> View Msg
|
|
view model =
|
|
{ title = ""
|
|
, attributes = []
|
|
, element = el [E.onClick Inc] (text <| "a string is fun" ++ String.fromInt model.num)
|
|
}
|