diff --git a/src/sections/Advice/components/AdviceSlip.jsx b/src/sections/Advice/components/AdviceSlip.jsx
index e69de29b..b15eb46c 100644
--- a/src/sections/Advice/components/AdviceSlip.jsx
+++ b/src/sections/Advice/components/AdviceSlip.jsx
@@ -0,0 +1,12 @@
+function AdviceSlip({ advice, onGetMore, onSave }) {
+ return (
+
+ Some Advice
+ {advice}
+
+
+
+ );
+}
+
+export default AdviceSlip;
\ No newline at end of file
diff --git a/src/sections/Advice/components/FavouriteSlipsList.jsx b/src/sections/Advice/components/FavouriteSlipsList.jsx
index e69de29b..7aba7626 100644
--- a/src/sections/Advice/components/FavouriteSlipsList.jsx
+++ b/src/sections/Advice/components/FavouriteSlipsList.jsx
@@ -0,0 +1,14 @@
+function FavouriteSlipsList({ items }) {
+ return (
+
+ Favourite Advice Slips
+
+ {items.map((text, idx) => (
+ - {text}
+ ))}
+
+
+ );
+}
+
+export default FavouriteSlipsList;
diff --git a/src/sections/Advice/index.jsx b/src/sections/Advice/index.jsx
index 0405f11f..43afb077 100644
--- a/src/sections/Advice/index.jsx
+++ b/src/sections/Advice/index.jsx
@@ -1,11 +1,44 @@
+import { useState, useEffect } from "react";
+import AdviceSlip from "./components/AdviceSlip.jsx";
+import FavouriteSlipsList from "./components/FavouriteSlipsList.jsx";
+
+const ADVICE_API = "https://api.adviceslip.com";
+
function AdviceSection() {
+ const [advice, setAdvice] = useState("");
+ const [favouriteSlips, setFavouriteSlips] = useState([]);
+
+ const fetchAdvice = () => {
+ fetch(`${ADVICE_API}/advice`)
+ .then((response) => response.json())
+ .then((data) => setAdvice(data.slip.advice));
+ };
+
+ useEffect(() => {
+ fetchAdvice();
+ }, []);
+
+ const handleSave = () => {
+ if (advice && !favouriteSlips.includes(advice)) {
+ setFavouriteSlips([...favouriteSlips, advice]);
+ }
+ };
+
return (
- )
+ );
}
-export default AdviceSection
+export default AdviceSection;
\ No newline at end of file
diff --git a/src/sections/Art/components/ArtList.jsx b/src/sections/Art/components/ArtList.jsx
index e69de29b..6351042a 100644
--- a/src/sections/Art/components/ArtList.jsx
+++ b/src/sections/Art/components/ArtList.jsx
@@ -0,0 +1,13 @@
+import ArtListItem from "./ArtListItem.jsx";
+
+function ArtList({ artworks }) {
+ return (
+
+ {artworks.map((artwork) => (
+
+ ))}
+
+ );
+}
+
+export default ArtList;
diff --git a/src/sections/Art/components/ArtListItem.jsx b/src/sections/Art/components/ArtListItem.jsx
index e69de29b..0e5d992c 100644
--- a/src/sections/Art/components/ArtListItem.jsx
+++ b/src/sections/Art/components/ArtListItem.jsx
@@ -0,0 +1,19 @@
+function ArtListItem({ artwork }) {
+ return (
+
+
+

+
+ {artwork.title}
+ Artist: {artwork.artist}
+ Publication History:
+
+ {artwork.publicationHistoryList.map((item, index) => (
+ - {item}
+ ))}
+
+
+ );
+}
+
+export default ArtListItem;
diff --git a/src/sections/Art/components/PublicationHistoryList.jsx b/src/sections/Art/components/PublicationHistoryList.jsx
index d3f5a12f..654f1f11 100644
--- a/src/sections/Art/components/PublicationHistoryList.jsx
+++ b/src/sections/Art/components/PublicationHistoryList.jsx
@@ -1 +1,14 @@
+function PublicationHistoryList({ entries = [] }) {
+ return (
+ <>
+ Publication History:
+
+ {entries.map((line, idx) => (
+ - {line}
+ ))}
+
+ >
+ );
+}
+export default PublicationHistoryList;
diff --git a/src/sections/Art/index.jsx b/src/sections/Art/index.jsx
index 0c74ffc2..08f8ccab 100644
--- a/src/sections/Art/index.jsx
+++ b/src/sections/Art/index.jsx
@@ -1,10 +1,36 @@
+import { useEffect, useState } from "react";
+import ArtList from "./components/ArtList.jsx";
+
+const BASE = "https://boolean-uk-api-server.fly.dev";
+
function ArtsSection() {
+ const [artworks, setArtworks] = useState([]);
+
+ useEffect(() => {
+ fetch(`${BASE}/art`)
+ .then((response) => response.json())
+ .then((data) => {
+ const artworksWithData = data.map((art) => {
+ return {
+ id: art.id,
+ title: art.title,
+ artist: art.artist,
+ imageUrl: `${BASE}${art.imageURL}`,
+ publicationHistoryList: art.publicationHistory || [],
+ };
+ });
+ setArtworks(artworksWithData);
+ });
+ }, []);
+
return (
- Arts Section
-
+ Art Section
+
- )
+ );
}
-export default ArtsSection
+export default ArtsSection;
diff --git a/src/sections/Art/template.html b/src/sections/Art/template.html
index 1850dbc7..b0a88c9f 100644
--- a/src/sections/Art/template.html
+++ b/src/sections/Art/template.html
@@ -5,7 +5,7 @@ Arts Section
Paris Street; Rainy Day
diff --git a/src/sections/Users/components/UsersList.jsx b/src/sections/Users/components/UsersList.jsx
index e69de29b..f889b049 100644
--- a/src/sections/Users/components/UsersList.jsx
+++ b/src/sections/Users/components/UsersList.jsx
@@ -0,0 +1,13 @@
+import UsersListItem from "./UsersListItem";
+
+function UsersList({ users }) {
+ return (
+
+ {users.map((user, index) => (
+
+ ))}
+
+ );
+}
+
+export default UsersList;
\ No newline at end of file
diff --git a/src/sections/Users/components/UsersListItem.jsx b/src/sections/Users/components/UsersListItem.jsx
index e69de29b..1bd19c14 100644
--- a/src/sections/Users/components/UsersListItem.jsx
+++ b/src/sections/Users/components/UsersListItem.jsx
@@ -0,0 +1,13 @@
+function UsersListItem({ user }) {
+ const fullName = `${user.firstName} ${user.lastName}`;
+
+ return (
+
+
+ {fullName}
+ Email: {user.email}
+
+ );
+}
+
+export default UsersListItem;
\ No newline at end of file
diff --git a/src/sections/Users/index.jsx b/src/sections/Users/index.jsx
index 77332830..1fb0d332 100644
--- a/src/sections/Users/index.jsx
+++ b/src/sections/Users/index.jsx
@@ -1,10 +1,28 @@
+import { useState, useEffect } from "react";
+import UsersList from "./components/UsersList";
+
+const BASE_URL = "https://boolean-uk-api-server.fly.dev";
+
function UsersSection() {
+ const [users, setUsers] = useState([]);
+
+ // Replace with your GitHub username
+ const GITHUB_USERNAME = "andrechamoun555";
+
+ useEffect(() => {
+ fetch(`${BASE_URL}/${GITHUB_USERNAME}/contact`)
+ .then((response) => response.json())
+ .then(setUsers);
+ }, []);
+
return (
- )
+ );
}
-export default UsersSection
+export default UsersSection;