mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-12-18 19:21:29 +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
|
type Theme
|
||||||
= Square
|
= Square
|
||||||
| LockOnInside
|
| LockOnInside
|
||||||
| Premium
|
|
||||||
|
|
||||||
|
|
||||||
selectedToMaybe : IsSelected -> Maybe Bool
|
selectedToMaybe : IsSelected -> Maybe Bool
|
||||||
@ -118,13 +117,6 @@ buildCheckbox assets modifierClasses model labelContent =
|
|||||||
, labelContent = labelContent
|
, labelContent = labelContent
|
||||||
}
|
}
|
||||||
|
|
||||||
Premium ->
|
|
||||||
{ containerClasses = toClassList (modifierClasses ++ [ "SquareClass" ])
|
|
||||||
, labelStyles = premiumLabelStyles assets.checkboxLockOnInside_svg model
|
|
||||||
, labelClasses = labelClass model.selected
|
|
||||||
, labelContent = labelContent
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
squareLabelStyles assets model =
|
squareLabelStyles assets model =
|
||||||
let
|
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 -> Html.Styled.Attribute msg
|
||||||
labelClass isSelected =
|
labelClass isSelected =
|
||||||
case isSelected of
|
case isSelected of
|
||||||
|
@ -49,14 +49,6 @@ premium assets config =
|
|||||||
PremiumLevel.allowedFor
|
PremiumLevel.allowedFor
|
||||||
config.contentPremiumLevel
|
config.contentPremiumLevel
|
||||||
config.teacherPremiumLevel
|
config.teacherPremiumLevel
|
||||||
|
|
||||||
theme =
|
|
||||||
if isLocked then
|
|
||||||
Checkbox.LockOnInside
|
|
||||||
else if config.contentPremiumLevel /= Free then
|
|
||||||
Checkbox.Premium
|
|
||||||
else
|
|
||||||
Checkbox.Square
|
|
||||||
in
|
in
|
||||||
Html.div
|
Html.div
|
||||||
[ css
|
[ css
|
||||||
@ -74,7 +66,11 @@ premium assets config =
|
|||||||
config.onChange
|
config.onChange
|
||||||
, selected = config.selected
|
, selected = config.selected
|
||||||
, disabled = config.disabled
|
, disabled = config.disabled
|
||||||
, theme = theme
|
, theme =
|
||||||
|
if isLocked then
|
||||||
|
Checkbox.LockOnInside
|
||||||
|
else
|
||||||
|
Checkbox.Square
|
||||||
, noOpMsg = config.noOpMsg
|
, noOpMsg = config.noOpMsg
|
||||||
}
|
}
|
||||||
, if
|
, if
|
||||||
|
Loading…
Reference in New Issue
Block a user