summaryrefslogtreecommitdiffstats
path: root/src/UI/Draw/Types.hs
blob: 55110d58a6e7103c7c2be0319ea28957353e8864 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{-# LANGUAGE NoImplicitPrelude #-}

module UI.Draw.Types where

import ClassyPrelude

import Brick              (Widget)
import Events.State.Types (State)
import IO.Config.Layout   (Config)
import IO.Keyboard.Types  (Bindings)
import UI.Types           (ResourceName)

data DrawState = DrawState
    { dsLayout   :: Config
    , dsBindings :: Bindings
    , dsToday    :: Day
    , dsDebug    :: Bool
    , dsState    :: State
    }

-- | Use a Reader to pass around DrawState
type ReaderDrawState = ReaderT DrawState Identity

-- | Aliases for common combinations
type TWidget = Widget ResourceName

type ModalWidget = ReaderDrawState (Text, TWidget)

type DSWidget = ReaderDrawState TWidget