2024-12-01 02:56:13 -06:00
|
|
|
module Pages.Nutridex exposing (Model, Msg, page)
|
|
|
|
|
|
|
|
import Config.Colour as T exposing (..)
|
|
|
|
import Config.Format as O exposing (..)
|
|
|
|
import Config.Identity as I exposing (..)
|
2024-12-03 04:59:27 -06:00
|
|
|
import Config.Viewport exposing (..)
|
2024-12-01 02:56:13 -06:00
|
|
|
import Donate.Types exposing (..)
|
|
|
|
import Effect exposing (Effect)
|
|
|
|
import Element as E exposing (..)
|
|
|
|
import Element.Background as B exposing (..)
|
|
|
|
import Element.Border as D exposing (..)
|
|
|
|
import Element.Font as F
|
|
|
|
import Headers.Helpers exposing (headerMaker)
|
|
|
|
import Headers.Pages.Donate exposing (donateHeader)
|
|
|
|
import Headers.Pages.NutriDex exposing (nutriDexHeader)
|
|
|
|
import Html
|
|
|
|
import Html.Attributes as H exposing (style)
|
|
|
|
import Layout exposing (..)
|
|
|
|
import Layouts
|
|
|
|
import Page exposing (Page)
|
|
|
|
import Products.Helpers exposing (..)
|
|
|
|
import Products.NutriDex.NutriDex exposing (productNutriDex)
|
|
|
|
import Route exposing (Route)
|
|
|
|
import Shared exposing (..)
|
|
|
|
import View exposing (View)
|
|
|
|
|
|
|
|
|
|
|
|
page : Shared.Model -> Route () -> Page Model Msg
|
|
|
|
page shared route =
|
|
|
|
Page.new
|
|
|
|
{ init = init
|
|
|
|
, update = update
|
|
|
|
, subscriptions = subscriptions
|
|
|
|
, view = view
|
|
|
|
}
|
|
|
|
|> Page.withLayout toLayout
|
|
|
|
|
|
|
|
|
|
|
|
toLayout : Model -> Layouts.Layout Msg
|
|
|
|
toLayout model =
|
2024-12-03 21:17:17 -06:00
|
|
|
Layouts.Navbar {currentRoute = nutriDexName}
|
2024-12-01 02:56:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- INIT
|
|
|
|
|
|
|
|
|
|
|
|
type alias Model =
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
init : () -> ( Model, Effect Msg )
|
|
|
|
init () =
|
|
|
|
( {}
|
2024-12-03 04:59:27 -06:00
|
|
|
, Effect.map
|
|
|
|
(\_ -> NoOp)
|
|
|
|
(Effect.sendCmd resetViewport)
|
2024-12-01 02:56:13 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
-- UPDATE
|
|
|
|
|
|
|
|
|
|
|
|
type Msg
|
|
|
|
= NoOp
|
|
|
|
|
|
|
|
|
|
|
|
update : Msg -> Model -> ( Model, Effect Msg )
|
|
|
|
update msg model =
|
|
|
|
case msg of
|
|
|
|
NoOp ->
|
|
|
|
( model
|
|
|
|
, Effect.none
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- SUBSCRIPTIONS
|
|
|
|
|
|
|
|
|
|
|
|
subscriptions : Model -> Sub Msg
|
|
|
|
subscriptions model =
|
|
|
|
Sub.none
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- VIEW
|
|
|
|
|
|
|
|
|
|
|
|
view : Model -> View Msg
|
|
|
|
view model =
|
|
|
|
{ title = nutriDexName
|
|
|
|
, attributes = []
|
|
|
|
, element = nutriDexContainer
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
nutriDexContainer : Element msg
|
|
|
|
nutriDexContainer =
|
|
|
|
topLevelContainer nutriDexList
|
|
|
|
|
|
|
|
|
|
|
|
nutriDexList : Element msg
|
|
|
|
nutriDexList =
|
|
|
|
column pageList <|
|
|
|
|
List.concat
|
|
|
|
[ List.map nutriDexMaker
|
|
|
|
[ productNutriDex ]
|
|
|
|
]
|