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
30 changes: 30 additions & 0 deletions components/TeamPage/TeamMember.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React, {useState} from 'react';
import Constants from '../../global_constants/Constants';

/**
* @returns {React.Component}
*/
const TeamMember = props => {

let select = false;
for (let i = 0; i < props.person.teams.length; i++) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should use .forEach here instead.

I don't know if I mentioned this before, but I actually got asked on an interview once when starting to use a for int i = 0 i < etc loop if I knew how to use forEach loops and I had to convince my interviewer that I knew how to use it effectively but was just choosing to use the other method during the interview.

if (props.filter == props.person.teams[i]) {
select = true;
}
}

let blur = <section>blur!</section>
if (select) {
blur = <section></section>
}

return <>
<div className="person">
<section className="image"></section>
{blur}
<section className="person-name">{props.person.name}</section>
</div>
</>;
}

export default TeamMember;
51 changes: 51 additions & 0 deletions components/TeamPage/TeamPage.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
.header {
font-family: Arial, Helvetica, sans-serif;
margin-left: 2rem;
margin-top: 3rem;
}

body {
margin-left: auto;
margin-right: auto;
}

.team-members {
display: flex;
flex-direction: column;
}

.person {
background-color: blueviolet;
box-shadow: 10px 10px 5px 0px rgba(0,0,0,0.75);
max-width: 20rem;
max-height: 20rem;
padding: 2rem;
margin: 2rem;
}

.image {
padding-top: 15rem;
}

.person-name {
font-family: Arial, Helvetica, sans-serif;
text-align: center;
}

.team-members {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}

.teams {
display: flex;
justify-content: space-evenly;
flex-wrap: wrap;
}

.col-xs {
flex: 1;
text-align: center;
padding: 0px 8px;
}
89 changes: 89 additions & 0 deletions components/TeamPage/TeamPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import './TeamPage.css';
import TeamMember from './TeamMember';
import React, {useState, useEffect} from 'react';
import Constants from '../../global_constants/Constants';

/**
* @returns {React.Component}
*/
const TeamPage = () => {
const [teamMembers, setTeamMembers] = useState([]);
const [filter, setFilter] = useState('All');
let data = require('./team_members.json');


// const fetchData = () => {
// fetch('https://jsonplaceholder.typicode.com/posts')
// .then(response => {
// return response.json();
// })
// .then(people => {
// setLoadedPeople(people);
// })
// .catch(err => {
// console.log(err);
// });
// };

useEffect(() => {
//fetchData();
setTeamMembers(data);
}, []);

return <>
<h1 className="header">Meet the Team</h1>
<body>
<div className="teams">
<seciton className="col-xs">

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seciton

also we can probably use an array mapping here and abstract this to another class

<button onClick={() => setFilter('Adviser')}>
Adviser
</button>
</seciton>
<seciton className="col-xs">
All
</seciton>
<seciton className="col-xs">
<button onClick={() => setFilter('Business')}>
Business
</button>
</seciton>
<seciton className="col-xs">
Collaborations
</seciton>
<seciton className="col-xs">
Design
</seciton>
<seciton className="col-xs">
Drylab
</seciton>
<seciton className="col-xs">
Leadership
</seciton>
<seciton className="col-xs">
Outreach
</seciton>
<seciton className="col-xs">
PI
</seciton>
<seciton className="col-xs">
Presenters
</seciton>
<seciton className="col-xs">
Wetlab
</seciton>
<seciton className="col-xs">
<button onClick={() => setFilter('Web Developer')}>
Web Development
</button>
</seciton>
</div>
<div className="team-members">
{teamMembers.map(person => {
return <TeamMember key={person.id} person={person} filter={filter}/>;
})}
</div>
</body>
</>;
}

export default TeamPage;
81 changes: 81 additions & 0 deletions components/TeamPage/team_members.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
[
{
"id": 1,
"name": "William Kwok",
"teams": [
"All",
"DryLab Lead Engineer",
"Web Developer"
],
"bio": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"linkedin": "https://www.linkedin.com",
"github": "https://github.com/"
},
{
"id": 2,
"name": "Allison Lee",
"teams": [
"All",
"Web Developer",
"Business"
],
"bio": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"linkedin": "https://www.linkedin.com",
"github": "https://github.com/"
},
{
"id": 3,
"name": "Elisa Truong",
"teams": [
"All",
"Web Developer"
],
"bio": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"linkedin": "https://www.linkedin.com",
"github": "https://github.com/"
},
{
"id": 4,
"name": "Jennifer Tao",
"teams": [
"All",
"Web Developer"
],
"bio": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"linkedin": "https://www.linkedin.com",
"github": "https://github.com/"
},
{
"id": 5,
"name": "Laura Lan",
"teams": [
"All",
"Web Developer"
],
"bio": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"linkedin": "https://www.linkedin.com",
"github": "https://github.com/"
},
{
"id": 6,
"name": "Nitesh Chetry",
"teams": [
"All",
"Web Developer"
],
"bio": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"linkedin": "https://www.linkedin.com",
"github": "https://github.com/"
},
{
"id": 7,
"name": "Max Zhou",
"teams": [
"All",
"Web Developer"
],
"bio": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
"linkedin": "https://www.linkedin.com",
"github": "https://github.com/"
}
]
2 changes: 2 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const withCSS = require('@zeit/next-css');
module.exports = withCSS();
28 changes: 27 additions & 1 deletion out/index.html
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@
<!DOCTYPE html><html><head><meta charSet="utf-8" class="next-head"/><link rel="preload" href="/_next/static/4x9RYfaf8w4ta7Qrpx8Cg/pages/index.js" as="script"/><link rel="preload" href="/_next/static/4x9RYfaf8w4ta7Qrpx8Cg/pages/_app.js" as="script"/><link rel="preload" href="/_next/static/4x9RYfaf8w4ta7Qrpx8Cg/pages/_error.js" as="script"/><link rel="preload" href="/_next/static/runtime/webpack-2ef50c24cc8d478adafc.js" as="script"/><link rel="preload" href="/_next/static/chunks/commons.0bf2432a355909b63c2d.js" as="script"/><link rel="preload" href="/_next/static/runtime/main-1b9d4cd959544e57ca51.js" as="script"/></head><body><div id="__next"><div>Next js home page</div><a href="/about/">Go to about page</a></div><script>__NEXT_DATA__ = {"props":{"pageProps":{}},"page":"/","query":{},"buildId":"4x9RYfaf8w4ta7Qrpx8Cg","nextExport":true};__NEXT_LOADED_PAGES__=[];__NEXT_REGISTER_PAGE=function(r,f){__NEXT_LOADED_PAGES__.push([r, f])}</script><script async="" id="__NEXT_PAGE__/" src="/_next/static/4x9RYfaf8w4ta7Qrpx8Cg/pages/index.js"></script><script async="" id="__NEXT_PAGE__/_app" src="/_next/static/4x9RYfaf8w4ta7Qrpx8Cg/pages/_app.js"></script><script async="" id="__NEXT_PAGE__/_error" src="/_next/static/4x9RYfaf8w4ta7Qrpx8Cg/pages/_error.js"></script><script src="/_next/static/runtime/webpack-2ef50c24cc8d478adafc.js" async=""></script><script src="/_next/static/chunks/commons.0bf2432a355909b63c2d.js" async=""></script><script src="/_next/static/runtime/main-1b9d4cd959544e57ca51.js" async=""></script></body></html>
<!DOCTYPE html>
<html>

<head>
<meta charSet="utf-8" class="next-head" />
<link rel="preload" href="/_next/static/4x9RYfaf8w4ta7Qrpx8Cg/pages/index.js" as="script" />
<link rel="preload" href="/_next/static/4x9RYfaf8w4ta7Qrpx8Cg/pages/_app.js" as="script" />
<link rel="preload" href="/_next/static/4x9RYfaf8w4ta7Qrpx8Cg/pages/_error.js" as="script" />
<link rel="preload" href="/_next/static/runtime/webpack-2ef50c24cc8d478adafc.js" as="script" />
<link rel="preload" href="/_next/static/chunks/commons.0bf2432a355909b63c2d.js" as="script" />
<link rel="preload" href="/_next/static/runtime/main-1b9d4cd959544e57ca51.js" as="script" />
</head>

<body>
<div id="__next">
<div>Next js home page</div><a href="/about/">Go to about page</a>
</div>
<script>__NEXT_DATA__ = { "props": { "pageProps": {} }, "page": "/", "query": {}, "buildId": "4x9RYfaf8w4ta7Qrpx8Cg", "nextExport": true }; __NEXT_LOADED_PAGES__ = []; __NEXT_REGISTER_PAGE = function (r, f) { __NEXT_LOADED_PAGES__.push([r, f]) }</script>
<script async="" id="__NEXT_PAGE__/" src="/_next/static/4x9RYfaf8w4ta7Qrpx8Cg/pages/index.js"></script>
<script async="" id="__NEXT_PAGE__/_app" src="/_next/static/4x9RYfaf8w4ta7Qrpx8Cg/pages/_app.js"></script>
<script async="" id="__NEXT_PAGE__/_error" src="/_next/static/4x9RYfaf8w4ta7Qrpx8Cg/pages/_error.js"></script>
<script src="/_next/static/runtime/webpack-2ef50c24cc8d478adafc.js" async=""></script>
<script src="/_next/static/chunks/commons.0bf2432a355909b63c2d.js" async=""></script>
<script src="/_next/static/runtime/main-1b9d4cd959544e57ca51.js" async=""></script>
</body>

</html>
28 changes: 27 additions & 1 deletion out/index/index.html
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@
<!DOCTYPE html><html><head><meta charSet="utf-8" class="next-head"/><link rel="preload" href="/_next/static/4x9RYfaf8w4ta7Qrpx8Cg/pages/index.js" as="script"/><link rel="preload" href="/_next/static/4x9RYfaf8w4ta7Qrpx8Cg/pages/_app.js" as="script"/><link rel="preload" href="/_next/static/4x9RYfaf8w4ta7Qrpx8Cg/pages/_error.js" as="script"/><link rel="preload" href="/_next/static/runtime/webpack-2ef50c24cc8d478adafc.js" as="script"/><link rel="preload" href="/_next/static/chunks/commons.0bf2432a355909b63c2d.js" as="script"/><link rel="preload" href="/_next/static/runtime/main-1b9d4cd959544e57ca51.js" as="script"/></head><body><div id="__next"><div>Next js home page</div><a href="/about/">Go to about page</a></div><script>__NEXT_DATA__ = {"props":{"pageProps":{}},"page":"/index","query":{},"buildId":"4x9RYfaf8w4ta7Qrpx8Cg","nextExport":true};__NEXT_LOADED_PAGES__=[];__NEXT_REGISTER_PAGE=function(r,f){__NEXT_LOADED_PAGES__.push([r, f])}</script><script async="" id="__NEXT_PAGE__/index" src="/_next/static/4x9RYfaf8w4ta7Qrpx8Cg/pages/index.js"></script><script async="" id="__NEXT_PAGE__/_app" src="/_next/static/4x9RYfaf8w4ta7Qrpx8Cg/pages/_app.js"></script><script async="" id="__NEXT_PAGE__/_error" src="/_next/static/4x9RYfaf8w4ta7Qrpx8Cg/pages/_error.js"></script><script src="/_next/static/runtime/webpack-2ef50c24cc8d478adafc.js" async=""></script><script src="/_next/static/chunks/commons.0bf2432a355909b63c2d.js" async=""></script><script src="/_next/static/runtime/main-1b9d4cd959544e57ca51.js" async=""></script></body></html>
<!DOCTYPE html>
<html>

<head>
<meta charSet="utf-8" class="next-head" />
<link rel="preload" href="/_next/static/4x9RYfaf8w4ta7Qrpx8Cg/pages/index.js" as="script" />
<link rel="preload" href="/_next/static/4x9RYfaf8w4ta7Qrpx8Cg/pages/_app.js" as="script" />
<link rel="preload" href="/_next/static/4x9RYfaf8w4ta7Qrpx8Cg/pages/_error.js" as="script" />
<link rel="preload" href="/_next/static/runtime/webpack-2ef50c24cc8d478adafc.js" as="script" />
<link rel="preload" href="/_next/static/chunks/commons.0bf2432a355909b63c2d.js" as="script" />
<link rel="preload" href="/_next/static/runtime/main-1b9d4cd959544e57ca51.js" as="script" />
</head>

<body>
<div id="__next">
<div>Next js home page</div><a href="/about/">Go to about page</a>
</div>
<script>__NEXT_DATA__ = { "props": { "pageProps": {} }, "page": "/index", "query": {}, "buildId": "4x9RYfaf8w4ta7Qrpx8Cg", "nextExport": true }; __NEXT_LOADED_PAGES__ = []; __NEXT_REGISTER_PAGE = function (r, f) { __NEXT_LOADED_PAGES__.push([r, f]) }</script>
<script async="" id="__NEXT_PAGE__/index" src="/_next/static/4x9RYfaf8w4ta7Qrpx8Cg/pages/index.js"></script>
<script async="" id="__NEXT_PAGE__/_app" src="/_next/static/4x9RYfaf8w4ta7Qrpx8Cg/pages/_app.js"></script>
<script async="" id="__NEXT_PAGE__/_error" src="/_next/static/4x9RYfaf8w4ta7Qrpx8Cg/pages/_error.js"></script>
<script src="/_next/static/runtime/webpack-2ef50c24cc8d478adafc.js" async=""></script>
<script src="/_next/static/chunks/commons.0bf2432a355909b63c2d.js" async=""></script>
<script src="/_next/static/runtime/main-1b9d4cd959544e57ca51.js" async=""></script>
</body>

</html>
Loading