publish version 1.0.2

master
Hasan Genc 5 years ago
parent a9ddce292e
commit 18d8f8206e
  1. 2
      package.json
  2. 7
      src/components/arrow/index.tsx
  3. 10
      src/components/carousel/index.tsx
  4. 2
      website/docs/scrollingCarousel.md

@ -1,6 +1,6 @@
{
"name": "@trendyol-js/react-carousel",
"version": "1.0.1",
"version": "1.0.2",
"description": "Lightweight carousel component for react",
"main": "dist/cjs/index.js",
"module": "dist/es/index.js",

@ -2,8 +2,13 @@ import React, { FunctionComponent } from 'react';
import styles from '../../styles/styles.module.css';
export const Arrow: FunctionComponent<ArrowProps> = (props: ArrowProps) => (
<button className={styles.carouselArrow} onClick={props.onClick}></button>
<button
className={styles.carouselArrow}
onClick={props.onClick}
data-direction={props.direction}
/>
);
export interface ArrowProps {
onClick: (...args: any) => any;
direction: string;
}

@ -112,7 +112,10 @@ export const Carousel: FunctionComponent<CarouselProps> = (userProps: CarouselPr
className={`${styles.carouselBase} ${props.className}`}
>
{showArrow.left && (
<Arrow onClick={() => slide(SlideDirection.Left, props.slide)} />
<Arrow
direction="left"
onClick={() => slide(SlideDirection.Left, props.slide)}
/>
)}
<ItemProvider
{...props}
@ -124,7 +127,10 @@ export const Carousel: FunctionComponent<CarouselProps> = (userProps: CarouselPr
widthCallBack={widthCallBack}
/>
{showArrow.right && (
<Arrow onClick={() => slide(SlideDirection.Right, props.slide)} />
<Arrow
direction="right"
onClick={() => slide(SlideDirection.Right, props.slide)}
/>
)}
</div>
);

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save