refactor: map abuse

This commit is contained in:
Nick 2024-11-11 03:57:54 -06:00
parent 718a9ecaa7
commit 7c0577d3d9
7 changed files with 590 additions and 196 deletions

108
frontend/src/Pages/Home_.elm Executable file → Normal file
View file

@ -1,49 +1,81 @@
module Pages.Home_ exposing (page)
module Pages.Home_ 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.Region exposing (description)
import Html.Attributes as H exposing (style)
import Layouts
import Page exposing (Page)
import Route exposing (Route)
import Shared
import View exposing (View)
-- Use this if you fuck something up
-- Element.explain Debug.todo
page : Shared.Model -> Route () -> Page Model Msg
page shared route =
Page.new
{ init = init
, update = update
, subscriptions = subscriptions
, view = view
}
|> Page.withLayout toLayout
page : View msg
page =
toLayout : Model -> Layouts.Layout Msg
toLayout model =
Layouts.Navbar {}
-- INIT
type alias Model =
{}
init : () -> ( Model, Effect Msg )
init () =
( {}
, Effect.none
)
-- 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 = homeName
, attributes = [ F.family [ spartanFont ] ]
, element = topLevelContainer
, attributes = []
, element = none
}
topLevelContainer : Element msg
topLevelContainer =
el
[ width fill
, height fill
, B.color colourTheme.backgroundColour
]
linkList
linkList : Element msg
linkList =
column
[ spacing 20
, centerX
, centerY
, F.color (rgb255 67 67 67)
]
links
paragraphFontSize : Attr decorative msg
paragraphFontSize =
F.size 17
links : List (Element msg)
links = []