Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions src/sections/Art/components/ArtList.jsx
Original file line number Diff line number Diff line change
@@ -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 (
<section>
<div className="scroll-container">
<ul className="art-list">
{data.map((art, index) => (
<ArtListItem key ={index} art={art} />
))}
</ul>
</div>
</section>
);
}

export default ArtList;
19 changes: 19 additions & 0 deletions src/sections/Art/components/ArtListItem.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
function ArtListItem({ art, index }) {
return (
<li key={index}>
<div className="frame">
<img src={` https://boolean-uk-api-server.fly.dev${art.imageURL}`} />
</div>
<h3>{art.title}</h3>
<p>{art.artist}</p>
<h4>Publication History:</h4>
<ul>
{art.publicationHistory.map((publication, index) => (
<p key={index}>{publication}</p>
))}
</ul>
</li>
);
}

export default ArtListItem;
10 changes: 7 additions & 3 deletions src/sections/Art/index.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import ArtList from "./components/ArtList";

function ArtsSection() {
return (
<section>
<h2>Arts Section</h2>
<div className="scroll-container"></div>
<div className="scroll-container">
<ArtList />
</div>
</section>
)
);
}

export default ArtsSection
export default ArtsSection;
32 changes: 32 additions & 0 deletions src/sections/Users/components/UsersList.jsx
Original file line number Diff line number Diff line change
@@ -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 (
<section>
<div className="scroll-container">
<ul className ="users-list">
{data.map((user, index) => (
<UsersListItem key={index} user={user} />
))}
</ul>
</div>
</section>
);
}

export default UsersList;
36 changes: 36 additions & 0 deletions src/sections/Users/components/UsersListItem.jsx
Original file line number Diff line number Diff line change
@@ -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 (
<>
<li
key={index}
style={{
background:
maleKeywords.includes(user.gender.toLowerCase()) ? "#91dae5" :
femaleKeywords.includes(user.gender.toLowerCase()) ? "#d691e5" :
"#91e5a3",
}}
>
<img src={user.profileImage} alt={user.firstName + user.lastName} />
<h3>{user.firstName + " " + user.lastName}</h3>
<p>Email: {user.email}</p>
</li>
</>
);
}

export default UsersListItem;
5 changes: 4 additions & 1 deletion src/sections/Users/index.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import UsersList from "./components/UsersList";
function UsersSection() {
return (
<section>
<h2>Users Section</h2>
<div className="scroll-container"></div>
<div className="scroll-container">
<UsersList/>
</div>
</section>
)
}
Expand Down