add: Single Page routing

This commit is contained in:
Simon Hardt
2021-05-29 00:12:22 +02:00
parent cb63d33c56
commit a374a7c01a
4 changed files with 237 additions and 28 deletions

View File

@@ -0,0 +1,78 @@
module Files exposing (..)
import Element exposing (..)
import Element.Background as Background
import Element.Border as Border
import Element.Font as Font
import Element.Input as Input
import Element.Region as Region
import Http
import MainPage exposing (Msg)
type alias File =
{ name : String
, source : String
, id : Int
, status : String
}
-- Model --
type alias Model =
{ files : List File
, filter : String
}
initModel : Model
initModel =
{ files = []
, filter = ""
}
-- Messages --
type Msg
= Reload
-- | QueryRequestResult (Result Http.Error _)
-- Request --
-- Update --
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
case msg of
_ ->
( model, Cmd.none )
-- View --
view : Model -> Element Msg
view model =
Element.column
[ width (px 800)
, height shrink
, centerX
, spacing 36
, padding 10
]
[ el
[ Region.heading 1
, alignLeft
, Font.size 36
]
(text "Files")
]