Skip to content

Commit 4dc436b

Browse files
authored
Merge branch 'main' into main
2 parents 578bd90 + bba026e commit 4dc436b

File tree

2 files changed

+92
-64
lines changed

2 files changed

+92
-64
lines changed

CODE_OF_CONDUCT.md

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ We as members, contributors, and leaders pledge to make participation in our
66
community a harassment-free experience for everyone, regardless of age, body
77
size, visible or invisible disability, ethnicity, sex characteristics, gender
88
identity and expression, level of experience, education, socio-economic status,
9-
nationality, personal appearance, race, religion, or sexual identity
10-
and orientation.
9+
nationality, personal appearance, race, caste, color, religion, or sexual
10+
identity and orientation.
1111

1212
We pledge to act and interact in ways that contribute to an open, welcoming,
1313
diverse, inclusive, and healthy community.
@@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
1717
Examples of behavior that contributes to a positive environment for our
1818
community include:
1919

20-
- Demonstrating empathy and kindness toward other people
21-
- Being respectful of differing opinions, viewpoints, and experiences
22-
- Giving and gracefully accepting constructive feedback
23-
- Accepting responsibility and apologizing to those affected by our mistakes,
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
2424
and learning from the experience
25-
- Focusing on what is best not just for us as individuals, but for the
26-
overall community
25+
* Focusing on what is best not just for us as individuals, but for the overall
26+
community
2727

2828
Examples of unacceptable behavior include:
2929

30-
- The use of sexualized language or imagery, and sexual attention or
31-
advances of any kind
32-
- Trolling, insulting or derogatory comments, and personal or political attacks
33-
- Public or private harassment
34-
- Publishing others' private information, such as a physical or email
35-
address, without their explicit permission
36-
- Other conduct which could reasonably be considered inappropriate in a
30+
* The use of sexualized language or imagery, and sexual attention or advances of
31+
any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email address,
35+
without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
3737
professional setting
3838

3939
## Enforcement Responsibilities
@@ -82,15 +82,15 @@ behavior was inappropriate. A public apology may be requested.
8282

8383
### 2. Warning
8484

85-
**Community Impact**: A violation through a single incident or series
86-
of actions.
85+
**Community Impact**: A violation through a single incident or series of
86+
actions.
8787

8888
**Consequence**: A warning with consequences for continued behavior. No
8989
interaction with the people involved, including unsolicited interaction with
9090
those enforcing the Code of Conduct, for a specified period of time. This
9191
includes avoiding interactions in community spaces as well as external channels
92-
like social media. Violating these terms may lead to a temporary or
93-
permanent ban.
92+
like social media. Violating these terms may lead to a temporary or permanent
93+
ban.
9494

9595
### 3. Temporary Ban
9696

@@ -109,20 +109,24 @@ Violating these terms may lead to a permanent ban.
109109
standards, including sustained inappropriate behavior, harassment of an
110110
individual, or aggression toward or disparagement of classes of individuals.
111111

112-
**Consequence**: A permanent ban from any sort of public interaction within
113-
the community.
112+
**Consequence**: A permanent ban from any sort of public interaction within the
113+
community.
114114

115115
## Attribution
116116

117117
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118-
version 2.0, available at
119-
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
118+
version 2.1, available at
119+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120120

121-
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122-
enforcement ladder](https://github.com/mozilla/diversity).
123-
124-
[homepage]: https://www.contributor-covenant.org
121+
Community Impact Guidelines were inspired by
122+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
125123

126124
For answers to common questions about this code of conduct, see the FAQ at
127-
https://www.contributor-covenant.org/faq. Translations are available at
128-
https://www.contributor-covenant.org/translations.
125+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126+
[https://www.contributor-covenant.org/translations][translations].
127+
128+
[homepage]: https://www.contributor-covenant.org
129+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130+
[Mozilla CoC]: https://github.com/mozilla/diversity
131+
[FAQ]: https://www.contributor-covenant.org/faq
132+
[translations]: https://www.contributor-covenant.org/translations

src/components/testimonial.js

Lines changed: 59 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ const testimonials = [
4848
];
4949

5050
const Testimonial = ({ testimonial }) => (
51-
<div className="bg-black p-4 rounded-xl delay-150 hover:-translate-y-1 duration-300 hover:scale-110 md:m-6 m-2 mt-8 h-100 border-2 border-white">
51+
<div className=" bg-black p-4 rounded-xl delay-150 hover:-translate-y-1 duration-300 hover:scale-110 md:m-6 m-2 mt-8 h-96 w-auto border-2 border-white text-lg text-center justify-center items-center">
5252
<p className="text-white">{testimonial.text}</p>
53-
<div className="flex items-center mt-4">
53+
<div className="flex justify-center mt-8">
5454
<div className="flex-shrink-0">
5555
<Image
5656
className="w-12 h-12 rounded-full"
@@ -70,71 +70,89 @@ const Testimonial = ({ testimonial }) => (
7070
const TestimonialCarousel = () => {
7171
const [current, setCurrent] = useState(0);
7272
const [numVisible, setNumVisible] = useState(3);
73-
73+
const [intervalId, setIntervalId] = useState(null);
7474
useEffect(() => {
7575
const handleResize = () => {
7676
const screenWidth = window.innerWidth;
77-
if (screenWidth < 640) {
77+
if (screenWidth <= 700) {
7878
setNumVisible(1);
79-
} else if (screenWidth < 768) {
79+
} else if (screenWidth >= 700 && screenWidth < 1024) {
80+
setNumVisible(2);
81+
} else if (screenWidth >= 1024 && screenWidth < 1300) {
8082
setNumVisible(2);
8183
} else {
8284
setNumVisible(3);
8385
}
8486
};
8587

88+
const startAutoCarousel = () => {
89+
const id = setInterval(() => {
90+
goToNext();
91+
}, 5000);
92+
93+
return id;
94+
};
95+
8696
if (typeof window !== "undefined") {
8797
window.addEventListener("resize", handleResize);
8898
}
89-
90-
return () => {
91-
if (typeof window !== "undefined") {
92-
window.removeEventListener("resize", handleResize);
93-
}
94-
};
99+
const intervalId = startAutoCarousel();
100+
return () => clearInterval(intervalId);
95101
}, []);
96102

97103
const visibleTestimonials = testimonials.slice(current, current + numVisible);
98104

99105
const goToPrev = () => {
100-
if (current === 0) {
101-
setCurrent(testimonials.length - numVisible);
102-
} else {
103-
setCurrent(current - 1);
104-
}
106+
setCurrent((prev) => {
107+
if (prev === 0) {
108+
return testimonials.length - numVisible;
109+
} else {
110+
return prev - 1;
111+
}
112+
});
105113
};
106114

107115
const goToNext = () => {
108-
if (current === testimonials.length - numVisible) {
109-
setCurrent(0);
110-
} else {
111-
setCurrent(current + 1);
112-
}
116+
setCurrent((prev) => {
117+
if (prev + numVisible === testimonials.length) {
118+
return 0;
119+
} else {
120+
return prev + 1;
121+
}
122+
});
113123
};
114124

115125
return (
116126
<div className="py-10">
117127
<Header name="What Our Members Say About Us" />
118-
<div className="flex flex-col items-center justify-center">
119-
<div className="flex items-center mb-6">
120-
<button
121-
onClick={goToPrev}
122-
className="bg-gray-800 text-white rounded-full p-3 flex justify-center items-center mr-2"
123-
>
124-
{"<"}
125-
</button>
128+
<div className="flex items-center justify-center">
129+
<button
130+
onClick={goToPrev}
131+
className="bg-gray-800 text-white rounded-full p-3 flex justify-center items-center mr-2"
132+
>
133+
{"<"}
134+
</button>
135+
<div className="flex items-center mb-6 mx-auto">
126136
{visibleTestimonials.map((testimonial) => (
127137
<div key={testimonial.id}>
128138
<Testimonial testimonial={testimonial} />
129139
</div>
130140
))}
131-
<button
132-
onClick={goToNext}
133-
className="bg-gray-800 text-white rounded-full p-4 flex justify-center items-center ml-2"
134-
>
135-
{">"}
136-
</button>
137141
</div>
142+
<button
143+
onClick={goToNext}
144+
className="bg-gray-800 text-white rounded-full p-3 flex justify-center items-center mr-2"
145+
>
146+
{">"}
147+
</button>
148+
</div>
149+
<div className="flex justify-center items-center gap-4">
150+
{/* <button
151+
onClick={goToPrev}
152+
className="bg-gray-800 text-white rounded-full p-3 flex justify-center items-center mr-2"
153+
>
154+
{"<"}
155+
</button> */}
138156
<div className="flex justify-center">
139157
{testimonials.map((testimonial, index) => (
140158
<div
@@ -146,6 +164,12 @@ const TestimonialCarousel = () => {
146164
></div>
147165
))}
148166
</div>
167+
{/* <button
168+
onClick={goToNext}
169+
className="bg-gray-800 text-white rounded-full p-3 flex justify-center items-center mr-2"
170+
>
171+
{">"}
172+
</button> */}
149173
</div>
150174
</div>
151175
);

0 commit comments

Comments
 (0)