@@ -13,10 +13,11 @@ import "swiper/components/a11y/a11y.min.css";
1313import { useResponsiveChoice } from "../responsiveUtilities" ;
1414import { ICardSpec } from "./CardGroup" ;
1515import { commonUI } from "../theme" ;
16+ import { ICardSwiperProps } from "./CardSwiperCodeSplit" ;
1617
1718SwiperCore . use ( [ Navigation , A11y ] ) ;
1819
19- export const swiperConfig : Swiper = {
20+ const swiperConfig : Swiper = {
2021 preloadImages : false ,
2122 lazy : {
2223 loadPrevNext : true ,
@@ -48,22 +49,7 @@ export const swiperConfig: Swiper = {
4849// small windows.
4950// Enhance: this could be made generic, with a type param indicating that the type of objects in data
5051// is the same as the type passed as the first argument of getReactElement
51- export const CardSwiperLazy : React . FunctionComponent < {
52- data : any [ ] ;
53- // Given one of the items in data (and its index), return the react element that should be
54- // shown for that card when it is visible.
55- getReactElement : ( card : any , index : number ) => ReactElement ;
56-
57- // Typically the swiper is a list. I can't find a way to configure it so that the element containing
58- // the cards is a UL, but by setting this to 'list' and making items with role listitem we achieve
59- // the same accessibility goals. This role becomes the value of the role attribute of the swiper
60- // wrapper element, which is the immediate parent of the items. Note that it's not always a list, e.g.,
61- // in the LanguageGroup a further-out element is a listbox and the items have role 'option'.
62- // If you set a wrapperRole, make sure the children you pass have role listitem.
63- wrapperRole ?: string ;
64-
65- cardSpec : ICardSpec ;
66- } > = ( props ) => {
52+ const CardSwiperLazy : React . FunctionComponent < ICardSwiperProps > = ( props ) => {
6753 const [ swiper , setSwiper ] = useState < any | null > ( null ) ;
6854 const getResponsiveChoice = useResponsiveChoice ( ) ;
6955 const [ showAll , setShowAll ] = useState ( false ) ;
@@ -212,3 +198,5 @@ export const CardSwiperLazy: React.FunctionComponent<{
212198 </ Swiper >
213199 ) ;
214200} ;
201+
202+ export default CardSwiperLazy ;
0 commit comments