diff --git a/src/sections/Art/components/ArtList.jsx b/src/sections/Art/components/ArtList.jsx index e69de29b..6225c0db 100644 --- a/src/sections/Art/components/ArtList.jsx +++ b/src/sections/Art/components/ArtList.jsx @@ -0,0 +1,13 @@ +import ArtListItem from "./ArtListItem"; + +function ArtList({ artworks }) { + return ( + + ); +} + +export default ArtList; diff --git a/src/sections/Art/components/ArtListItem.jsx b/src/sections/Art/components/ArtListItem.jsx index e69de29b..7788d183 100644 --- a/src/sections/Art/components/ArtListItem.jsx +++ b/src/sections/Art/components/ArtListItem.jsx @@ -0,0 +1,19 @@ +import PublicationHistoryList from "./PublicationHistoryList"; + +function ArtListItem({ art }) { + const baseUrl = "https://boolean-uk-api-server.fly.dev"; + + return ( +
  • +
    + {art.title} +
    +

    {art.title}

    +

    Artist: {art.artist}

    +

    Publication History:

    + +
  • + ); +} + +export default ArtListItem; diff --git a/src/sections/Art/components/PublicationHistoryList.jsx b/src/sections/Art/components/PublicationHistoryList.jsx index d3f5a12f..a7c705ef 100644 --- a/src/sections/Art/components/PublicationHistoryList.jsx +++ b/src/sections/Art/components/PublicationHistoryList.jsx @@ -1 +1,11 @@ +function PublicationHistoryList({ history }) { + return ( + + ); +} +export default PublicationHistoryList; diff --git a/src/sections/Art/index.jsx b/src/sections/Art/index.jsx index 0c74ffc2..117e1ad9 100644 --- a/src/sections/Art/index.jsx +++ b/src/sections/Art/index.jsx @@ -1,10 +1,26 @@ +import { useState, useEffect } from "react"; +import ArtList from "./components/ArtList"; + function ArtsSection() { + const [artworks, setArtworks] = useState([]); + + useEffect(() => { + fetch("https://boolean-uk-api-server.fly.dev/art") + .then((res) => res.json()) + .then((data) => { + setArtworks(data); + }) + .catch((err) => console.error("Error fetching art:", err)); + }, []); + return (

    Arts Section

    -
    +
    + +
    - ) + ); } -export default ArtsSection +export default ArtsSection; diff --git a/src/sections/Users/components/UsersList.jsx b/src/sections/Users/components/UsersList.jsx index e69de29b..3016074d 100644 --- a/src/sections/Users/components/UsersList.jsx +++ b/src/sections/Users/components/UsersList.jsx @@ -0,0 +1,13 @@ +import UserListItem from "./UsersListItem"; + +function UserList({ users }) { + return ( + + ); +} + +export default UserList; diff --git a/src/sections/Users/components/UsersListItem.jsx b/src/sections/Users/components/UsersListItem.jsx index e69de29b..30112f1b 100644 --- a/src/sections/Users/components/UsersListItem.jsx +++ b/src/sections/Users/components/UsersListItem.jsx @@ -0,0 +1,11 @@ +function UserListItem({ user }) { + return ( +
  • + {`${user.firstName} +

    {user.firstName} {user.lastName}

    +

    Email: {user.email}

    +
  • + ); +} + +export default UserListItem; diff --git a/src/sections/Users/index.jsx b/src/sections/Users/index.jsx index 77332830..a3768d11 100644 --- a/src/sections/Users/index.jsx +++ b/src/sections/Users/index.jsx @@ -1,10 +1,24 @@ +import { useState, useEffect } from "react"; +import UserList from "./components/UsersList"; + function UsersSection() { + const [users, setUsers] = useState([]); + + useEffect(() => { + fetch("https://boolean-uk-api-server.fly.dev/Kerem-1034003/contact") + .then((res) => res.json()) + .then((data) => setUsers(data)) + .catch((err) => console.error("Error fetching users:", err)); + }, []); + return (

    Users Section

    -
    +
    + +
    - ) + ); } -export default UsersSection +export default UsersSection;