mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-12-18 19:21:29 +03:00
remove obviated exteranl/internal view distinction; clarify when view does not render in doc comment
This commit is contained in:
parent
9abfa3bc68
commit
64409702ac
@ -206,22 +206,6 @@ applyEvents =
|
||||
emptyEventsAndValues
|
||||
|
||||
|
||||
{-| View a single radio button.
|
||||
If used in a group, all radio buttons in the group should have the same name attribute.
|
||||
-}
|
||||
view :
|
||||
String
|
||||
-> List (Attribute value msg)
|
||||
-> Html msg
|
||||
view label =
|
||||
internalView
|
||||
{ label = label }
|
||||
|
||||
|
||||
type alias InternalConfig =
|
||||
{ label : String }
|
||||
|
||||
|
||||
maybeAttr : (a -> Html.Attribute msg) -> Maybe a -> Html.Attribute msg
|
||||
maybeAttr attr maybeValue =
|
||||
maybeValue
|
||||
@ -229,8 +213,11 @@ maybeAttr attr maybeValue =
|
||||
|> Maybe.withDefault Attributes.none
|
||||
|
||||
|
||||
internalView : InternalConfig -> List (Attribute value msg) -> Html msg
|
||||
internalView config attributes =
|
||||
{-| View a single radio button.
|
||||
Renders nothing if the attributes list does not contain value, name, and valueToString.
|
||||
-}
|
||||
view : String -> List (Attribute value msg) -> Html msg
|
||||
view label attributes =
|
||||
let
|
||||
isChecked =
|
||||
-- why not guard and make sure neither is Nothing?
|
||||
@ -372,7 +359,7 @@ internalView config attributes =
|
||||
else
|
||||
[ css [ verticalAlign middle ] ]
|
||||
)
|
||||
[ Html.text config.label
|
||||
[ Html.text label
|
||||
, viewJust
|
||||
(\premiumMsg ->
|
||||
ClickableSvg.button "Premium"
|
||||
|
Loading…
Reference in New Issue
Block a user