mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-12-18 11:11:38 +03:00
Elm-format v 0.7.0-exp
This commit is contained in:
parent
44d78aa962
commit
1451f84913
@ -1,6 +1,9 @@
|
|||||||
module Nri.Ui.PremiumCheckbox.V1 exposing (PremiumConfig, premium)
|
module Nri.Ui.PremiumCheckbox.V1 exposing (PremiumConfig, premium)
|
||||||
|
|
||||||
{-| @docs PremiumConfig, premium
|
{-|
|
||||||
|
|
||||||
|
@docs PremiumConfig, premium
|
||||||
|
|
||||||
-}
|
-}
|
||||||
|
|
||||||
import Accessibility.Styled as Html
|
import Accessibility.Styled as Html
|
||||||
@ -17,6 +20,7 @@ import Nri.Ui.Data.PremiumLevel as PremiumLevel exposing (PremiumLevel(..))
|
|||||||
- `onChange`: A message for when the user toggles the checkbox
|
- `onChange`: A message for when the user toggles the checkbox
|
||||||
- `onLockedClick`: A message for when the user clicks a checkbox they don't have PremiumLevel for.
|
- `onLockedClick`: A message for when the user clicks a checkbox they don't have PremiumLevel for.
|
||||||
If you get this message, you should show an `Nri.Ui.Premium.Model.view`
|
If you get this message, you should show an `Nri.Ui.Premium.Model.view`
|
||||||
|
|
||||||
-}
|
-}
|
||||||
type alias PremiumConfig msg =
|
type alias PremiumConfig msg =
|
||||||
{ label : String
|
{ label : String
|
||||||
@ -54,41 +58,41 @@ premium assets config =
|
|||||||
else
|
else
|
||||||
Checkbox.Square Checkbox.Default
|
Checkbox.Square Checkbox.Default
|
||||||
in
|
in
|
||||||
Html.span []
|
Html.span []
|
||||||
[ Checkbox.viewWithLabel assets
|
[ Checkbox.viewWithLabel assets
|
||||||
{ identifier = config.id
|
{ identifier = config.id
|
||||||
, label = config.label
|
, label = config.label
|
||||||
, setterMsg =
|
, setterMsg =
|
||||||
if isLocked then
|
if isLocked then
|
||||||
\_ -> config.onLockedClick
|
\_ -> config.onLockedClick
|
||||||
else
|
else
|
||||||
config.onChange
|
config.onChange
|
||||||
, selected = config.selected
|
, selected = config.selected
|
||||||
, disabled = config.disabled
|
, disabled = config.disabled
|
||||||
, theme = theme
|
, theme = theme
|
||||||
, noOpMsg = config.noOpMsg
|
, noOpMsg = config.noOpMsg
|
||||||
}
|
}
|
||||||
, if
|
, if
|
||||||
(isLocked && config.showFlagWhenLocked)
|
(isLocked && config.showFlagWhenLocked)
|
||||||
|| (not isLocked && config.contentPremiumLevel /= Free)
|
|| (not isLocked && config.contentPremiumLevel /= Free)
|
||||||
then
|
then
|
||||||
Html.div
|
Html.div
|
||||||
[ Attributes.class "checkbox-PremiumClass"
|
[ Attributes.class "checkbox-PremiumClass"
|
||||||
, css
|
, css
|
||||||
[ property "content" "''"
|
[ property "content" "''"
|
||||||
, display inlineBlock
|
, display inlineBlock
|
||||||
, width (px 26)
|
, width (px 26)
|
||||||
, height (px 24)
|
, height (px 24)
|
||||||
, marginLeft (px 8)
|
, marginLeft (px 8)
|
||||||
, backgroundImage assets.iconPremiumFlag_svg
|
, backgroundImage assets.iconPremiumFlag_svg
|
||||||
, backgroundRepeat noRepeat
|
, backgroundRepeat noRepeat
|
||||||
, backgroundPosition Css.center
|
, backgroundPosition Css.center
|
||||||
]
|
|
||||||
]
|
]
|
||||||
[]
|
]
|
||||||
else
|
[]
|
||||||
Html.text ""
|
else
|
||||||
]
|
Html.text ""
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
{-| The assets used in this module.
|
{-| The assets used in this module.
|
||||||
|
Loading…
Reference in New Issue
Block a user