mirror of
https://gitlab.com/upRootNutrition/website.git
synced 2025-06-16 04:25:11 -05:00
refactor: map abuse
This commit is contained in:
parent
718a9ecaa7
commit
7c0577d3d9
7 changed files with 590 additions and 196 deletions
78
frontend/src/Layouts/Navbar.elm
Normal file
78
frontend/src/Layouts/Navbar.elm
Normal file
|
@ -0,0 +1,78 @@
|
|||
module Layouts.Navbar exposing (Model, Msg, Props, layout)
|
||||
|
||||
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.Region exposing (description)
|
||||
import Html exposing (Html)
|
||||
import Html.Attributes as H exposing (class, style)
|
||||
import Layout exposing (Layout)
|
||||
import Route exposing (Route)
|
||||
import Shared
|
||||
import View exposing (View)
|
||||
|
||||
|
||||
type alias Props =
|
||||
{}
|
||||
|
||||
|
||||
layout : Props -> Shared.Model -> Route () -> Layout () Model Msg contentMsg
|
||||
layout props shared route =
|
||||
Layout.new
|
||||
{ init = init
|
||||
, update = update
|
||||
, view = view
|
||||
, subscriptions = subscriptions
|
||||
}
|
||||
|
||||
|
||||
|
||||
-- MODEL
|
||||
|
||||
|
||||
type alias Model =
|
||||
{}
|
||||
|
||||
|
||||
init : () -> ( Model, Effect Msg )
|
||||
init _ =
|
||||
( {}
|
||||
, Effect.none
|
||||
)
|
||||
|
||||
|
||||
|
||||
-- UPDATE
|
||||
|
||||
|
||||
type Msg
|
||||
= ReplaceMe
|
||||
|
||||
|
||||
update : Msg -> Model -> ( Model, Effect Msg )
|
||||
update msg model =
|
||||
case msg of
|
||||
ReplaceMe ->
|
||||
( model
|
||||
, Effect.none
|
||||
)
|
||||
|
||||
|
||||
subscriptions : Model -> Sub Msg
|
||||
subscriptions model =
|
||||
Sub.none
|
||||
|
||||
|
||||
|
||||
-- VIEW
|
||||
|
||||
|
||||
view : { toContentMsg : Msg -> contentMsg, content : View contentMsg, model : Model } -> View contentMsg
|
||||
view { toContentMsg, model, content } =
|
||||
{ title = content.title
|
||||
, attributes = [ F.family [ spartanFont ] ]
|
||||
, element = column [width fill, height fill] [text "some bullshit", content.element]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue