noredink-ui/styleguide-app/Examples/Page.elm
2020-03-31 16:35:17 -07:00

51 lines
1.5 KiB
Elm

module Examples.Page exposing (example)
{-|
@docs example
-}
import Category exposing (Category(..))
import Css
import Css.Global exposing (Snippet, adjacentSiblings, children, class, descendants, each, everything, media, selector, withClass)
import Example exposing (Example)
import Html.Styled as Html exposing (Html)
import Nri.Ui.Heading.V2 as Heading
import Nri.Ui.Page.V3 as Page
{-| -}
example : Example () ()
example =
{ name = "Nri.Ui.Page.V3"
, categories = List.singleton Pages
, state = ()
, update = \_ state -> ( state, Cmd.none )
, subscriptions = \_ -> Sub.none
, view =
\_ ->
[ Css.Global.global
[ Css.Global.selector "[data-page-container]"
[ Css.displayFlex
, Css.flexWrap Css.wrap
]
]
, Heading.h3 [] [ Html.text "Page: Not Found, recovery text: ReturnTo" ]
, Page.notFound
{ link = ()
, recoveryText = Page.ReturnTo "the main page"
}
, Heading.h3 [] [ Html.text "Page: Broken, recovery text: Reload" ]
, Page.broken
{ link = ()
, recoveryText = Page.Reload
}
, Heading.h3 [] [ Html.text "Page: No Permission, recovery text: Custom" ]
, Page.noPermission
{ link = ()
, recoveryText = Page.Custom "Hit the road, Jack"
}
]
}