From 28050d040a1e452b715d0bcd2d1efbcbf2c84b7c Mon Sep 17 00:00:00 2001 From: Alfred Ryvarden Date: Mon, 1 Sep 2025 15:42:39 +0200 Subject: [PATCH] done --- src/sections/Art/components/ArtList.jsx | 32 +++++++++++++++++ src/sections/Art/components/ArtListItem.jsx | 19 ++++++++++ src/sections/Art/index.jsx | 10 ++++-- src/sections/Users/components/UsersList.jsx | 32 +++++++++++++++++ .../Users/components/UsersListItem.jsx | 36 +++++++++++++++++++ src/sections/Users/index.jsx | 5 ++- 6 files changed, 130 insertions(+), 4 deletions(-) diff --git a/src/sections/Art/components/ArtList.jsx b/src/sections/Art/components/ArtList.jsx index e69de29b..2e714f85 100644 --- a/src/sections/Art/components/ArtList.jsx +++ b/src/sections/Art/components/ArtList.jsx @@ -0,0 +1,32 @@ +/* eslint-disable no-undef */ +import { useState, useEffect } from "react"; +import ArtListItem from "./ArtListItem"; + +function ArtList() { + const url = "https://boolean-uk-api-server.fly.dev/art"; + + const [data, setData] = useState([]); + + useEffect(() => { + const fetchData = async () => { + const response = await fetch(url); + const jsonData = await response.json(); + setData(jsonData); + }; + fetchData(); + }, []); + + return ( +
+
+
    + {data.map((art, index) => ( + + ))} +
+
+
+ ); +} + +export default ArtList; diff --git a/src/sections/Art/components/ArtListItem.jsx b/src/sections/Art/components/ArtListItem.jsx index e69de29b..ea9816f5 100644 --- a/src/sections/Art/components/ArtListItem.jsx +++ b/src/sections/Art/components/ArtListItem.jsx @@ -0,0 +1,19 @@ +function ArtListItem({ art, index }) { + return ( +
  • +
    + +
    +

    {art.title}

    +

    {art.artist}

    +

    Publication History:

    + +
  • + ); +} + +export default ArtListItem; diff --git a/src/sections/Art/index.jsx b/src/sections/Art/index.jsx index 0c74ffc2..1f8ccac1 100644 --- a/src/sections/Art/index.jsx +++ b/src/sections/Art/index.jsx @@ -1,10 +1,14 @@ +import ArtList from "./components/ArtList"; + function ArtsSection() { 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..27bcc490 100644 --- a/src/sections/Users/components/UsersList.jsx +++ b/src/sections/Users/components/UsersList.jsx @@ -0,0 +1,32 @@ +/* eslint-disable no-undef */ +import { useState, useEffect } from "react"; +import UsersListItem from "./UsersListItem" + +function UsersList() { + const url = "https://boolean-uk-api-server.fly.dev/fanden/contact"; + + const [data, setData] = useState([]); + + useEffect(() => { + const fetchData = async () => { + const response = await fetch(url); + const jsonData = await response.json(); + setData(jsonData); + }; + fetchData(); + }, []); + + return ( +
    +
    +
      + {data.map((user, index) => ( + + ))} +
    +
    +
    + ); +} + +export default UsersList; diff --git a/src/sections/Users/components/UsersListItem.jsx b/src/sections/Users/components/UsersListItem.jsx index e69de29b..4272c6a0 100644 --- a/src/sections/Users/components/UsersListItem.jsx +++ b/src/sections/Users/components/UsersListItem.jsx @@ -0,0 +1,36 @@ +function UsersListItem({ user, index }) { + + const femaleKeywords = [ + "male to female trans woman", + "transexual woman", + "male to female", + "transexual female", + ]; + + const maleKeywords = [ + "transexual man", + "transmasculine", + "female to male transgender man", + "ftm", + ]; + + return ( + <> +
  • + {user.firstName +

    {user.firstName + " " + user.lastName}

    +

    Email: {user.email}

    +
  • + + ); +} + +export default UsersListItem; diff --git a/src/sections/Users/index.jsx b/src/sections/Users/index.jsx index 77332830..3c85f327 100644 --- a/src/sections/Users/index.jsx +++ b/src/sections/Users/index.jsx @@ -1,8 +1,11 @@ +import UsersList from "./components/UsersList"; function UsersSection() { return (

    Users Section

    -
    +
    + +
    ) }