mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2025-01-01 19:09:01 +03:00
Expect svg to be passed through to the custom banner
This commit is contained in:
parent
d58f49f0c4
commit
0b05b192d7
@ -37,7 +37,7 @@ import Nri.Ui.UiIcon.V1 as UiIcon
|
||||
-}
|
||||
alert : List (Html msg) -> Maybe msg -> Html msg
|
||||
alert content maybeDismiss =
|
||||
custom
|
||||
banner
|
||||
{ backgroundColor = Colors.sunshine
|
||||
, color = Colors.navy
|
||||
, icon =
|
||||
@ -56,7 +56,7 @@ alert content maybeDismiss =
|
||||
-}
|
||||
error : List (Html msg) -> Maybe msg -> Html msg
|
||||
error content maybeDismiss =
|
||||
custom
|
||||
banner
|
||||
{ backgroundColor = Colors.purpleLight
|
||||
, color = Colors.purpleDark
|
||||
, icon =
|
||||
@ -75,7 +75,7 @@ error content maybeDismiss =
|
||||
-}
|
||||
neutral : List (Html msg) -> Maybe msg -> Html msg
|
||||
neutral content maybeDismiss =
|
||||
custom
|
||||
banner
|
||||
{ backgroundColor = Colors.frost
|
||||
, color = Colors.navy
|
||||
, icon =
|
||||
@ -94,7 +94,7 @@ neutral content maybeDismiss =
|
||||
-}
|
||||
success : List (Html msg) -> Maybe msg -> Html msg
|
||||
success content maybeDismiss =
|
||||
custom
|
||||
banner
|
||||
{ backgroundColor = Colors.greenLightest
|
||||
, color = Colors.greenDarkest
|
||||
, icon =
|
||||
@ -114,12 +114,30 @@ success content maybeDismiss =
|
||||
custom :
|
||||
{ color : Css.Color
|
||||
, backgroundColor : Css.Color
|
||||
, icon : Html Never
|
||||
, icon : Svg
|
||||
, content : List (Html msg)
|
||||
, dismiss : Maybe msg
|
||||
}
|
||||
-> Html msg
|
||||
custom config =
|
||||
banner
|
||||
{ color = config.color
|
||||
, backgroundColor = config.backgroundColor
|
||||
, icon = Svg.toHtml config.icon
|
||||
, content = config.content
|
||||
, dismiss = config.dismiss
|
||||
}
|
||||
|
||||
|
||||
banner :
|
||||
{ color : Css.Color
|
||||
, backgroundColor : Css.Color
|
||||
, icon : Html Never
|
||||
, content : List (Html msg)
|
||||
, dismiss : Maybe msg
|
||||
}
|
||||
-> Html msg
|
||||
banner config =
|
||||
let
|
||||
maybeDismissButton =
|
||||
case config.dismiss of
|
||||
|
@ -48,7 +48,7 @@ example parentMsg state =
|
||||
, BannerAlert.custom
|
||||
{ color = Colors.aquaDark
|
||||
, backgroundColor = Colors.gray92
|
||||
, icon = Svg.toHtml Pennant.premiumFlag
|
||||
, icon = Pennant.premiumFlag
|
||||
, content = [ text "This is a a custom message!" ]
|
||||
, dismiss = Nothing
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user