Display the network error on the styleguide

This commit is contained in:
Tessa Kelly 2021-05-13 09:47:35 -07:00
parent 6a4b310cb1
commit 1286cdc96e
2 changed files with 18 additions and 22 deletions

View File

@ -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
-}

View File

@ -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