diff --git a/app/about_us/Crew.jsx b/app/about_us/Crew.jsx
new file mode 100644
index 00000000..58383f7a
--- /dev/null
+++ b/app/about_us/Crew.jsx
@@ -0,0 +1,18 @@
+import OurCrew from "./OurCrew";
+import OurValues from "./OurValues";
+import styles from "./about.module.css";
+import OurPartners from "./OurPartners";
+import OurMission from "./OurMission";
+
+export const Crew = () => {
+ return (
+
-
- About us
-
-
-
- {/* TASK - React 1 week 1 */}
- {/* Add in the "OurPartners" component here */}
-
+
+
About us
+
);
-}
+};
-export default Crew;
+export default About;
diff --git a/app/about_us/page.module.css b/app/about_us/page.module.css
deleted file mode 100644
index 8cd08626..00000000
--- a/app/about_us/page.module.css
+++ /dev/null
@@ -1,5 +0,0 @@
-.app {
- background-color: black;
- width: 100vw;
- height: 100vh;
-}
diff --git a/app/destination/page.js b/app/destination/page.js
index 006037be..2d94b487 100644
--- a/app/destination/page.js
+++ b/app/destination/page.js
@@ -1,40 +1,28 @@
"use client";
-import { useState } from 'react';
-
-import styles from '@/components/destination/destination.module.css';
-import { AddWishlistItem } from '@/components/destination/AddWishlistItem';
-
-// TASK - React 1 week 2
-// Move this to its own file
-const PlanetWishlistItem = ({
- name,
- onRemove,
- thumbnail,
-}) => {
- return (
-
-

-
{name.toUpperCase()}
-
-
- );
-}
+import { useState } from "react";
+import styles from "@/components/destination/destination.module.css";
+import { AddWishlistItem } from "@/components/destination/AddWishlistItem";
+import planetData from "../../data/planet_data.json";
+import PlanetCard from "../../components/destination/PlanetCard";
+import PlanetWishlistItem from "../../components/destination/PlanetWishlistItem";
export const Destinations = () => {
- const [selectedPlanets, onAddPlanet] = useState([]);
-
- let isPlanetSelected = false;
- let numberOfPlanets = 0;
+ const [planets, setPlanets] = useState(planetData);
+ const selectedPlanets = planets.filter((planet) => planet.isSelected);
+ const numberOfPlanets = selectedPlanets.length;
- const onAddOrRemovePlanet = (name, index) => {
- // TASK - React 1 week 2
- // Implement this function
- // If you press the "ADD PLANET" the selected planet should display "SELECTED"
- // And the counter should update, how many planets are selected (numberOfPlanets)
- console.log(`You seleceted the following planet: ${name}, with the index of ${index}`);
- }
+ const onAddOrRemovePlanet = (name) => {
+ setPlanets((prevPlanets) =>
+ prevPlanets.map((planet) =>
+ planet.name === name
+ ? { ...planet, isSelected: !planet.isSelected }
+ : planet
+ )
+ );
+ console.log(`You seleceted the following planet: ${name}`);
+ };
return (
@@ -42,13 +30,26 @@ export const Destinations = () => {
Travel destinations
Wishlist
- {/* TASK - React 1 week 2 */}
- {/* Display the number Of selected planets */}
- {/* Display the "no planets" message if it is empty! */}
- No planets in wishlist :(
- You have {numberOfPlanets} in your wishlist
+ {numberOfPlanets === 0 ? (
+ No planets in wishlist :(
+ ) : (
+ You have {numberOfPlanets} planets in your wishlist.
+ )}
List coming soon after lesson 3!
-
+
+
+ Possible destinations
+ {planets.map((planet) => (
+ onAddOrRemovePlanet(planet.name)}
+ />
+ ))}
+
{/* STOP! - this is for week 3!*/}
{/* TASK - React 1 week 3 */}
{/* Import the AddWishlistItem react component */}
@@ -72,43 +73,9 @@ export const Destinations = () => {
/>
*/}
-
- Possible destinations
- {/* TASK - React 1 week 2 */}
- {/* Add all 4 planets! Europa, Moon, Mars, Titan */}
- {/* Use the README.md file for descriptions */}
- {/* Create a component, which accepts the following properties: */}
- {/* name, description, thumbnail, isSelected, onAddOrRemovePlanet */}
-
-

-
-
EUROPA {isPlanetSelected ? "- SELECTED" : ""}
-
Lorem ipsum...
-
-
-
-
-

-
-
EUROPA {isPlanetSelected ? "- SELECTED" : ""}
-
Lorem ipsum...
-
-
-
-
);
-}
+};
export default Destinations;
diff --git a/app/globals.css b/app/globals.css
index de0f6718..4243a796 100644
--- a/app/globals.css
+++ b/app/globals.css
@@ -87,7 +87,6 @@ body {
overflow-x: hidden;
}
-
body {
color: rgb(var(--foreground-rgb));
background: linear-gradient(
@@ -103,12 +102,19 @@ a {
text-decoration: none;
}
-h1, h2, h3, h4, h5, h6 {
+h1,
+h2,
+h3,
+h4,
+h5,
+h6 {
margin-block-end: var(--spacing-08);
color: var(--primary-text-color);
}
-p, b, i {
+p,
+b,
+i {
margin-block-end: var(--spacing-08);
}
@@ -118,8 +124,15 @@ button {
padding: var(--spacing-08);
border: none;
background-color: white;
- font-weight: 600;
- letter-spacing: 2px;
+ color: rgb(77, 77, 77);
+ font-weight: 700;
+ letter-spacing: 1px;
+ border-radius: 5px;
+}
+
+button:hover {
+ background-color: rgb(145, 99, 99);
+ color: white;
}
@media (prefers-color-scheme: dark) {
@@ -135,7 +148,6 @@ button {
color: #fff;
}
-
.card {
position: relative;
padding: var(--spacing-12);
@@ -181,6 +193,7 @@ button {
line-height: 100px;
cursor: pointer;
background-color: white;
+ color: rgb(77, 77, 77);
border-radius: 50%;
font-size: 8px;
font-weight: 800;
@@ -188,8 +201,9 @@ button {
}
.fullBGpicture {
- /* background: url('/destination/background-destination-desktop.jpg') no-repeat; */
- /* background-color: #000; */
+ background: url("/destination/background-destination-desktop.jpg") no-repeat;
+ background-color: #000;
+ background-size: cover;
top: 0;
bottom: 0;
left: 0;
@@ -200,7 +214,7 @@ button {
.fullBGpicture::before {
content: "";
- background: url('/destination/background-destination-desktop.jpg') no-repeat;
+ background: url("/destination/background-destination-desktop.jpg") no-repeat;
background-color: #000;
top: 0;
bottom: 0;
@@ -214,4 +228,4 @@ button {
.fullBGpicture > main {
overflow: auto;
-}
\ No newline at end of file
+}
diff --git a/app/layout.js b/app/layout.js
index 87ee54a8..aa65974c 100644
--- a/app/layout.js
+++ b/app/layout.js
@@ -17,12 +17,10 @@ export const RootLayout = ({ children }) => {