Handle some Elm compilation warnings

This commit is contained in:
Jasper Woudenberg 2018-06-20 15:28:20 +01:00
parent a01eeb9df8
commit 88b6020a9a
2 changed files with 38 additions and 43 deletions

View File

@ -22,14 +22,11 @@ import Accessibility.Styled.Style
import Accessibility.Styled.Widget as Widget
import Css exposing (..)
import Css.Foreign exposing (Snippet, children, descendants, everything, selector)
import Html as RootHtml
import Html.Attributes as RootAttributes
import Html.Events exposing (defaultOptions)
import Html.Styled exposing (fromUnstyled, toUnstyled)
import Html.Styled
import Html.Styled.Attributes as Attributes exposing (css)
import Html.Styled.Events as Events
import Json.Decode
import Json.Encode
import Nri.Ui.AssetPath exposing (Asset(..))
import Nri.Ui.AssetPath.Css
import Nri.Ui.Colors.V1 as Colors
@ -326,6 +323,7 @@ type alias Assets r =
}
backgroundImage : Asset -> Style
backgroundImage =
Nri.Ui.AssetPath.Css.url
>> property "background-image"

View File

@ -1,9 +1,6 @@
module Nri.Ui.PremiumCheckbox.V1 exposing (PremiumConfig, premium)
{-|
@docs PremiumConfig, premium
{-| @docs PremiumConfig, premium
-}
import Accessibility.Styled as Html
@ -20,7 +17,6 @@ import Nri.Ui.Data.PremiumLevel as PremiumLevel exposing (PremiumLevel(..))
- `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.
If you get this message, you should show an `Nri.Ui.Premium.Model.view`
-}
type alias PremiumConfig msg =
{ label : String
@ -58,41 +54,41 @@ premium assets config =
else
Checkbox.Square Checkbox.Default
in
Html.span []
[ Checkbox.viewWithLabel assets
{ identifier = config.id
, label = config.label
, setterMsg =
if isLocked then
\_ -> config.onLockedClick
else
config.onChange
, selected = config.selected
, disabled = config.disabled
, theme = theme
, noOpMsg = config.noOpMsg
}
, if
(isLocked && config.showFlagWhenLocked)
|| (not isLocked && config.contentPremiumLevel /= Free)
then
Html.div
[ Attributes.class "checkbox-PremiumClass"
, css
[ property "content" "''"
, display inlineBlock
, width (px 26)
, height (px 24)
, marginLeft (px 8)
, backgroundImage assets.iconPremiumFlag_svg
, backgroundRepeat noRepeat
, backgroundPosition Css.center
Html.span []
[ Checkbox.viewWithLabel assets
{ identifier = config.id
, label = config.label
, setterMsg =
if isLocked then
\_ -> config.onLockedClick
else
config.onChange
, selected = config.selected
, disabled = config.disabled
, theme = theme
, noOpMsg = config.noOpMsg
}
, if
(isLocked && config.showFlagWhenLocked)
|| (not isLocked && config.contentPremiumLevel /= Free)
then
Html.div
[ Attributes.class "checkbox-PremiumClass"
, css
[ property "content" "''"
, display inlineBlock
, width (px 26)
, height (px 24)
, marginLeft (px 8)
, backgroundImage assets.iconPremiumFlag_svg
, backgroundRepeat noRepeat
, backgroundPosition Css.center
]
]
]
[]
else
Html.text ""
]
[]
else
Html.text ""
]
{-| The assets used in this module.
@ -107,6 +103,7 @@ type alias Assets r =
}
backgroundImage : Asset -> Style
backgroundImage =
Nri.Ui.AssetPath.Css.url
>> property "background-image"