This is an automated email from the ASF dual-hosted git repository.
visortelle pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git
The following commit(s) were added to refs/heads/main by this push:
new 794145f3c66a Shuffle testimonials before displaying them (#876)
794145f3c66a is described below
commit 794145f3c66a2d4baa083323ffb13bed128ab54c
Author: Lari Hotari <[email protected]>
AuthorDate: Tue Apr 2 04:52:11 2024 -0700
Shuffle testimonials before displaying them (#876)
* Shuffle testimonials before displaying them
* Address review comment
---
src/components/pages/HomePage/Users/Users.tsx | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/components/pages/HomePage/Users/Users.tsx
b/src/components/pages/HomePage/Users/Users.tsx
index 54dfc91528a1..4d63df2a787c 100644
--- a/src/components/pages/HomePage/Users/Users.tsx
+++ b/src/components/pages/HomePage/Users/Users.tsx
@@ -1,4 +1,5 @@
import React from 'react';
+import _ from 'lodash'
import Button from '@site/src/components/ui/Button/Button';
import Slider from '@site/src/components/ui/Slider/Slider';
@@ -12,6 +13,7 @@ import BrowserOnly from '@docusaurus/BrowserOnly';
const Users: React.FC = () => {
const { siteConfig } = useDocusaurusContext();
+ const shuffledTestimonials = React.useMemo(() => _.shuffle(testimonials),
[testimonials]);
return (
<section className={s.block}>
@@ -37,7 +39,7 @@ const Users: React.FC = () => {
<BrowserOnly>
{() => (
<Slider centerMode={window.innerWidth > 1000} slidesToShow={2}>
- {Object.values(testimonials).flat().map((caseStudy, i) => (
+ {Object.values(shuffledTestimonials).flat().map((caseStudy, i)
=> (
<div key={i} className={s.slide}>
<div className={s.slide_container}>
<Quote className={s.quote} />