aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/LoggedIn/Home/View/Expand.elm
blob: e0c13a311c37109086d0adc080c5f46ba7f93a06 (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
module LoggedIn.Home.View.Expand exposing
  ( expand
  , ExpandType(..)
  )

import Color exposing (Color)

import FontAwesome

import Html exposing (..)
import Html.Attributes exposing (..)

import Msg exposing (Msg)

type ExpandType = ExpandUp | ExpandDown

expand : ExpandType -> Bool -> Html Msg
expand expandType isExpanded =
  div
    [ class "expand" ]
    [ (chevronIcon expandType isExpanded) Color.white 15 ]

chevronIcon : ExpandType -> Bool -> (Color -> Int -> Html msg)
chevronIcon expandType isExpanded =
  case (expandType, isExpanded) of
    (ExpandUp, True)    -> FontAwesome.chevron_down
    (ExpandUp, False)   -> FontAwesome.chevron_up
    (ExpandDown, True)  -> FontAwesome.chevron_up
    (ExpandDown, False) -> FontAwesome.chevron_down