new buy menu

This commit is contained in:
AntoninoP 2024-09-27 12:45:07 +02:00
parent 94c3655a5c
commit d4d718892c
4 changed files with 141 additions and 79 deletions

View File

@ -75,7 +75,7 @@ const App = () => {
<Route path="/createServer" element={user ? <CreatePage user={user} /> : <Navigate to="/login" />} /> <Route path="/createServer" element={user ? <CreatePage user={user} /> : <Navigate to="/login" />} />
{/* Routes with Subscription Levels */} {/* Routes with Subscription Levels */}
<Route path="/createServer/java" element={user ? (subscription > 0 ? <Javapick user={user} /> : <Navigate to="/payement?package=Gratuit" />) : <Navigate to="/login" />} /> <Route path="/createServer/java" element={user ? (subscription > 0 ? <Javapick user={user} /> : <Navigate to="/payement?package=Basique" />) : <Navigate to="/login" />} />
<Route path="/createServer/bedrock" element={user ? (subscription > 1 ? <Bedrock user={user} /> : <Navigate to="/payement?package=Standard" />) : <Navigate to="/login" />} /> <Route path="/createServer/bedrock" element={user ? (subscription > 1 ? <Bedrock user={user} /> : <Navigate to="/payement?package=Standard" />) : <Navigate to="/login" />} />
<Route path="/createServer/modpack" element={user ? (subscription > 2 ? <Modpack user={user} /> : <Navigate to="/payement?package=Premium" />) : <Navigate to="/login" />} /> <Route path="/createServer/modpack" element={user ? (subscription > 2 ? <Modpack user={user} /> : <Navigate to="/payement?package=Premium" />) : <Navigate to="/login" />} />

View File

@ -6,7 +6,7 @@ import { loadStripe } from '@stripe/stripe-js';
import { EmbeddedCheckoutProvider, EmbeddedCheckout } from '@stripe/react-stripe-js'; import { EmbeddedCheckoutProvider, EmbeddedCheckout } from '@stripe/react-stripe-js';
import styles from './PaymentForm.module.scss'; import styles from './PaymentForm.module.scss';
const stripePromise = loadStripe("pk_test_51PyIYTP3VLLeb9GlXCKgD4ylbemZPx72I3HkEAu0bRtcsfK31nqb3WtUbXKXUcKmyfrxKLfuJzZCPyp7Ymtlq9zy00c7VmkL6G"); const stripePromise = loadStripe("pk_live_51PyIYTP3VLLeb9GlHpiK8p5lVC3kGPvAAb0Nn8m5qVAGzespGfGlDoP8Wmw4HbZJJgqxxHEIG7MJwP4IAWCpRBi100dYMpV1gv");
const PackageNumber = (selectedPackage) => { const PackageNumber = (selectedPackage) => {
switch (selectedPackage) { switch (selectedPackage) {

View File

@ -7,28 +7,33 @@ import basique from '../../../assets/tier/basique.png';
import standard from '../../../assets/tier/standard.png'; import standard from '../../../assets/tier/standard.png';
import premium from '../../../assets/tier/premium.png'; import premium from '../../../assets/tier/premium.png';
// Import des icônes
import { FaCheckCircle, FaTimesCircle } from 'react-icons/fa';
const Pricing = ({ user }) => { const Pricing = ({ user }) => {
const navigate = useNavigate(); const navigate = useNavigate();
const groups = [ const groups = [
{ {
title: 'Basique', title: 'Basique',
price: '0 €', price: '2€',
description: 'Fait pour les joueurs vanilla sur un petit serveur. 2gb de Ram',
features: [ features: [
{ name: 'Accès au serveurs vanilla', isAvailable: true }, { name: 'Accès au serveurs vanilla', isAvailable: true },
{ name: 'Personalisation complète de vos serveurs', isAvailable: true }, { name: 'Personalisation complète', isAvailable: true },
{ name: 'Support par e-mail', isAvailable: true }, { name: 'Support par e-mail', isAvailable: true },
{ name: 'Accès au serveurs Mini-jeux', isAvailable: false }, { name: 'Accès au serveurs Mini-jeux', isAvailable: false },
{ name: 'Accès au serveurs de modpacks', isAvailable: false } { name: 'Accès au serveurs de modpacks', isAvailable: false },
], ],
image: basique image: basique
}, },
{ {
title: 'Standard', title: 'Standard',
price: '2 €', price: '5€',
description: 'Fait pour les joueurs de mini-jeux et vanilla ! 5gb de Ram',
features: [ features: [
{ name: 'Accès au serveurs vanilla', isAvailable: true }, { name: 'Accès au serveurs vanilla', isAvailable: true },
{ name: 'Personalisation complète de vos serveurs', isAvailable: true }, { name: 'Personalisation complète', isAvailable: true },
{ name: 'Support par e-mail', isAvailable: true }, { name: 'Support par e-mail', isAvailable: true },
{ name: 'Accès au serveurs Mini-jeux', isAvailable: true }, { name: 'Accès au serveurs Mini-jeux', isAvailable: true },
{ name: 'Accès au serveurs de modpacks', isAvailable: false } { name: 'Accès au serveurs de modpacks', isAvailable: false }
@ -38,9 +43,10 @@ const Pricing = ({ user }) => {
{ {
title: 'Premium', title: 'Premium',
price: '9€', price: '9€',
description: 'Conçu pour les joueurs de modpacks robustes. 10gb de Ram',
features: [ features: [
{ name: 'Accès au serveurs vanilla', isAvailable: true }, { name: 'Accès au serveurs vanilla', isAvailable: true },
{ name: 'Personalisation complète de vos serveurs', isAvailable: true }, { name: 'Personalisation complète', isAvailable: true },
{ name: 'Support par e-mail', isAvailable: true }, { name: 'Support par e-mail', isAvailable: true },
{ name: 'Accès au serveurs Mini-jeux', isAvailable: true }, { name: 'Accès au serveurs Mini-jeux', isAvailable: true },
{ name: 'Accès au serveurs de modpacks', isAvailable: true } { name: 'Accès au serveurs de modpacks', isAvailable: true }
@ -50,7 +56,7 @@ const Pricing = ({ user }) => {
]; ];
const handleSubscribe = (pkg) => { const handleSubscribe = (pkg) => {
navigate(`/payement?package=${pkg.title}`); navigate(`/payment?package=${pkg.title}`);
}; };
return ( return (
@ -65,21 +71,35 @@ const Pricing = ({ user }) => {
<div className={styles.packageList}> <div className={styles.packageList}>
{groups.map((pkg, index) => ( {groups.map((pkg, index) => (
<div key={index} className={styles.packageCard}> <div key={index} className={styles.packageCard}>
<div> <div className={styles.packageCardheader}>
<h2 className={styles.title}>{pkg.title}</h2>
<img src={pkg.image} alt={pkg.title} /> <img src={pkg.image} alt={pkg.title} />
</div> </div>
<h2 className={styles.title}>{pkg.title}</h2>
<div className={styles.priceContainer}>
<p className={styles.price}>{pkg.price}</p> <p className={styles.price}>{pkg.price}</p>
<button className={styles.button} onClick={() => handleSubscribe(pkg)}> <span className={styles.mensuel}>/mois</span>
S&apos;inscrire </div>
</button>
<div className={styles.description}>{pkg.description}</div>
<hr />
<ul className={styles.features}> <ul className={styles.features}>
<div className={styles.inclut}>CE QUI EST INCLUS</div>
{pkg.features.map((feature, idx) => ( {pkg.features.map((feature, idx) => (
<li key={idx} className={feature.isAvailable ? styles.featureAvailable : styles.featureUnavailable}> <li key={idx} className={feature.isAvailable ? styles.featureAvailable : styles.featureUnavailable}>
{feature.isAvailable ? '✔️' : '❌'} {feature.name} {feature.isAvailable ? (
<FaCheckCircle style={{ color: 'green', marginRight: '8px' }} />
) : (
<FaTimesCircle style={{ color: 'red', marginRight: '8px' }} />
)}
{feature.name}
</li> </li>
))} ))}
</ul> </ul>
<button className={styles.button} onClick={() => handleSubscribe(pkg)}>
Démarrez maintenant
</button>
</div> </div>
))} ))}
</div> </div>

View File

@ -2,7 +2,7 @@ $primary-color: #000;
$secondary-color: #fff; $secondary-color: #fff;
.pricingContainer { .pricingContainer {
margin-top: 5rem; margin-top: 4rem;
display: flex; display: flex;
justify-content: center; justify-content: center;
flex-direction: row; flex-direction: row;
@ -14,75 +14,117 @@ $secondary-color: #fff;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
gap: 3rem; gap: 3rem;
} }
.packageCard { .packageCard {
position: relative; background-color: $secondary-color;
background-color: white; color: $primary-color;
color: black; border-radius: .5rem;
border-radius: 0.5rem; padding: 0rem 2rem 2rem 2rem;
padding: 2rem 1rem; text-align: start;
text-align: center;
transition: transform 0.3s, box-shadow 0.3s; transition: transform 0.3s, box-shadow 0.3s;
border: 0.15rem solid #dfdcd5; border: 0.15rem solid #dfdcd5;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
&.recommended {
border-color: #76e4c8;
box-shadow: 0 6px 20px rgba(0, 228, 184, 0.5);
}
&:hover { &:hover {
transform: scale(1.01); transform: scale(1.02);
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
} }
&:hover .button { .packageCardheader {
visibility: visible; display: flex;
opacity: 1; justify-content: space-between;
} align-items: center;
img { img {
position: center; width: 3rem;
width: 4.5rem;
height: auto; height: auto;
margin-left: 0.5rem;
} }
} }
.title { .title {
font-size: 2rem; font-size: 1.8rem;
margin-bottom: 2rem; font-weight: 600;
font-weight: 500;
} }
.priceContainer {
display: flex;
justify-content: start;
align-items: baseline;
margin-bottom:-1rem;
margin-top: -4rem;
.price { .price {
font-size: 2rem; font-size: 2.5rem;
margin: 1rem 0; font-weight: bold;
color: #2F2F2F;
}
.mensuel {
font-size: 1rem;
margin-left: 0.25rem;
color: #7c7c7c;
}
}
.description {
width: 16.5rem;
height: 4rem;
font-size: 1rem;
margin-top: -0.25rem;
color: #3c3c3c;
} }
.features { .features {
list-style-type: none; list-style-type: none;
padding: 0; padding: 0;
margin: 1.5rem 0; margin: 1rem 0;
text-align: left;
li { li {
margin: .8rem 0; margin: 0.5rem 0;
font-size: 1rem;
color: #555;
} }
} }
.inclut {
font-size: 1.25rem;
margin-bottom: 1rem;
font-weight: 500;
}
.button { .button {
visibility: hidden;
opacity: 0;
color: $primary-color; color: $primary-color;
border: none; border: none;
border-radius: 4px; border-radius: 2px;
padding: 10px 20px; padding: 12px 24px;
cursor: pointer; cursor: pointer;
font-size: 16px; font-size: 1rem;
margin-top: 1rem; margin-top: 1rem;
background-color: #2F2F2F; background-color: #2F2F2F;
color: white; color: $secondary-color;
transition: background-color 0.3s, transform 0.2s;
width: 100%;
&:hover { &:hover {
background-color: darken(#2F2F2F, 10%); background-color: darken(#2F2F2F, 10%);
transform: translateY(-2px);
} }
} }
hr {
border: 0.1rem solid #dfdcd5;
margin: 1.5rem -2rem;
}
}
@media (max-width: 700px) { @media (max-width: 700px) {
.packageList { .packageList {
flex-direction: column; flex-direction: column;