🎨 clean up uses of TextIntput.view_

This commit is contained in:
Tessa Kelly 2018-03-16 16:45:24 -07:00
parent 15a3cb407f
commit ca240968f0

View File

@ -83,17 +83,17 @@ number =
{-| -} {-| -}
view : Model value msg -> Html msg view : Model value msg -> Html msg
view model = view model =
view_ OverlappingLabel [] model view_ [ styles.class [ OverlappingLabel ] ] model
{-| -} {-| -}
withInvisibleLabel : Model value msg -> Html msg withInvisibleLabel : Model value msg -> Html msg
withInvisibleLabel model = withInvisibleLabel model =
view_ InvisibleLabel [ Accessibility.Style.invisible ] model view_ [ Accessibility.Style.invisible ] model
view_ : CssClasses -> List (Html.Attribute msg) -> Model value msg -> Html msg view_ : List (Html.Attribute msg) -> Model value msg -> Html msg
view_ labelClass attributes model = view_ attributes model =
let let
idValue = idValue =
"Nri-Ui-TextInput-" ++ dashify model.label "Nri-Ui-TextInput-" ++ dashify model.label
@ -113,18 +113,13 @@ view_ labelClass attributes model =
] ]
[] []
, label , label
([ for idValue (for idValue :: attributes)
, styles.class [ labelClass ]
]
++ attributes
)
[ Html.text model.label ] [ Html.text model.label ]
] ]
type CssClasses type CssClasses
= InvisibleLabel = OverlappingLabel
| OverlappingLabel
| Input | Input
| OverlappingLabelInput | OverlappingLabelInput
| IsInError | IsInError