l-min-components 1.0.1093 → 1.0.1095

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,6 +1,6 @@
1
1
  {
2
2
  "name": "l-min-components",
3
- "version": "1.0.1093",
3
+ "version": "1.0.1095",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -32,6 +32,7 @@
32
32
  "npm": "^10.2.5",
33
33
  "papaparse": "^5.4.1",
34
34
  "prop-types": "^15.8.1",
35
+ "pure-react-carousel": "^1.32.0",
35
36
  "rc-pagination": "^4.0.4",
36
37
  "rc-progress": "^3.5.1",
37
38
  "rc-slider": "^10.1.1",
@@ -1,125 +1,178 @@
1
- import React, { useContext } from "react";
2
- import { DevBannerWrapper } from "./styles";
1
+ import React, { useContext, useRef } from "react";
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";
7
+ // import Slider from "react-slick";
8
+ // import "slick-carousel/slick/slick.css";
9
+ // import "slick-carousel/slick/slick-theme.css";
10
+ 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";
10
19
 
11
20
  const DeveloperBanner = ({ findText }) => {
12
- const settings = {
13
- dots: true,
14
- infinite: true,
15
- speed: 500,
16
- slidesToShow: 1,
17
- slidesToScroll: 1,
18
- autoplay: true,
19
- autoplaySpeed: 10000,
20
- pauseOnHover: true
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
+ const ref = useRef();
32
+
33
+ // function to create slider dots
34
+ const createDots = ({ totalSlides, currentSlide }) => {
35
+ console.log(totalSlides, "lala");
36
+ let arr = [];
37
+ for (let index = 1; index <= totalSlides; index++) {
38
+ arr.push(index);
39
+ }
40
+ return arr.map((item) => {
41
+ return (
42
+ <span className={item === currentSlide + 1 ? "active" : ""}></span>
43
+ );
44
+ });
21
45
  };
46
+
22
47
  return (
23
48
  <DevBannerWrapper>
24
- <Slider {...settings}>
25
- <div>
26
- <div className="dv_main">
27
- <img src={BannerImg} alt="Banner" />
49
+ <CarouselProvider
50
+ totalSlides={3}
51
+ naturalSlideWidth={232}
52
+ naturalSlideHeight={590}
53
+ visibleSlides={1}
54
+ infinite
55
+ // isIntrinsicHeight={true}
56
+ isPlaying={true}
57
+ ref={ref}
58
+ >
59
+ <Slider>
60
+ <Slide index={0}>
61
+ {/* <div> */}
62
+ <div className="dv_main">
63
+ <img src={BannerImg} alt="Banner" />
28
64
 
29
- <div className="dev_ban_inner">
30
- <p className="dev_banner_title">
31
- {findText("10% off your next subscription purchase?")}
32
- </p>
33
- <p className="dev_banner_subtitle"> {findText("Let's go!")} </p>
34
- <p className="dev_banner_txt">
35
- {findText(
36
- "Get a discount when you upgrade to a custom plan and unlock a new world of building."
37
- )}
38
- </p>
39
- <Button
40
- type="primary"
41
- text={findText("Contact us")}
42
- styles={{
43
- fontSize: "16px",
44
- padding: "11px 5px",
45
- width: "100%",
46
- gap: "8px",
47
- height: "44px",
48
- marginBottom: "25px",
49
- boxShadow: "0px 10px 20px 0px rgba(254, 191, 16, 0.25)"
50
- }}
51
- />
65
+ <div className="dev_ban_inner">
66
+ <p className="dev_banner_title">
67
+ {findText("10% off your next subscription purchase?")}
68
+ </p>
69
+ <p className="dev_banner_subtitle"> {findText("Let's go!")} </p>
70
+ <p className="dev_banner_txt">
71
+ {findText(
72
+ "Get a discount when you upgrade to a custom plan and unlock a new world of building."
73
+ )}
74
+ </p>
75
+ <Button
76
+ type="primary"
77
+ text={findText("Contact us")}
78
+ styles={{
79
+ fontSize: "16px",
80
+ padding: "11px 5px",
81
+ width: "100%",
82
+ gap: "8px",
83
+ height: "44px",
84
+ marginBottom: "25px",
85
+ boxShadow: "0px 10px 20px 0px rgba(254, 191, 16, 0.25)",
86
+ }}
87
+ />
88
+ {/* </div> */}
89
+ </div>
52
90
  </div>
53
- </div>
54
- </div>
55
- {/* slider 2 */}
56
- <div>
57
- <div className="dv_main">
58
- <img src={BannerImg2} alt="Banner" />
91
+ </Slide>
92
+ {/* slider 2 */}
93
+ <Slide index={1}>
94
+ <div>
95
+ <div className="dv_main">
96
+ <img src={BannerImg2} alt="Banner" />
59
97
 
60
- <div className="dev_ban_inner">
61
- <p className="dev_banner_title" style={{
62
- padding: "20px 0 10px"
63
- }}>
64
- {findText(
65
- "Get more API calls for less with our custom plan"
66
- )}
67
- </p>
68
- <p className="dev_banner_txt">
69
- {findText("Upgrade now for a 10% discount.")}
70
- </p>
71
- <Button
72
- type="primary"
73
- text={findText("Contact us")}
74
- styles={{
75
- fontSize: "16px",
76
- padding: "11px 5px",
77
- width: "100%",
78
- gap: "8px",
79
- height: "44px",
80
- marginTop: "65px",
81
- marginBottom: "25px",
82
- boxShadow: "0px 10px 20px 0px rgba(254, 191, 16, 0.25)"
83
- }}
84
- />
98
+ <div className="dev_ban_inner">
99
+ <p
100
+ className="dev_banner_title"
101
+ style={{
102
+ padding: "20px 0 10px",
103
+ }}
104
+ >
105
+ {findText(
106
+ "Get more API calls for less with our custom plan"
107
+ )}
108
+ </p>
109
+ <p className="dev_banner_txt">
110
+ {findText("Upgrade now for a 10% discount.")}
111
+ </p>
112
+ <Button
113
+ type="primary"
114
+ text={findText("Contact us")}
115
+ styles={{
116
+ fontSize: "16px",
117
+ padding: "11px 5px",
118
+ width: "100%",
119
+ gap: "8px",
120
+ height: "44px",
121
+ marginTop: "65px",
122
+ marginBottom: "25px",
123
+ boxShadow: "0px 10px 20px 0px rgba(254, 191, 16, 0.25)",
124
+ }}
125
+ />
126
+ </div>
127
+ </div>
85
128
  </div>
86
- </div>
87
- </div>
129
+ </Slide>
88
130
 
89
- {/* slider 3 */}
90
- <div>
91
- <div className="dv_main">
92
- <img src={BannerImg3} alt="Banner" />
131
+ {/* slider 3 */}
132
+ <Slide index={2}>
133
+ <div>
134
+ <div className="dv_main">
135
+ <img src={BannerImg3} alt="Banner" />
93
136
 
94
- <div className="dev_ban_inner">
95
- <p className="dev_banner_title" style={{
96
- padding: "20px 0 10px"
97
- }}>
98
- {findText("Build the future with Learngual!")}
99
- </p>
100
- <p className="dev_banner_txt">
101
- {findText(
102
- "Choose our custom plans for more calls and better flexibility."
103
- )}
104
- </p>
105
- <Button
106
- type="primary"
107
- text={findText("Contact us")}
108
- styles={{
109
- fontSize: "16px",
110
- padding: "11px 5px",
111
- width: "100%",
112
- gap: "8px",
113
- height: "44px",
114
- marginTop: "78px",
115
- marginBottom: "25px",
116
- boxShadow: "0px 10px 20px 0px rgba(254, 191, 16, 0.25)"
117
- }}
118
- />
137
+ <div className="dev_ban_inner">
138
+ <p
139
+ className="dev_banner_title"
140
+ style={{
141
+ padding: "20px 0 10px",
142
+ }}
143
+ >
144
+ {findText("Build the future with Learngual!")}
145
+ </p>
146
+ <p className="dev_banner_txt">
147
+ {findText(
148
+ "Choose our custom plans for more calls and better flexibility."
149
+ )}
150
+ </p>
151
+ <Button
152
+ type="primary"
153
+ text={findText("Contact us")}
154
+ styles={{
155
+ fontSize: "16px",
156
+ padding: "11px 5px",
157
+ width: "100%",
158
+ gap: "8px",
159
+ height: "44px",
160
+ marginTop: "78px",
161
+ marginBottom: "25px",
162
+ boxShadow: "0px 10px 20px 0px rgba(254, 191, 16, 0.25)",
163
+ }}
164
+ />
165
+ </div>
166
+ </div>
119
167
  </div>
120
- </div>
121
- </div>
122
- </Slider>
168
+ </Slide>
169
+ </Slider>
170
+ <DotGroup
171
+ renderDots={(e) => {
172
+ return <DotHolder>{createDots(e)}</DotHolder>;
173
+ }}
174
+ />
175
+ </CarouselProvider>
123
176
  </DevBannerWrapper>
124
177
  );
125
178
  };
@@ -117,6 +117,7 @@ export const DevBannerWrapper = styled.div`
117
117
  letter-spacing: 0.36px;
118
118
  margin-bottom: 10px;
119
119
  margin-top: 220px;
120
+ line-height: 1;
120
121
  }
121
122
 
122
123
  .dev_banner_subtitle {
@@ -127,6 +128,7 @@ export const DevBannerWrapper = styled.div`
127
128
  font-weight: 600;
128
129
  letter-spacing: 0.36px;
129
130
  margin-bottom: 20px;
131
+ line-height: 1;
130
132
  }
131
133
  .dev_banner_txt {
132
134
  color: #fff;
@@ -179,3 +181,29 @@ export const DevBannerWrapper = styled.div`
179
181
  height: auto;
180
182
  }
181
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
+ `;