diff --git a/src/components/navbar/Navbar.jsx b/src/components/navbar/Navbar.jsx
index f7f9ee6..a301ae5 100644
--- a/src/components/navbar/Navbar.jsx
+++ b/src/components/navbar/Navbar.jsx
@@ -4,16 +4,19 @@ import styles from './Navbar.module.scss';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faUser, faCog, faSignOutAlt, faArrowLeft } from '@fortawesome/free-solid-svg-icons';
import PropTypes from "prop-types";
+import { useNavigate } from 'react-router-dom';
const Navbar = ({
user,
hasShadow = true,
showBackButton = false,
onBackClick,
- backButtonText = "Retour au dashboard"
+ backButtonText = "Retour au dashboard",
+ Subsribebtn = true
}) => {
const [dropdownOpen, setDropdownOpen] = useState(false);
const dropdownRef = useRef(null);
+ const navigate = useNavigate();
const handleLogout = () => {
auth.signOut();
@@ -45,7 +48,15 @@ const Navbar = ({
{showBackButton && (
- {backButtonText} {}
+ {backButtonText}
+
+ )}
+
+ {Subsribebtn && ( // Updated: Conditional rendering for the subscribe button
+
+
navigate('/Pricing')}>
+ S'abonner
+
)}
@@ -90,6 +101,7 @@ Navbar.propTypes = {
showBackButton: PropTypes.bool,
onBackClick: PropTypes.func,
backButtonText: PropTypes.string,
+ Subsribebtn: PropTypes.bool // Updated: Prop type corrected
};
export default Navbar;
diff --git a/src/components/navbar/Navbar.module.scss b/src/components/navbar/Navbar.module.scss
index 8c1347f..46492f6 100644
--- a/src/components/navbar/Navbar.module.scss
+++ b/src/components/navbar/Navbar.module.scss
@@ -89,6 +89,18 @@
font-size: 1.5rem;
}
+
+.subscribeBtn{
+ padding: .5rem 1rem;
+ border-radius: .4rem;
+ background-color: #2f2f2f;
+ color: white;
+ cursor: pointer;
+ border: none;
+ margin-right: 2rem;
+}
+
+
@media (max-width: 650px) {
.backButton{
font-size: 1.25rem;
diff --git a/src/pages/CreateServer/modpack/modpack.jsx b/src/pages/CreateServer/modpack/modpack.jsx
index 879fdb3..81b7afd 100644
--- a/src/pages/CreateServer/modpack/modpack.jsx
+++ b/src/pages/CreateServer/modpack/modpack.jsx
@@ -35,7 +35,7 @@ const Modpack = ({ user }) => {
const handleCancel = () => {
console.log("Annuler cliqué, index sélectionné avant :", selectedModpackIndex);
- setSelectedModpackIndex(null); // Remise à zéro de l'index sélectionné
+ setSelectedModpackIndex(null);
};
const handleCreate = async () => {
diff --git a/src/pages/CreateServer/modpack/modpack.module.scss b/src/pages/CreateServer/modpack/modpack.module.scss
index 9272390..792658d 100644
--- a/src/pages/CreateServer/modpack/modpack.module.scss
+++ b/src/pages/CreateServer/modpack/modpack.module.scss
@@ -21,7 +21,7 @@
padding: 2rem;
width: 30rem;
text-align: center;
- transition: all 0.3s ease; /* Ajout de la transition pour l'état sélectionné/non-sélectionné */
+ transition: all 0.3s ease;
cursor: pointer;
position: relative;