aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/LoggedIn/Home/View/Expand.elm
blob: 2bcfec18a02aaeaf747c5d8fce623f4c6a2f0fe9 (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 View.Color as 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