Skip to content

Commit

Permalink
Merge pull request vercel#9 from okbel/arzafran/fix-pdp-arrows
Browse files Browse the repository at this point in the history
Change Arrows on PDP slider
  • Loading branch information
Francam94 committed Oct 23, 2020
2 parents ef2d647 + 0bbc4df commit 64af8c1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 19 deletions.
18 changes: 6 additions & 12 deletions components/product/ProductSlider/ProductSlider.module.css
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
.root {
@apply relative w-full h-full relative;
@apply relative w-full h-full;
overflow-y: hidden;
}

.leftControl,
.rightControl {
@apply text-white text-xl absolute top-1/2 -translate-x-1/2 z-20 w-16 h-16 flex items-center justify-center bg-hover-1 rounded-full focus:outline-none focus:shadow-outline-blue hover:bg-hover-2;
@apply absolute top-1/2 -translate-x-1/2 z-20 w-16 h-16 flex items-center justify-center bg-hover-1 rounded-full focus:outline-none focus:shadow-outline-blue hover:bg-hover-2;
}

.leftControl {
@apply left-6;
@apply bg-cover left-10 md:left-6;
background-image: url('public/cursor-left.png');
}

.rightControl {
@apply right-6;
@apply bg-cover right-10 md:right-6;
background-image: url('public/cursor-right.png');
}

.control {
Expand Down Expand Up @@ -66,11 +68,3 @@
.positionIndicatorActive:hover .dot {
@apply bg-white;
}
/* sx={{
width: '10px',
height: '10px',
bg: currentSlide === idx ? 'primary' : 'gray',
borderRadius: 'full',
mx: 2,
'&:focus': { outline: 'none' },
}} */
13 changes: 6 additions & 7 deletions components/product/ProductSlider/ProductSlider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useKeenSlider } from 'keen-slider/react'
import Image from 'next/image'
import React, { Children, FC, isValidElement, useState } from 'react'
import { HiChevronLeft, HiChevronRight } from 'react-icons/hi'
import cn from 'classnames'

import s from './ProductSlider.module.css'
Expand All @@ -20,12 +20,11 @@ const ProductSlider: FC = ({ children }) => {

return (
<div className={s.root}>
<button className={cn(s.leftControl, s.control)} onClick={slider?.prev}>
<HiChevronLeft />
</button>
<button className={cn(s.rightControl, s.control)} onClick={slider?.next}>
<HiChevronRight />
</button>
<button className={cn(s.leftControl, s.control)} onClick={slider?.prev} />
<button
className={cn(s.rightControl, s.control)}
onClick={slider?.next}
/>
<div
ref={ref}
className="keen-slider h-full transition-opacity duration-150"
Expand Down
Binary file modified public/cursor-left.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/cursor-right.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 64af8c1

Please sign in to comment.