Merge pull request #273 from NoRedInk/tessa/link-docs

Tessa/link docs
This commit is contained in:
Tessa 2019-05-13 09:02:04 -07:00 committed by GitHub
commit 99bde371bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 5 deletions

View File

@ -29,7 +29,7 @@ type alias State value =
{-| -}
example : (Msg -> msg) -> State Value -> ModuleExample msg
example parentMessage state =
{ name = "Nri.Ui.Dropdown.V1"
{ name = "Nri.Ui.Dropdown.V2"
, category = Inputs
, content =
[ Html.Styled.map parentMessage (Nri.Ui.Dropdown.V2.view "All the foods!" state ConsoleLog)

View File

@ -41,7 +41,7 @@ type alias State value =
{-| -}
example : (Msg -> msg) -> State Value -> ModuleExample msg
example parentMessage state =
{ name = "Nri.Ui.Select.V3"
{ name = "Nri.Ui.Select.V5"
, category = Inputs
, content =
[ Html.Styled.map (parentMessage << ConsoleLog) (Select.view state)

View File

@ -142,15 +142,26 @@ view showFocusLink { name, content } =
[]
[ Html.text name ]
, if showFocusLink then
Html.a
[ Attributes.href <| "#doodad/" ++ name ]
[ Html.text "see only this" ]
viewLink "see only this" ("#doodad/" ++ name)
else
Html.text ""
, String.replace "." "-" name
|> (++) "https://package.elm-lang.org/packages/NoRedInk/noredink-ui/latest/"
|> viewLink "view docs"
]
, Html.styled Html.div
[ padding2 (px 20) zero ]
[]
content
]
viewLink : String -> String -> Html msg
viewLink text href =
Html.a
[ Attributes.href href
, Attributes.css [ Css.display Css.block ]
]
[ Html.text text
]