diff --git a/examples/Demo.elm b/examples/Demo.elm index ee28fc3..e69f289 100644 --- a/examples/Demo.elm +++ b/examples/Demo.elm @@ -119,10 +119,9 @@ tabs = , ("Template", \addr model -> [Demo.Template.view (Signal.forwardTo addr TemplateAction) model.template]) -} - , ("Badges", \addr model -> Demo.Badges.view) + , ("Badges", \addr model -> Demo.Badges.view ) ] - tabViews : Array (Addr -> Model -> List Html) tabViews = List.map snd tabs |> Array.fromList diff --git a/examples/Demo/Badges.elm b/examples/Demo/Badges.elm index 422085e..5ee4d78 100644 --- a/examples/Demo/Badges.elm +++ b/examples/Demo/Badges.elm @@ -1,18 +1,18 @@ module Demo.Badges where -import Material.Icon as Icon -import Material.Badge as Badge import Html exposing (..) -import Html.Attributes exposing (..) +import Html.Attributes exposing (class, style, key) +import Material.Badge as Badge +import Material.Style exposing (..) +-- VIEW view : List Html -view = - [ - h1 [][text "Badges"], - Icon.viewWithOptions "face" Icon.S18 [] { badgeInfo = Just (Badge.viewDefault "16")}, - Icon.viewWithOptions "add" Icon.S18 [] { badgeInfo = Just (Badge.view { overlap = False, noBackground = False} "99")}, - Icon.viewWithOptions "add" Icon.S18 [] { badgeInfo = Just (Badge.view { overlap = False, noBackground = True} "4")}, - Icon.view "add" Icon.S18 [], - Icon.i "add" - ] +view = [ div [][p [][] + , styled span (Badge.badgeStyle { overlap = False, noBackground = False} "4") [ ] [ text "Span with badge" ] + , p [][] + , styled span (Badge.badgeStyle { overlap = True, noBackground = False} "7") [ ] [ text "Span with no background badge" ] + , p [][] + , styled span (Badge.badgeStyle { overlap = True, noBackground = False} "14") [ ] [ text "Span with badge overlap" ] + ] + ] \ No newline at end of file