@@ -15,15 +15,17 @@ import {
1515 IBasicBookInfo ,
1616} from "../connection/LibraryQueryHooks" ;
1717import { BookCard , useBookCardSpec } from "./BookCard" ;
18- import { SingleRowCardSwiper } from "./SingleRowCardSwiper" ;
1918import { useResponsiveChoice } from "../responsiveUtilities" ;
2019import { BookOrderingScheme } from "../model/ContentInterfaces" ;
20+ import { CardSwiperLazy } from "./CardSwiper" ;
2121
2222interface IProps {
2323 title : string ;
2424 order ?: string ;
2525 // I don't know... this could be "bookLimit" instead "rows". Have to think in terms
2626 // of mobile versus big screen.... hmmm...
27+ // Warning: if rows is 1 or unspecified, BookGroup shows a swiper row; this does not seem to be
28+ // working well at least in our stories, but it is not used in the real website as of Sep 2022.
2729 rows ?: number ;
2830
2931 contextLangIso ?: string ;
@@ -172,10 +174,24 @@ export const BookGroupInner: React.FunctionComponent<IProps> = (props) => {
172174 // );
173175 // }
174176
175- // JH Jan 2020: I cannot find anywhere that this is showInOne Row is used.
176- // It's also puzzling that it has to have its own CardSwiper implementation.
177+ // JT Sep 2022: showInOneRow is true only when BookGroup is either told to show exactly one row, or
178+ // not told how many rows to show. Currently this happens only in the various stories which were written
179+ // early on to test it; the only real use of BookGroup is in ByLanguageGroups, which passes 999.
180+ // When I tried the stories in Sep 2022, they were working very badly: showing a set of cards
181+ // with no spacing. I wanted to retire the obsolete SingleRowCardSwiper, so I switched this rather crudely
182+ // to use our current CardSwiperLazy. This looks a bit better but the book cards are not getting their
183+ // images. Since this currently only shows up in test stories that we don't seem to be using, I decided
184+ // not to try to fix it.
185+ const cardSpec = useBookCardSpec ( ) ;
177186 const bookList = showInOneRow ? (
178- < SingleRowCardSwiper wrapperRole = "list" > { cards } </ SingleRowCardSwiper >
187+ < CardSwiperLazy
188+ data = { cards }
189+ getReactElement = { ( x ) => x }
190+ wrapperRole = "list"
191+ cardSpec = { cardSpec }
192+ >
193+ { cards }
194+ </ CardSwiperLazy >
179195 ) : (
180196 < div
181197 css = { css `
0 commit comments