mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-12-01 00:34:27 +03:00
Display the network error on the styleguide
This commit is contained in:
parent
6a4b310cb1
commit
1286cdc96e
@ -1,13 +1,13 @@
|
||||
module Nri.Ui.Page.V3 exposing
|
||||
( httpError
|
||||
, DefaultPage, broken, blocked, notFound, noPermission, loggedOut, timeOut
|
||||
, DefaultPage, broken, blocked, notFound, noPermission, loggedOut, timeOut, networkError
|
||||
, RecoveryText(..)
|
||||
)
|
||||
|
||||
{-| A styled NRI page!
|
||||
|
||||
@docs httpError
|
||||
@docs DefaultPage, broken, blocked, notFound, noPermission, loggedOut, timeOut
|
||||
@docs DefaultPage, broken, blocked, notFound, noPermission, loggedOut, timeOut, networkError
|
||||
@docs RecoveryText
|
||||
|
||||
-}
|
||||
|
@ -75,30 +75,26 @@ example =
|
||||
, recoveryText = recoveryText
|
||||
}
|
||||
(Control.currentValue model.httpError)
|
||||
, Heading.h3 [] [ Html.text "Page.notFound" ]
|
||||
, Page.notFound
|
||||
{ link = ShowItWorked "Page.notFound"
|
||||
, recoveryText = recoveryText
|
||||
}
|
||||
, Heading.h3 [] [ Html.text "Page.broken" ]
|
||||
, Page.broken
|
||||
{ link = ShowItWorked "Page.broken"
|
||||
, recoveryText = recoveryText
|
||||
}
|
||||
, Heading.h3 [] [ Html.text "Page.noPermission" ]
|
||||
, Page.noPermission
|
||||
{ link = ShowItWorked "Page.noPermission"
|
||||
, recoveryText = recoveryText
|
||||
}
|
||||
, Heading.h3 [] [ Html.text "Page.loggedOut" ]
|
||||
, Page.loggedOut
|
||||
{ link = ShowItWorked "Page.loggedOut Custom"
|
||||
, recoveryText = recoveryText
|
||||
}
|
||||
, viewExample "Page.broken" Page.broken recoveryText
|
||||
|
||||
--, viewExample "Page.blocked" Page.blocked recoveryText
|
||||
, viewExample "Page.notFound" Page.notFound recoveryText
|
||||
, viewExample "Page.noPermission" Page.noPermission recoveryText
|
||||
, viewExample "Page.loggedOut" Page.loggedOut recoveryText
|
||||
, viewExample "Page.timeOut" Page.timeOut recoveryText
|
||||
, viewExample "Page.networkError" Page.networkError recoveryText
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
viewExample : String -> (Page.DefaultPage Msg -> Html Msg) -> RecoveryText -> Html Msg
|
||||
viewExample viewName view recoveryText =
|
||||
Html.div []
|
||||
[ Heading.h3 [] [ Html.text viewName ]
|
||||
, view { link = ShowItWorked viewName, recoveryText = recoveryText }
|
||||
]
|
||||
|
||||
|
||||
initHttpError : Control Http.Error
|
||||
initHttpError =
|
||||
Control.choice
|
||||
|
Loading…
Reference in New Issue
Block a user