Remove premium theme -- this is mostly about the logic for when to show the flag off to the right, and now the PremiumCheckbox module handles that

This commit is contained in:
Tessa Kelly 2018-06-20 10:56:48 -07:00
parent 534fade431
commit 20f5afb0ec
2 changed files with 5 additions and 56 deletions

View File

@ -63,7 +63,6 @@ type IsSelected
type Theme
= Square
| LockOnInside
| Premium
selectedToMaybe : IsSelected -> Maybe Bool
@ -118,13 +117,6 @@ buildCheckbox assets modifierClasses model labelContent =
, labelContent = labelContent
}
Premium ->
{ containerClasses = toClassList (modifierClasses ++ [ "SquareClass" ])
, labelStyles = premiumLabelStyles assets.checkboxLockOnInside_svg model
, labelClasses = labelClass model.selected
, labelContent = labelContent
}
squareLabelStyles assets model =
let
@ -196,45 +188,6 @@ lockLabelStyles image model =
)
premiumLabelStyles :
Asset
-> { a | disabled : Bool }
-> Html.Styled.Attribute msg
premiumLabelStyles image model =
let
baseStyles =
[ -- Positioning
alignItems center
, displayFlex
-- Focus & Hover
, cursor pointer
, outline none
-- Icon
, icon
]
icon =
after
[ property "content" "''"
, display inlineBlock
, width (px 26)
, height (px 24)
, marginLeft (px 8)
, backgroundImage image
, backgroundRepeat noRepeat
, backgroundPosition Css.center
]
in
css
(if model.disabled then
opacity (num 0.4) :: baseStyles
else
baseStyles
)
labelClass : IsSelected -> Html.Styled.Attribute msg
labelClass isSelected =
case isSelected of

View File

@ -49,14 +49,6 @@ premium assets config =
PremiumLevel.allowedFor
config.contentPremiumLevel
config.teacherPremiumLevel
theme =
if isLocked then
Checkbox.LockOnInside
else if config.contentPremiumLevel /= Free then
Checkbox.Premium
else
Checkbox.Square
in
Html.div
[ css
@ -74,7 +66,11 @@ premium assets config =
config.onChange
, selected = config.selected
, disabled = config.disabled
, theme = theme
, theme =
if isLocked then
Checkbox.LockOnInside
else
Checkbox.Square
, noOpMsg = config.noOpMsg
}
, if