Message.V1 replaces Alert.V4.success

This commit is contained in:
Aaron VonderHaar 2020-04-27 15:22:43 -07:00
parent cad02d44b9
commit a78b29f7ba
3 changed files with 22 additions and 5 deletions

View File

@ -10,5 +10,9 @@ upgrade_Nri_Ui_Alert_V4_error content =
Message.tiny Message.Error (Message.Markdown content) Message.tiny Message.Error (Message.Markdown content)
upgrade_Nri_Ui_Alert_V4_success content =
Message.tiny Message.Success (Message.Markdown content)
upgrade_Nri_Ui_Alert_V4_somethingWentWrong errorMessageForEngineers = upgrade_Nri_Ui_Alert_V4_somethingWentWrong errorMessageForEngineers =
Message.somethingWentWrong errorMessageForEngineers Message.somethingWentWrong errorMessageForEngineers

View File

@ -22,12 +22,13 @@ import Markdown
import Nri.Ui import Nri.Ui
import Nri.Ui.Colors.V1 as Colors import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Fonts.V1 as Fonts import Nri.Ui.Fonts.V1 as Fonts
import Nri.Ui.SpriteSheet exposing (exclamationMark) import Nri.Ui.SpriteSheet as SpriteSheet exposing (exclamationMark)
import Nri.Ui.Svg.V1 as NriSvg exposing (Svg) import Nri.Ui.Svg.V1 as NriSvg exposing (Svg)
type Theme type Theme
= Error = Error
| Success
type Content msg type Content msg
@ -45,9 +46,21 @@ tiny theme content =
[ exclamation Colors.purple [ exclamation Colors.purple
, alertString Colors.purple content , alertString Colors.purple content
] ]
Success ->
[ iconContainer
[ Css.color Colors.white
, Css.backgroundColor Colors.green
]
(Html.div
[ css [ Css.width (Css.px 12), Css.marginTop (Css.px 1) ] ]
[ NriSvg.toHtml SpriteSheet.checkmark ]
)
, alertString Colors.greenDarkest content
]
in in
Nri.Ui.styled Html.div Nri.Ui.styled Html.div
"Nri-Ui-Alert-V3__alert" "Nri-Ui-Message-V1--alert"
[ Css.displayFlex [ Css.displayFlex
, Css.justifyContent Css.start , Css.justifyContent Css.start
, Css.alignItems Css.flexStart , Css.alignItems Css.flexStart
@ -113,7 +126,7 @@ exclamation backgroundColor =
iconContainer : List Css.Style -> Html msg -> Html msg iconContainer : List Css.Style -> Html msg -> Html msg
iconContainer styles icon = iconContainer styles icon =
Nri.Ui.styled Html.div Nri.Ui.styled Html.div
"Nri-Ui-Alert-V4__iconContainer" "Nri-Ui-Message-V1--iconContainer"
(styles (styles
++ [ -- Content positioning ++ [ -- Content positioning
Css.displayFlex Css.displayFlex
@ -148,7 +161,7 @@ alertString color content =
[ html ] [ html ]
in in
Nri.Ui.styled Html.div Nri.Ui.styled Html.div
"Nri-Ui-Alert-V4--alert" "Nri-Ui-Message-V1--alert"
[ Css.color color [ Css.color color
, Fonts.baseFont , Fonts.baseFont
, Css.fontSize (Css.px 13) , Css.fontSize (Css.px 13)

View File

@ -53,7 +53,7 @@ example =
, Message.tiny Message.Error (Message.Markdown "This is an **error**") , Message.tiny Message.Error (Message.Markdown "This is an **error**")
, Alert.warning "This is a **warning**" , Alert.warning "This is a **warning**"
, Alert.tip "This is a **tip**" , Alert.tip "This is a **tip**"
, Alert.success "This is a **success**" , Message.tiny Message.Success (Message.Markdown "This is a **success**")
, Html.hr [] [] , Html.hr [] []
, Heading.h3 [] [ text "Message.somethingWentWrong" ] , Heading.h3 [] [ text "Message.somethingWentWrong" ]
, Message.somethingWentWrong exampleRailsError , Message.somethingWentWrong exampleRailsError