mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-12-18 03:01:41 +03:00
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:
parent
534fade431
commit
20f5afb0ec
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user