mirror of
https://gitlab.com/upRootNutrition/website.git
synced 2025-06-16 04:25:11 -05:00
feat: init
This commit is contained in:
parent
be12403f13
commit
7145b8a9fa
21 changed files with 591 additions and 9 deletions
82
frontend/src/Pages/Contact.elm
Normal file
82
frontend/src/Pages/Contact.elm
Normal file
|
@ -0,0 +1,82 @@
|
|||
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)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue