🎨 don't use extensible record for viewWithTabControls

mostly for consistency with the other use cases. changing it helped me
realize we were passing an extra attribute in a test so that's a good
sign I guess!
This commit is contained in:
Juan Edi 2023-09-05 15:03:11 -03:00
parent 76edaed8b8
commit d039512615
2 changed files with 26 additions and 19 deletions

View File

@ -137,23 +137,22 @@ Returns:
-}
viewWithTabControls :
{ cfg
| selected : id
, slides :
List
{ id : id
, idString : String
, name : String
, visibleLabelId : Maybe String
, slideHtml : Html msg
, tabControlHtml : Html Never
}
, tabControlStyles : Bool -> List Style
, tabControlListStyles : List Style
, role : Role
, name : String
, visibleLabelId : Maybe String
, focusAndSelect : { select : id, focus : Maybe String } -> msg
{ selected : id
, slides :
List
{ id : id
, idString : String
, name : String
, visibleLabelId : Maybe String
, slideHtml : Html msg
, tabControlHtml : Html Never
}
, tabControlStyles : Bool -> List Style
, tabControlListStyles : List Style
, role : Role
, name : String
, visibleLabelId : Maybe String
, focusAndSelect : { select : id, focus : Maybe String } -> msg
}
->
{ controls : Html msg
@ -227,7 +226,16 @@ viewWithCombinedControls :
viewWithCombinedControls config =
let
{ controls, slides, containerAttributes } =
viewWithTabControls config
viewWithTabControls
{ selected = config.selected
, slides = config.slides
, tabControlStyles = config.tabControlStyles
, tabControlListStyles = config.tabControlListStyles
, role = config.role
, name = config.name
, visibleLabelId = config.visibleLabelId
, focusAndSelect = config.focusAndSelect
}
{ viewPreviousButton, viewNextButton } =
case findPreviousAndNextSlides .id config of

View File

@ -278,7 +278,6 @@ viewWithTabControlsSpec =
VisibleLabel ->
Just "carousel-label"
, focusAndSelect = FocusAndSelect
, announceAndSelect = AnnounceAndSelect
}
|> (\{ controls, slides, containerAttributes } ->
section containerAttributes [ slides, controls ]