l-min-components 1.0.1094 → 1.0.1096
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,40 +1,35 @@
|
|
|
1
1
|
import React, { useContext, useRef } from "react";
|
|
2
|
-
import { DevBannerWrapper } from "./styles";
|
|
2
|
+
import { DevBannerWrapper, DotHolder } from "./styles";
|
|
3
3
|
import BannerImg from "./assets/book.png";
|
|
4
4
|
import BannerImg2 from "./assets/pack.png";
|
|
5
5
|
import BannerImg3 from "./assets/globe.png";
|
|
6
6
|
import Button from "../button";
|
|
7
|
-
// import Slider from "react-slick";
|
|
8
|
-
// import "slick-carousel/slick/slick.css";
|
|
9
|
-
// import "slick-carousel/slick/slick-theme.css";
|
|
10
7
|
import "pure-react-carousel/dist/react-carousel.es.css";
|
|
11
|
-
import {
|
|
12
|
-
CarouselProvider,
|
|
13
|
-
Slider,
|
|
14
|
-
Slide,
|
|
15
|
-
ButtonBack,
|
|
16
|
-
ButtonNext,
|
|
17
|
-
DotGroup,
|
|
18
|
-
} from "pure-react-carousel";
|
|
8
|
+
import { CarouselProvider, Slider, Slide, DotGroup } from "pure-react-carousel";
|
|
19
9
|
|
|
20
10
|
const DeveloperBanner = ({ findText }) => {
|
|
21
|
-
// const settings = {
|
|
22
|
-
// dots: true,
|
|
23
|
-
// infinite: true,
|
|
24
|
-
// speed: 500,
|
|
25
|
-
// slidesToShow: 1,
|
|
26
|
-
// slidesToScroll: 1,
|
|
27
|
-
// autoplay: true,
|
|
28
|
-
// autoplaySpeed: 10000,
|
|
29
|
-
// pauseOnHover: true
|
|
30
|
-
// };
|
|
31
11
|
const ref = useRef();
|
|
12
|
+
|
|
13
|
+
// function to create slider dots
|
|
14
|
+
const createDots = ({ totalSlides, currentSlide }) => {
|
|
15
|
+
console.log(totalSlides, "lala");
|
|
16
|
+
let arr = [];
|
|
17
|
+
for (let index = 1; index <= totalSlides; index++) {
|
|
18
|
+
arr.push(index);
|
|
19
|
+
}
|
|
20
|
+
return arr.map((item) => {
|
|
21
|
+
return (
|
|
22
|
+
<span className={item === currentSlide + 1 ? "active" : ""}></span>
|
|
23
|
+
);
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
|
|
32
27
|
return (
|
|
33
28
|
<DevBannerWrapper>
|
|
34
29
|
<CarouselProvider
|
|
35
30
|
totalSlides={3}
|
|
36
31
|
naturalSlideWidth={232}
|
|
37
|
-
naturalSlideHeight={
|
|
32
|
+
naturalSlideHeight={590}
|
|
38
33
|
visibleSlides={1}
|
|
39
34
|
infinite
|
|
40
35
|
// isIntrinsicHeight={true}
|
|
@@ -154,9 +149,7 @@ const DeveloperBanner = ({ findText }) => {
|
|
|
154
149
|
</Slider>
|
|
155
150
|
<DotGroup
|
|
156
151
|
renderDots={(e) => {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
return <span>1</span>;
|
|
152
|
+
return <DotHolder>{createDots(e)}</DotHolder>;
|
|
160
153
|
}}
|
|
161
154
|
/>
|
|
162
155
|
</CarouselProvider>
|
|
@@ -181,3 +181,29 @@ export const DevBannerWrapper = styled.div`
|
|
|
181
181
|
height: auto;
|
|
182
182
|
}
|
|
183
183
|
`;
|
|
184
|
+
|
|
185
|
+
export const DotHolder = styled.div`
|
|
186
|
+
display: flex;
|
|
187
|
+
align-items: center;
|
|
188
|
+
justify-content: center;
|
|
189
|
+
gap: 10px;
|
|
190
|
+
position: absolute;
|
|
191
|
+
bottom: 20px;
|
|
192
|
+
left: 0;
|
|
193
|
+
right: 0;
|
|
194
|
+
margin: 0 auto;
|
|
195
|
+
> span {
|
|
196
|
+
width: 8px;
|
|
197
|
+
height: 8px;
|
|
198
|
+
background: #d9d9d9;
|
|
199
|
+
border-radius: 100%;
|
|
200
|
+
padding: 0;
|
|
201
|
+
transition: all 0.2s ease-in-out;
|
|
202
|
+
&.active {
|
|
203
|
+
background: #febf10;
|
|
204
|
+
width: 39px !important;
|
|
205
|
+
height: 5px !important;
|
|
206
|
+
border-radius: 0;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
`;
|