on decrease-android-validity help sign in
30 lines 881 B history raw
1{-# LANGUAGE DataKinds #-}
2{-# LANGUAGE OverloadedStrings #-}
3{-# LANGUAGE TypeApplications #-}
4module Frontend where
6import qualified Data.Text as T
7import qualified Data.Text.Encoding as T
8import Obelisk.Frontend
9import Obelisk.Configs
10import Obelisk.Route
11import Reflex.Dom.Core
13import Common.Api
14import Common.Route
15import Obelisk.Generated.Static
17frontend :: Frontend (R FrontendRoute)
18frontend = Frontend
19 { _frontend_head = el "title" $ text "Obelisk Minimal Example"
20 , _frontend_body = do
21 text "Welcome to Obelisk!"
22 el "p" $ text $ T.pack commonStuff
23 elAttr "img" ("src" =: static @"obelisk.jpg") blank
24 el "div" $ do
25 exampleConfig <- getConfig "common/example"
26 case exampleConfig of
27 Nothing -> text "No config file found in config/common/example"
28 Just s -> text (T.decodeUtf8 s)
29 return ()
30 }