mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-12-01 09:12:33 +03:00
add and use categoryForId
This commit is contained in:
parent
657cc5d21f
commit
4518d67431
@ -3,6 +3,7 @@ module ModuleExample exposing
|
||||
, ModuleExample
|
||||
, ModuleMessages
|
||||
, categoryForDisplay
|
||||
, categoryForId
|
||||
, categoryFromString
|
||||
, view
|
||||
)
|
||||
@ -127,6 +128,45 @@ categoryForDisplay category =
|
||||
Animations ->
|
||||
"Animations"
|
||||
|
||||
categoryForId : Category -> String
|
||||
categoryForId category =
|
||||
case category of
|
||||
Tables ->
|
||||
"tables"
|
||||
|
||||
Inputs ->
|
||||
"inputs"
|
||||
|
||||
Widgets ->
|
||||
"widgets"
|
||||
|
||||
Layout ->
|
||||
"layout"
|
||||
|
||||
Buttons ->
|
||||
"buttons-and-links"
|
||||
|
||||
Icons ->
|
||||
"icons"
|
||||
|
||||
Messaging ->
|
||||
"alerts-and-messages"
|
||||
|
||||
Modals ->
|
||||
"modals"
|
||||
|
||||
Colors ->
|
||||
"colors"
|
||||
|
||||
Text ->
|
||||
"text-and-fonts"
|
||||
|
||||
Pages ->
|
||||
"error-pages"
|
||||
|
||||
Animations ->
|
||||
"animations"
|
||||
|
||||
|
||||
view : Bool -> ModuleExample msg -> Html msg
|
||||
view showFocusLink { name, content } =
|
||||
|
@ -7,7 +7,7 @@ import Html.Attributes
|
||||
import Html.Styled as Html exposing (Html, img)
|
||||
import Html.Styled.Attributes as Attributes exposing (..)
|
||||
import Model exposing (..)
|
||||
import ModuleExample as ModuleExample exposing (Category(..), ModuleExample, categoryForDisplay)
|
||||
import ModuleExample as ModuleExample exposing (Category(..), ModuleExample, categoryForDisplay, categoryForId)
|
||||
import Nri.Ui.Colors.V1 as Colors
|
||||
import Nri.Ui.Css.VendorPrefixed as VendorPrefixed
|
||||
import Nri.Ui.Fonts.V1 as Fonts
|
||||
@ -58,7 +58,7 @@ view_ model =
|
||||
, nriThemedModules model.moduleStates
|
||||
|> List.filter (\doodad -> category == doodad.category)
|
||||
|> List.map (ModuleExample.view True)
|
||||
|> Html.div [ class (categoryForDisplay category) ]
|
||||
|> Html.div [ id (categoryForId category) ]
|
||||
|> Html.map UpdateModuleStates
|
||||
]
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user