Skip to content

Commit

Permalink
Merge pull request #239 from Ronnie018/network-page-wireframe
Browse files Browse the repository at this point in the history
Network page wireframe
  • Loading branch information
Ronnie018 authored Jan 12, 2023
2 parents 7068959 + 3d93b49 commit ddcce0a
Show file tree
Hide file tree
Showing 4 changed files with 509 additions and 7 deletions.
32 changes: 32 additions & 0 deletions src/components/Functionalities/pages/Network/api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
export const receivedRequests = [
{
name: "Leta Dean",
image: {
url: "https://randomuser.me/api/portraits/women/79.jpg",
},
bio: "Lorem, ipsum dolor sit amet consectetur adipisicing elit. corrupti earum officiis. Ad cum error natus asperiores quidem?",
},
{
name: "Erik Armstrong",
image: {
url: "https://randomuser.me/api/portraits/men/0.jpg",
},
bio: "Lorem ipsum dolor sit amet consectetur, adipisicing elit. ex laudantium explicabo maxime! Nisi obcaecati et adipisci cum.",
},
];
export const sentRequests = [
{
name: "Deanna Scott",
image: {
url: "https://randomuser.me/api/portraits/women/82.jpg",
},
bio: "Lorem, ipsum dolor sit amet consectetur adipisicing elit. Um officiis dolor vel molestias quidem dicta perferendis praesentium inventore",
},
{
name: "Erik Armstrong",
image: {
url: "https://randomuser.me/api/portraits/men/0.jpg",
},
bio: "Lorem ipsum dolor sit amet consectetur, adipisicing elit. ex laudantium explicabo maxime! Nisi obcaecati et adipisci cum.",
},
];
173 changes: 169 additions & 4 deletions src/components/Functionalities/pages/Network/index.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,173 @@
// import { useEffect, useRef } from 'react';
import { Container } from "./styled";
import Navbar from "../../../Navbar";
import { receivedRequests as RR, sentRequests as SR } from "./api";
import { useEffect, useState } from "react";
import { IoClose, IoCheckmark, IoSearch } from "react-icons/io5";

const Parallax = (props) => {
return <Container></Container>;
const Network = (props) => {
const [sentRequests, useSentRequests] = useState(SR);
const [receivedRequests, setReceivedRequests] = useState(RR);

const [scrollPos, setScrollPos] = useState({
start: true,
end: false,
});

return (
<Container>
<Navbar />
<div className="wrapper">
<div className="left-box">
<div className="left-content">
<div className="header-container">
<h1>Users Network</h1>
</div>
<div className="search-container">
<div className="outline">
<input type="text" placeholder="Search for users" />
</div>
<button
className="search-btn"
onClick={(e) => {
console.log("should search user");
}}
>
<IoSearch className="icon" size={20} color="#d9d9d9" />
</button>
</div>
<div
className="sections"
onScroll={(e) => {
const calc = e.target.scrollHeight - e.target.offsetHeight;
if (e.target.scrollTop === calc) {
setScrollPos(({ start, end }) => {
return { start, end: true };
});
} else if (e.target.scrollTop === 0) {
setScrollPos(({ start, end }) => {
return { start: true, end };
});
} else {
setScrollPos(() => {
return { start: false, end: false };
});
}
}}
>
{sentRequests && (
<section className="section">
<div className="sections-header-container">
<h1>Requests</h1>
</div>
{sentRequests.map((request, i) => {
return (
<div
className="request-container"
key={`${request.name}-${i}`}
>
<div className="img-wrapper">
<img
src={
request?.image?.url ||
"https://via.placeholder.com/150"
}
alt=""
/>
</div>

<span className="name">
{request.name}
<div className="popup">
<div className="img-wrapper">
<img
src={
request.image?.url ||
"https://via.placeholder.com/150"
}
alt=""
/>
</div>
<div className="content-wrapper">
<div className="name">{request.name}</div>
<div className="bio">{request.bio}</div>
</div>
</div>
</span>

<div className="options">
<IoCheckmark className="icon icon-accept" />
<IoClose className="icon icon-reject" />
</div>
</div>
);
})}
</section>
)}
{receivedRequests && (
<section className="section">
<div className="sections-header-container">
<h1>Pending</h1>
</div>
{receivedRequests.map((request, i) => {
return (
<div
className="request-container"
key={`${request.name}-${i}`}
>
<div className="img-wrapper">
<img
src={
request.image?.url ||
"https://via.placeholder.com/150"
}
alt=""
/>
</div>

<div className="middle">
<div className="popup">
<div className="img-wrapper">
<img
src={
request.image?.url ||
"https://via.placeholder.com/150"
}
alt=""
/>
</div>
<div className="content-wrapper">
<div className="name">{request.name}</div>
<div className="bio">{request.bio}</div>
</div>
</div>
<span className="name">{request.name}</span>
<span className="status">pending</span>
</div>

<div className="options received">
<IoClose className="icon icon-reject" />
</div>
</div>
);
})}
</section>
)}
</div>
</div>
</div>
<main className="main-panel">
<div className="main-content">
<div className="header-container">
<h1>
Results For <span>Lorem Ipsum Dolor:</span>
</h1>
</div>
<div className="content"></div>
</div>
</main>
</div>
</Container>
);
};

export default Parallax;
export default Network;
Loading

0 comments on commit ddcce0a

Please sign in to comment.