From 906db8d4ac24f65f38e1d31bfdaa47602a54d759 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Mon, 9 Jan 2023 13:06:53 -0500 Subject: Reorganize some Auth/App stuff --- Biz/App.hs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'Biz/App.hs') diff --git a/Biz/App.hs b/Biz/App.hs index 9c0b7a7..317a163 100644 --- a/Biz/App.hs +++ b/Biz/App.hs @@ -5,7 +5,8 @@ -- | General utils for apps module Biz.App - ( CSS (..), + ( Area (..), + CSS (..), HasCss (..), Manifest (..), Html (..), @@ -22,6 +23,16 @@ import Network.HTTP.Media (/:), ) import Servant.API (Accept (..), MimeRender (..)) +import qualified System.Envy as Envy + +data Area = Test | Live + deriving (Generic, Show) + +instance Envy.Var Area where + toVar = show + fromVar "Test" = Just Test + fromVar "Live" = Just Live + fromVar _ = Just Test newtype CSS = CSS { unCSS :: Text @@ -47,7 +58,7 @@ data Manifest = Manifest instance ToJSON Manifest -- | A wrapper for an HTML page. You need to provide an orphan --- 'Lucid.Base.ToHtml' instance in the Host module of your app. +-- 'Lucid.Base.ToHtml' instance in the web module of your app. -- -- Ideally this would be captured in a Biz.App type, with overrides for head -- elements, and we would wouldn't have to make the same basic orphan instance -- cgit v1.2.3