Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions .babelrc

This file was deleted.

19 changes: 19 additions & 0 deletions babel.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
presets: [
["@babel/preset-env", {
modules: false,
targets: {
browsers: [">0.2%", "not dead", "not op_mini all"]
}
}],
["@babel/preset-react", {
runtime: "automatic"
}]
],
plugins: [
"@babel/plugin-proposal-class-properties",
["@babel/plugin-transform-runtime", {
regenerator: true
}]
]
};
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@itseasy21/react-elastic-carousel",
"version": "1.0.1",
"version": "1.0.2",
"description": "A flexible and responsive carousel component for react",
"author": "itseasy21",
"type": "module",
Expand Down Expand Up @@ -50,7 +50,6 @@
"*.js": "eslint src/. --fix"
},
"dependencies": {
"@uiw/react-only-when": "^1.0.6",
"classnames": "^2.3.2",
"prop-types": "^15.8.1",
"react-swipeable": "^7.0.2",
Expand Down
22 changes: 9 additions & 13 deletions src/@itseasy21/react-elastic-carousel/components/Carousel.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { Children } from "react";
import PropTypes from "prop-types";
import ResizeObserver from "resize-observer-polyfill";
import Only from "@uiw/react-only-when";
import Track from "./Track";
import Arrow from "./Arrow";
import consts from "../consts";
Expand Down Expand Up @@ -826,8 +825,8 @@ class Carousel extends React.Component {
className={cssPrefix("carousel")}
size={{ height: rootHeight }}
>
<Only when={showArrows}>
{renderArrow ? (
{showArrows &&
(renderArrow ? (
renderArrow({
type: consts.PREV,
onClick: this.onPrevStart,
Expand All @@ -839,8 +838,7 @@ class Carousel extends React.Component {
direction={verticalMode ? Arrow.up : Arrow.left}
disabled={disabledPrevArrow}
/>
)}
</Only>
))}
<SliderContainer
className={cssPrefix("slider-container")}
ref={this.setRef("sliderContainer")}
Expand Down Expand Up @@ -877,8 +875,8 @@ class Carousel extends React.Component {
/>
</Slider>
</SliderContainer>
<Only when={showArrows}>
{renderArrow ? (
{showArrows &&
(renderArrow ? (
renderArrow({
type: consts.NEXT,
onClick: this.onNextStart,
Expand All @@ -890,11 +888,10 @@ class Carousel extends React.Component {
direction={verticalMode ? Arrow.down : Arrow.right}
disabled={disabledNextArrow}
/>
)}
</Only>
))}
</StyledCarousel>
<Only when={pagination}>
{renderPagination ? (
{pagination &&
(renderPagination ? (
renderPagination({
pages: pages,
activePage,
Expand All @@ -906,8 +903,7 @@ class Carousel extends React.Component {
activePage={activePage}
onClick={this.onIndicatorClick}
/>
)}
</Only>
))}
</CarouselWrapper>
);
}
Expand Down
Loading