diff options
Diffstat (limited to 'Hero/App.hs')
-rw-r--r-- | Hero/App.hs | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/Hero/App.hs b/Hero/App.hs index 56289f8..6f7a8c4 100644 --- a/Hero/App.hs +++ b/Hero/App.hs @@ -295,29 +295,32 @@ data Action | DumpModel deriving (Show, Eq) -type ClientRoutes = - Home - :<|> ComicCover +type AppRoutes = + ComicCover :<|> ComicReaderSpread :<|> ComicReaderFull :<|> ComicVideo - :<|> Login :<|> Discover :<|> ChooseExperience handlers = - home - :<|> comicCover + comicCover :<|> comicReader :<|> comicReader :<|> comicReader - :<|> login :<|> discover :<|> comicReader -routes :: Proxy ClientRoutes +routes :: Proxy AppRoutes routes = Proxy +type PubRoutes = + Home + :<|> Login + +pubRoutes :: Proxy PubRoutes +pubRoutes = Proxy + -- * pages -- -- TODO: consider making a typeclass, something like: @@ -330,6 +333,8 @@ routes = Proxy -- link :: Api.URI -- * home +-- +-- this is the unauthenticated page that you see when you first visit type Home = View Action @@ -337,12 +342,14 @@ type Home = homeProxy :: Proxy Home homeProxy = Proxy +homeLink :: Api.URI +homeLink = linkURI $ Api.safeLink front homeProxy + where + front = Proxy :: Proxy Home + home :: Model -> View Action home = login -homeLink :: Api.URI -homeLink = linkURI $ Api.safeLink routes homeProxy - -- * login data LoginForm = LoginForm {loginEmail :: String, loginPass :: String} @@ -359,7 +366,7 @@ loginProxy :: Proxy Login loginProxy = Proxy loginLink :: Api.URI -loginLink = linkURI $ Api.safeLink routes loginProxy +loginLink = linkURI $ Api.safeLink pubRoutes loginProxy login :: Model -> View Action login _ = @@ -807,11 +814,12 @@ appmenu :: View Action appmenu = aside_ [id_ "appmenu"] $ btn </ links where links = + -- these extra 'discoverLink's are just dummies [ (discoverLink, "discover.svg", "discover"), - (homeLink, "save.svg", "library"), - (homeLink, "watch.svg", "videos"), + (discoverLink, "save.svg", "library"), + (discoverLink, "watch.svg", "videos"), (comicLink "1", "read.svg", "comics"), - (homeLink, "listen.svg", "music") + (discoverLink, "listen.svg", "music") ] btn (lnk, img, label) = a_ @@ -899,7 +907,9 @@ topbar = header_ [id_ "app-head", class_ "is-black", css euro] [ a_ - [class_ "button is-medium is-black", onClick $ ChangeURI homeLink] + [ class_ "button is-medium is-black", + onClick $ ChangeURI discoverLink + ] [img_ [src_ $ ms $ Assets.icon <> "hero-logo.svg"]], div_ [id_ "app-head-right"] |