Make the pennant required

This commit is contained in:
Tessa Kelly 2019-06-03 17:14:21 -07:00
parent 7723c5d63f
commit f4dff90f06
2 changed files with 23 additions and 12 deletions

View File

@ -36,7 +36,7 @@ view :
, selected : Checkbox.IsSelected
, disabled : Bool
, isLocked : Bool
, pennant : Maybe Pennant
, pennant : Pennant
, onChange : Bool -> msg
, onLockedClick : msg
}
@ -67,14 +67,11 @@ view config =
Checkbox.Square
}
, case config.pennant of
Just Premium ->
Premium ->
premiumFlag
Just PremiumWithWriting ->
PremiumWithWriting ->
premiumWithWritingFlag
Nothing ->
Html.text ""
]

View File

@ -79,7 +79,7 @@ update msg state =
type alias PremiumExampleConfig =
{ disabled : Bool
, teacherPremiumLevel : PremiumLevel
, pennant : Maybe PremiumCheckbox.Pennant
, pennant : PremiumCheckbox.Pennant
}
@ -175,7 +175,7 @@ viewPremiumCheckboxes : State -> Html Msg
viewPremiumCheckboxes state =
let
checkbox config =
PremiumCheckbox.premium
PremiumCheckbox.view
{ label = config.label
, id = "premium-checkbox-" ++ config.label
, selected =
@ -192,10 +192,24 @@ viewPremiumCheckboxes state =
}
in
Html.div []
[ checkbox { label = "Identify Adjectives 1 (Free)", disabled = False, isLocked = False, pennant = Nothing }
, checkbox { label = "Identify Adjectives 2 (Premium)", disabled = False, isLocked = False, pennant = Just PremiumCheckbox.Premium }
, checkbox { label = "Revising Wordy Phrases 1 (Writing)", disabled = False, isLocked = True, pennant = Just PremiumCheckbox.PremiumWithWriting }
, checkbox { label = "Revising Wordy Phrases 2 (Writing) (Disabled)", disabled = True, isLocked = True, pennant = Just PremiumCheckbox.PremiumWithWriting }
[ checkbox
{ label = "Identify Adjectives 2 (Premium)"
, disabled = False
, isLocked = False
, pennant = PremiumCheckbox.Premium
}
, checkbox
{ label = "Revising Wordy Phrases 1 (Writing)"
, disabled = False
, isLocked = True
, pennant = PremiumCheckbox.PremiumWithWriting
}
, checkbox
{ label = "Revising Wordy Phrases 2 (Writing) (Disabled)"
, disabled = True
, isLocked = True
, pennant = PremiumCheckbox.PremiumWithWriting
}
]