From 809d7e463a443b4b87edec76454dd5fcdc693efc Mon Sep 17 00:00:00 2001 From: "Brian J. Cardiff" Date: Fri, 11 Mar 2022 14:54:58 -0300 Subject: [PATCH] RadioButton: Rename onLockedPennantClick to onLockedClick --- src/Nri/Ui/RadioButton/V4.elm | 22 +++++++++++----------- styleguide-app/Examples/RadioButton.elm | 10 +++++----- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Nri/Ui/RadioButton/V4.elm b/src/Nri/Ui/RadioButton/V4.elm index a1cf05d0..ab2226c9 100644 --- a/src/Nri/Ui/RadioButton/V4.elm +++ b/src/Nri/Ui/RadioButton/V4.elm @@ -1,6 +1,6 @@ module Nri.Ui.RadioButton.V4 exposing ( view - , premium, onLockedPennantClick + , premium, onLockedClick , disclosure , onSelect , Attribute @@ -12,14 +12,14 @@ module Nri.Ui.RadioButton.V4 exposing {-| Changes from V3: - use PremiumDisplay instead of PremiumLevel - - rename showPennant to onLockedPennantClick since its display depends on premium now + - rename showPennant to onLockedClick since its display depends on premium now @docs view ### Content -@docs premium, onLockedPennantClick +@docs premium, onLockedClick @docs disclosure @@ -116,9 +116,9 @@ premium premiumDisplay = When the pennant is clicked, the msg that's passed in will fire. -} -onLockedPennantClick : msg -> Attribute value msg -onLockedPennantClick premiumMsg = - Attribute <| \config -> { config | premiumMsg = Just premiumMsg } +onLockedClick : msg -> Attribute value msg +onLockedClick onLockedMsg = + Attribute <| \config -> { config | onLockedMsg = Just onLockedMsg } {-| Content that shows when this RadioButton is selected @@ -213,7 +213,7 @@ type alias Config value msg = , labelCss : List Css.Style , custom : List (Html.Attribute Never) , onSelect : Maybe (value -> msg) - , premiumMsg : Maybe msg + , onLockedMsg : Maybe msg , disclosedContent : List (Html msg) } @@ -231,7 +231,7 @@ emptyConfig = , labelCss = [] , custom = [] , onSelect = Nothing - , premiumMsg = Nothing + , onLockedMsg = Nothing , disclosedContent = [] } @@ -405,15 +405,15 @@ view { label, name, value, valueToString, selectedValue } attributes = config.labelCss ] [ Html.text label ] - , case ( config.premiumDisplay, config.premiumMsg ) of + , case ( config.premiumDisplay, config.onLockedMsg ) of ( PremiumDisplay.Free, _ ) -> text "" ( PremiumDisplay.PremiumUnlocked, _ ) -> premiumPennant Nothing - ( PremiumDisplay.PremiumLocked, premiumMsg ) -> - premiumPennant premiumMsg + ( PremiumDisplay.PremiumLocked, onLockedMsg ) -> + premiumPennant onLockedMsg ] ] , InputErrorAndGuidanceInternal.view idValue config diff --git a/styleguide-app/Examples/RadioButton.elm b/styleguide-app/Examples/RadioButton.elm index dbd8c457..e795c925 100644 --- a/styleguide-app/Examples/RadioButton.elm +++ b/styleguide-app/Examples/RadioButton.elm @@ -239,7 +239,7 @@ controlAttributes = ControlExtra.list |> ControlExtra.optionalListItem "visibility" labelVisibility |> ControlExtra.optionalListItem "status" disabledOrEnabled - |> ControlExtra.optionalListItem "onLockedPennantClick" onLockedPennantClick + |> ControlExtra.optionalListItem "onLockedClick" onLockedClick |> ControlExtra.optionalListItem "premium" -- TODO: allow the teacher premium level to vary as well: (Control.map @@ -329,11 +329,11 @@ disabledOrEnabled = ] -onLockedPennantClick : Control ( String, RadioButton.Attribute Selection Msg ) -onLockedPennantClick = +onLockedClick : Control ( String, RadioButton.Attribute Selection Msg ) +onLockedClick = Control.value - ( "RadioButton.onLockedPennantClick OpenPremiumModal" - , RadioButton.onLockedPennantClick (OpenModal "dogs") + ( "RadioButton.onLockedClick OpenPremiumModal" + , RadioButton.onLockedClick (OpenModal "dogs") )