2020-04-01 02:00:29 +03:00
|
|
|
module Examples.Page exposing (example, State, Msg)
|
2018-05-01 18:34:16 +03:00
|
|
|
|
|
|
|
{-|
|
|
|
|
|
2020-04-01 02:00:29 +03:00
|
|
|
@docs example, State, Msg
|
2018-05-01 18:34:16 +03:00
|
|
|
|
|
|
|
-}
|
|
|
|
|
2020-03-24 03:33:42 +03:00
|
|
|
import Category exposing (Category(..))
|
2018-05-01 18:34:16 +03:00
|
|
|
import Css
|
2018-11-13 02:38:19 +03:00
|
|
|
import Css.Global exposing (Snippet, adjacentSiblings, children, class, descendants, each, everything, media, selector, withClass)
|
2020-03-31 23:33:05 +03:00
|
|
|
import Example exposing (Example)
|
2018-10-23 19:55:30 +03:00
|
|
|
import Html.Styled as Html exposing (Html)
|
2019-07-23 17:58:23 +03:00
|
|
|
import Nri.Ui.Heading.V2 as Heading
|
2019-05-14 02:04:10 +03:00
|
|
|
import Nri.Ui.Page.V3 as Page
|
2018-05-01 18:34:16 +03:00
|
|
|
|
|
|
|
|
|
|
|
{-| -}
|
2020-04-01 02:00:29 +03:00
|
|
|
type alias State =
|
2020-04-03 20:10:26 +03:00
|
|
|
()
|
2020-04-01 02:00:29 +03:00
|
|
|
|
|
|
|
|
|
|
|
{-| -}
|
2020-04-03 20:10:26 +03:00
|
|
|
type alias Msg =
|
|
|
|
String
|
2020-04-01 02:00:29 +03:00
|
|
|
|
|
|
|
|
|
|
|
{-| -}
|
|
|
|
example : Example State Msg
|
2020-03-31 23:33:05 +03:00
|
|
|
example =
|
2019-05-14 02:04:10 +03:00
|
|
|
{ name = "Nri.Ui.Page.V3"
|
2020-03-31 23:33:05 +03:00
|
|
|
, categories = List.singleton Pages
|
2020-04-03 20:10:26 +03:00
|
|
|
, state = ()
|
|
|
|
, update =
|
|
|
|
\msg model ->
|
|
|
|
let
|
|
|
|
_ =
|
|
|
|
Debug.log "Clicked: " msg
|
|
|
|
in
|
|
|
|
( model, Cmd.none )
|
|
|
|
, subscriptions = \_ -> Sub.none
|
2020-03-31 23:33:05 +03:00
|
|
|
, view =
|
2020-04-03 20:10:26 +03:00
|
|
|
\_ ->
|
2020-03-31 23:33:05 +03:00
|
|
|
[ Css.Global.global
|
2020-04-14 02:14:51 +03:00
|
|
|
[ selector "[data-page-container]"
|
2020-03-31 23:33:05 +03:00
|
|
|
[ Css.displayFlex
|
|
|
|
, Css.flexWrap Css.wrap
|
|
|
|
]
|
2018-10-23 19:55:30 +03:00
|
|
|
]
|
2020-03-31 23:33:05 +03:00
|
|
|
, Heading.h3 [] [ Html.text "Page: Not Found, recovery text: ReturnTo" ]
|
|
|
|
, Page.notFound
|
2020-04-03 20:10:26 +03:00
|
|
|
{ link = "Page.notFound ReturnTo"
|
2020-03-31 23:33:05 +03:00
|
|
|
, recoveryText = Page.ReturnTo "the main page"
|
|
|
|
}
|
|
|
|
, Heading.h3 [] [ Html.text "Page: Broken, recovery text: Reload" ]
|
|
|
|
, Page.broken
|
2020-04-03 20:10:26 +03:00
|
|
|
{ link = "Page.broken Reload"
|
2020-03-31 23:33:05 +03:00
|
|
|
, recoveryText = Page.Reload
|
|
|
|
}
|
|
|
|
, Heading.h3 [] [ Html.text "Page: No Permission, recovery text: Custom" ]
|
|
|
|
, Page.noPermission
|
2020-04-03 20:10:26 +03:00
|
|
|
{ link = "Page.noPermission Custom"
|
2020-03-31 23:33:05 +03:00
|
|
|
, recoveryText = Page.Custom "Hit the road, Jack"
|
|
|
|
}
|
2018-10-23 19:55:30 +03:00
|
|
|
]
|
2018-05-01 18:34:16 +03:00
|
|
|
}
|