123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- import Carousel from 'react-material-ui-carousel'
- import { Box } from '@mui/system';
- import { url } from '../../App';
- // карусель
- export function MyCarouselPost({ postImages }) {
- // console.log('postImages: ', postImages)
- return (postImages &&
- <Carousel
- autoPlay={false}
- cycleNavigation={false}
- animation={"slide"}
- indicatorContainerProps={{
- style: {
- marginTop: '-50px',
- zIndex: 999,
- position: 'inherit'
- }
- }}
- className='myCarousel'
- sx={{
- // flexDirection: 'column',
- // flex: '1 1 auto',
- width: '100%',
- height: '100%',
- }}
- >
- {
- postImages.map(item =>
- // <Box
- // sx={{
- // paddingTop: '100%',
- // backgroundSize: 'contain',
- // backgroundColor: 'black',
- // backgroundImage: `url(/images/noPhoto.png)`,
- // backgroundRepeat: 'no-repeat',
- // backgroundPosition: 'center',
- // }}
- // key={item?.url}
- // style={item?.url &&
- // { backgroundImage: `url(${url + item.url})` }
- // }
- // />
- <Box sx={{
- width: '100%',
- height: '743px',
- overflow: 'hidden',
- position: 'relative'
- }}
- key={item?.url}
- >
- <img
- style={{
- position: 'absolute',
- top: '50%',
- left: '50%',
- transform: 'translate(-50%, -50%)',
- width: '100%',
- height: '100%',
- objectFit: 'contain',
- objectPosition: 'center'
- }}
- src={url + item.url}
- />
- </Box>
- )
- }
- </Carousel >
- )
- }
|