All files / components/Carousel styled.tsx

100% Statements 10/10
100% Branches 0/0
100% Functions 2/2
100% Lines 10/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 421x 1x   1x           1x       5x       1x   25x           1x                 1x       1x      
import Button from "components/buttons/Button"
import styled from "styled-components"
 
export const CarouselContainer = styled.div`
  position: relative;
  overflow: hidden;
  max-width: 100%;
`
 
export const CarouselInner = styled.div<{ $translateX: number }>`
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
  transform: ${({ $translateX }) => `translateX(${$translateX}%)`};
  transition: transform 0.3s ease-out;
`
 
export const CarouselSlide = styled.div<{ $slidesToShow: number }>`
  flex: 0 0 auto;
  width: ${({ $slidesToShow }) => `calc(100% / ${$slidesToShow})`};
  display: flex;
  justify-content: center;
  align-items: center;
`
 
const NavButton = styled(Button)`
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: transparent;
  border: none;
  cursor: pointer;
`
 
export const NextButton = styled(NavButton)`
  right: 0;
`
 
export const PrevButton = styled(NavButton)`
  left: 0;
`