From 270123cc18ee8acff4b2819f4a609045bd5194f5 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Thu, 4 Nov 2021 18:06:11 +0200 Subject: Add navigation and profile --- src/Types.elm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/Types.elm') 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 -- cgit v1.3