Use the icon in the alert view

This commit is contained in:
Tessa Kelly 2019-03-28 14:00:53 -07:00
parent 63eb368e1c
commit b78bc61a4d
4 changed files with 12 additions and 6 deletions

View File

@ -24,14 +24,19 @@ import Nri.Ui
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Fonts.V1 as Fonts
import Nri.Ui.Icon.V3 as Icon
import Nri.Ui.SpriteSheet exposing (exclamationMark)
import Nri.Ui.Svg.V1 as NriSvg exposing (Svg)
{-| -}
error : { r | exclamation : String } -> String -> Html msg
error assets content =
error : String -> Html msg
error content =
alert
[ iconContainer [ Css.color Colors.purple ]
(Icon.decorativeIcon (Icon.exclamation assets))
[ iconContainer
[ Css.color Colors.purple
, Css.height (Css.px 20)
]
(NriSvg.toHtml exclamationMark)
, viewAlertContent Colors.purpleDark content
]

View File

@ -104,6 +104,7 @@ icon config =
Html.div
[ css
[ Css.borderRadius (Css.pct 50)
, Css.color Colors.white
, Css.displayFlex
, Css.alignItems Css.center
, Css.justifyContent Css.center

View File

@ -19,7 +19,7 @@ exclamationMark =
[ viewBox "0 0 4 12", width "100%", height "100%" ]
[ Svg.path
[ d "M3.234 10.575a1.363 1.363 0 1 1-2.726 0 1.363 1.363 0 0 1 2.726 0zm.648-8.398a1.978 1.978 0 0 1-.007.047l-.834 5.294c-.079.53-.542.926-1.085.926h-.013a1.096 1.096 0 0 1-1.085-.926L.024 2.224A1.93 1.93 0 0 1 1.93 0h.04a1.94 1.94 0 0 1 1.912 1.663v.514z"
, fill "#FFF"
, fill "currentcolor"
, fillRule "evenodd"
]
[]

View File

@ -16,7 +16,7 @@ example =
{ filename = "Nri.Ui.Alert.V3.elm"
, category = Messaging
, content =
[ Alert.error assets "This is an error"
[ Alert.error "This is an error"
, Alert.warning assets "This is a warning"
, Alert.tip assets "This is a tip"
, Alert.success assets "This is a success"