Simplify preview setup

This commit is contained in:
Tessa Kelly 2022-03-23 10:39:45 -07:00
parent 4b6ac208ee
commit eaacc02e73

View File

@ -31,12 +31,11 @@ example =
, update = update
, subscriptions = \_ -> Sub.none
, preview =
[ ( "caption", Text.caption )
, ( "smallBody", Text.smallBody )
, ( "mediumBody", Text.mediumBody )
, ( "ugMediumBody", Text.ugMediumBody )
[ Text.caption [ Text.plaintext "caption" ]
, Text.smallBody [ Text.plaintext "smallBody" ]
, Text.mediumBody [ Text.plaintext "mediumBody" ]
, Text.ugMediumBody [ Text.plaintext "ugMediumBody" ]
]
|> List.map viewPreview
, view =
\state ->
let
@ -86,11 +85,6 @@ example =
}
viewPreview : ( String, List (Text.Attribute msg) -> Html msg ) -> Html msg
viewPreview ( name, view ) =
view [ Text.plaintext name ]
viewExamples : List ( String, List (Text.Attribute msg) -> Html msg ) -> List (Text.Attribute msg) -> Html msg
viewExamples examples attributes =
let