Fixed: Navigation for cast and crew

pull/6949/merge
Bogdan 1 year ago
parent bdc4aade0f
commit 213620cb29

@ -9,3 +9,9 @@
.container { .container {
padding: 10px; padding: 10px;
} }
.sliderContainer {
--swiper-navigation-color: var(--white);
display: block;
}

@ -4,6 +4,7 @@ interface CssExports {
'container': string; 'container': string;
'grid': string; 'grid': string;
'movie': string; 'movie': string;
'sliderContainer': string;
} }
export const cssExports: CssExports; export const cssExports: CssExports;
export default cssExports; export default cssExports;

@ -66,32 +66,8 @@ class MovieCreditPosters extends Component {
posterHeight: 238, posterHeight: 238,
rowHeight: calculateRowHeight(238, props.isSmallScreen) rowHeight: calculateRowHeight(238, props.isSmallScreen)
}; };
this._isInitialized = false;
} }
//
// Control
calculateGrid = (width = this.state.width, isSmallScreen) => {
const padding = isSmallScreen ? columnPaddingSmallScreen : columnPadding;
const columnWidth = calculateColumnWidth(width, 'small', isSmallScreen);
const columnCount = Math.max(Math.floor(width / columnWidth), 1);
const posterWidth = columnWidth - padding;
const posterHeight = calculatePosterHeight(posterWidth);
const rowHeight = calculateRowHeight(posterHeight, isSmallScreen);
this.setState({
width,
columnWidth,
columnCount,
posterWidth,
posterHeight,
rowHeight
});
};
// //
// Render // Render
@ -114,13 +90,12 @@ class MovieCreditPosters extends Component {
slidesPerView='auto' slidesPerView='auto'
spaceBetween={10} spaceBetween={10}
slidesPerGroup={3} slidesPerGroup={3}
navigation={true}
loop={false} loop={false}
loopFillGroupWithBlank={true} loopFillGroupWithBlank={true}
className="mySwiper" className="mySwiper"
modules={[Navigation]} modules={[Navigation]}
onInit={(swiper) => { onInit={(swiper) => {
swiper.params.navigation.prevEl = this._swiperPrevRef;
swiper.params.navigation.nextEl = this._swiperNextRef;
swiper.navigation.init(); swiper.navigation.init();
swiper.navigation.update(); swiper.navigation.update();
}} }}

Loading…
Cancel
Save