Skip to content

Commit

Permalink
Remove Black Friday offer (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Gilles authored Dec 4, 2024
1 parent ffd7e68 commit 39a1361
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 50 deletions.
6 changes: 3 additions & 3 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ module.exports = {
defaultMode: "dark",
respectPrefersColorScheme: false,
},
announcementBar: {
/* announcementBar: {
id: "black_friday_2024",
content:
'Black Friday: Promo extrême sur le <a href="/fr/starter-kit/">kit de démarrage officiel</a> !!',
backgroundColor: "#ff5722",
textColor: "white",
isCloseable: true,
},
}, */
navbar: {
title: "Gladys Assistant",
logo: {
Expand Down Expand Up @@ -71,7 +71,7 @@ module.exports = {
position: "left",
},
{
href: "https://formation.gladysassistant.com/?coupon=BLACKFRIDAYCRAZY",
href: "https://formation.gladysassistant.com/?coupon=HOMEPAGE_SALE_2024",
activeBasePath: "formation",
label: "Formation",
position: "left",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ function Home({ integrations, lang }) {
)}
href="/fr/starter-kit/"
>
Black Friday: Promo sur le kit de démarrage !
Le kit de démarrage officiel
</Link>
</div>
)}
Expand Down
70 changes: 24 additions & 46 deletions src/pages/starter-kit.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,33 +127,7 @@ function Plus() {

const [timeLeft, setTimeLeft] = useState(null);

// Calculate the remaining time
useEffect(() => {
const interval = setInterval(() => {
const now = new Date().getTime();
const distance = targetDate - now;

if (distance <= 0) {
clearInterval(interval); // Stop the countdown when the target date is reached
} else {
const days = Math.floor(distance / (1000 * 60 * 60 * 24));
const hours = Math.floor(
(distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)
);
const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((distance % (1000 * 60)) / 1000);
if (days <= 1) {
setTimeLeft({ days, hours, minutes, seconds });
}
}
}, 1000);

// Clean up the interval when component unmounts
return () => clearInterval(interval);
}, [targetDate]);

useEffect(() => {
console.log("useEffect");
fetchData();
}, []);

Expand Down Expand Up @@ -232,9 +206,11 @@ function Plus() {
<small>(Retour sous 1 mois si insatisfait)</small>
</p>
<div>
<div className={styles.blackFridayBanner}>
Offre limitée Black Friday !
</div>
{false && (
<div className={styles.blackFridayBanner}>
Offre limitée Black Friday !
</div>
)}
<span>
<label
style={{ display: "block" }}
Expand Down Expand Up @@ -263,25 +239,27 @@ function Plus() {
)}
/>

<div
className={cx(styles.progressContainer, {
[styles.loadingAnimation]: loading,
})}
>
<div className={styles.progressBarBackground}>
<div
className={styles.progressBar}
style={{ width: `${progressPercentage}%` }}
/>
</div>
<p
className={cx(styles.kitsRemainingText, {
[styles.pulse]: isLowStock, // Ajoute l'effet "pulse" si le stock est faible
{false && (
<div
className={cx(styles.progressContainer, {
[styles.loadingAnimation]: loading,
})}
>
🚨 <b>{kitsRemaining} kits restants à ce prix</b>
</p>
</div>
<div className={styles.progressBarBackground}>
<div
className={styles.progressBar}
style={{ width: `${progressPercentage}%` }}
/>
</div>
<p
className={cx(styles.kitsRemainingText, {
[styles.pulse]: isLowStock, // Ajoute l'effet "pulse" si le stock est faible
})}
>
🚨 <b>{kitsRemaining} kits restants à ce prix</b>
</p>
</div>
)}
{timeLeft && (
<p>
Temps restant:{" "}
Expand Down

0 comments on commit 39a1361

Please sign in to comment.