diff options
| author | Jan Tuomi <jan.tuomi@valuemotive.com> | 2021-11-04 18:06:11 +0200 |
|---|---|---|
| committer | Jan Tuomi <jan.tuomi@valuemotive.com> | 2021-11-04 18:06:11 +0200 |
| commit | 270123cc18ee8acff4b2819f4a609045bd5194f5 (patch) | |
| tree | 650fb26ac317b2697c1e91ce43682674e0ea874c /src/Types.elm | |
| parent | 69d48eb332ac53104cf57b408059a103151071fb (diff) | |
Add navigation and profile
Diffstat (limited to 'src/Types.elm')
| -rw-r--r-- | src/Types.elm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Types.elm b/src/Types.elm index f10223e..aeb7d67 100644 --- a/src/Types.elm +++ b/src/Types.elm @@ -1,14 +1,17 @@ module Types exposing (..) +import Browser exposing (UrlRequest) import Browser.Navigation exposing (Key) import Http import RemoteData exposing (RemoteData) import Time +import Url exposing (Url) type alias Model = { now : Time.Posix , key : Key + , url : Url , userData : UserData , apiURL : String , posts : RemoteData (List Post) @@ -35,6 +38,9 @@ type Msg | RequestLogout -- TIME | SetNowPosix Time.Posix + -- NAVIGATION + | UrlChanged Url + | LinkClicked UrlRequest -- POSTS | GetPosts | GotPosts (Result Http.Error (List Post)) @@ -47,12 +53,21 @@ type Msg | ComposedPost (Result Http.Error Post) +type Route + = Index + | Profile UrlSegmentUserId + + type alias Author = { id : String , name : String } +type alias UrlSegmentUserId = + String + + type alias Post = { id : String , content : String |
