Skip to content

Commit

Permalink
Merge branch 'sphinx-modified' of https://github.com/rgrupesh/PolyPhy…
Browse files Browse the repository at this point in the history
…-Website into sphinx-modified
  • Loading branch information
rgrupesh committed Aug 10, 2022
2 parents aa66e05 + d67cb7d commit e297e80
Show file tree
Hide file tree
Showing 28 changed files with 4,667 additions and 5,460 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ name: Node.js CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
Expand All @@ -16,20 +14,19 @@ jobs:

strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
node-version: [17.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm test -- --coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
- name: Checkout
uses: actions/checkout@v1

- name: Install and Build
uses: npm install && npm run build

- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
fail_ci_if_error: true
folder: build
branch: gh-pages

5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ build/
.env.development.local
.env.test.local
.env.production.local
.venv
.github/

npm-debug.log*
yarn-debug.log*
yarn-error.log*

.venv
.github/
__*
9,102 changes: 3,745 additions & 5,357 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
{
"name": "cross-polyform",
"homepage": "https://PolyPhyHub.github.io/PolyPhy-Website",
"version": "0.1.0",
"private": true,
"dependencies": {
"@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1",
"@fortawesome/fontawesome-svg-core": "^6.1.2",
"@fortawesome/free-brands-svg-icons": "^6.1.2",
"@fortawesome/free-solid-svg-icons": "^6.1.2",
"@fortawesome/react-fontawesome": "^0.2.0",
"@mui/icons-material": "^5.6.1",
"@mui/material": "^5.6.1",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.0.1",
"@testing-library/user-event": "^13.5.0",
"axios": "^0.27.2",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-router-dom": "^6.3.0",
"react-scripts": "^5.0.1",
"react-scripts": "5.0.1",
"twitter": "^1.7.1",
"web-vitals": "^2.1.4"
},
"scripts": {
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
"start": "set PORT=8000 && react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
Expand All @@ -39,5 +48,8 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"gh-pages": "^4.0.0"
}
}
4 changes: 4 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import Footer from "./Components/Footer";
import Publications from "./Components/Publications";
import { BrowserRouter as Router, useRoutes } from "react-router-dom";
import PublicationRoute from "./Components/PublicationRoute";
import News from "./Components/News";
import TeamRooute from "./Components/TeamRoute";

const darkTheme = createTheme({
palette: {
Expand All @@ -19,6 +21,7 @@ const Home = () => {
return (
<div className="Home">
<Hero />
<News />
<About />
<Publications />
</div>
Expand All @@ -29,6 +32,7 @@ const AppRoutes = () => {
let routes = useRoutes([
{ path: "/", element: <Home /> },
{ path: "/publications", element: <PublicationRoute /> },
{ path: "/team", element: <TeamRooute /> },
// ...
]);
return routes;
Expand Down
Binary file added src/Assets/angus.jfif
Binary file not shown.
Binary file added src/Assets/carlos.jfif
Binary file not shown.
Binary file added src/Assets/joseph.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Assets/oskar_elek.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 6 additions & 5 deletions src/Components/Hero.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const Hero = () => {
</div>
</Grid>
<Grid item xs={12} sm={12} md={6}>
<div style={{maxWidth: "600px"}}>
<div style={{ maxWidth: "600px" }}>
<video
className="video"
src={video}
Expand All @@ -46,11 +46,12 @@ const Hero = () => {
</Grid>
</Grid>
</div>
<Link href="#about" underline="none">
<div className="cta-arrow-wrapper">

<div className="cta-arrow-wrapper">
<Link href="#about" underline="none">
<div className="cta-arrow"></div>
</div>
</Link>
</Link>
</div>
</>
);
};
Expand Down
3 changes: 3 additions & 0 deletions src/Components/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ const Navlinks = ({ dir, sp, setOpen }) => {
<li>
<a href="/">Discussions</a>
</li>
<li>
<a href="/team">Team</a>
</li>
</ul>
</li>
</Stack>
Expand Down
42 changes: 42 additions & 0 deletions src/Components/News.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import React, {useState} from "react";
import { TWITTER_API } from "../constants";

const News = () => {
var axios = require("axios");
const [tweets, setTweets] = useState([]);

var config = {
method: "get",
url: "https://thingproxy.freeboard.io/fetch/https://api.twitter.com/2/users/1204853272583892992/tweets?exclude=replies&tweet.fields=created_at",
headers: {
Authorization: TWITTER_API},
};

axios(config)
.then(function (response) {
setTweets(response.data.data);
})
.catch(function (error) {
console.log(error);
});

return (
<div className="news-wrapper">
<h2>POLYPHY UPDATES</h2>
{tweets.slice(0, 5).map((x) => {
return (
<a href={`https://twitter.com/polyphy/status/${x.id}`} key={x.id}>
<div className="tweet">
<p>{x.text.replace(/\bhttps\S+/gi, "")}</p>
<span>
{new Date(x.created_at).toLocaleString().split(",")[0]}
</span>
</div>
</a>
);
})}
</div>
);
};

export default News;
72 changes: 68 additions & 4 deletions src/Components/PubCard.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,85 @@
import { Grid, Paper } from "@mui/material";
import React from "react";

const PubCard = ({ pub }) => {
export const PubCardSmall = ({ pub }) => {
return (
<Grid item xs={12} sm={12} md={6}>
<div className="publication">
<div className="publication_card_small">
<Paper variant="outlined">
<h2>{pub.name}</h2>
<p>
<p style={{ padding: "0 1rem" }}>
<i>{pub.journal}</i>
</p>
<img src={pub.image} alt=""></img>
<p className="brief">{pub.brief}</p>
<p style={{ padding: "0.5rem 1rem" }}>
<i>
Oskar Elek, Joseph N. Burchett, J. Xavier Prochaska, Angus G.
Forbes
</i>
</p>
</Paper>
</div>
</Grid>
);
};

export default PubCard;
export const PubCardLarge = ({ pub, align }) => {
return (
<Grid item xs={12} sm={12}>
<div className="publication_card_large">
<Paper variant="outlined">
<Grid container>
{align ? (
<>
<Grid item xs={6} sm={6}>
<div className="image-container">
<div className="centered-image">
<img src={pub.image} alt="" />
</div>
</div>
</Grid>
<Grid item xs={6} sm={6}>
<h2>{pub.name}</h2>
<p style={{ padding: "0 1rem" }}>
<i>{pub.journal}</i>
</p>
<p className="brief">{pub.brief}</p>
<p style={{ padding: "0.5rem 1rem" }}>
<i>
Oskar Elek, Joseph N. Burchett, J. Xavier Prochaska, Angus
G. Forbes
</i>
</p>
</Grid>
</>
) : (
<>
<Grid item xs={6} sm={6}>
<h2>{pub.name}</h2>
<p style={{ padding: "0 1rem" }}>
<i>{pub.journal}</i>
</p>
<p className="brief">{pub.brief}</p>
<p style={{ padding: "0.5rem 1rem" }}>
<i>
Oskar Elek, Joseph N. Burchett, J. Xavier Prochaska, Angus
G. Forbes
</i>
</p>
</Grid>
<Grid item xs={6} sm={6}>
<div className="image-container">
<div className="centered-image">
<img src={pub.image} alt="" />
</div>
</div>
</Grid>
</>
)}
</Grid>
</Paper>
</div>
</Grid>
);
};
21 changes: 17 additions & 4 deletions src/Components/PublicationRoute.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
import { Grid } from "@mui/material";
import PubCard from "./PubCard";
import { PubCardLarge, PubCardSmall } from "./PubCard";
import React from "react";
import { case_studies } from "../Constants/case_studies";
import useMediaQuery from "@mui/material/useMediaQuery";

const PublicationRoute = () => {
const small = useMediaQuery("(max-width:1000px)");

return (
<div className="publication-route-wrapper">
<h1>Publications and Case Studies</h1>
<div style={{ margin: "2rem 0" }}>
<Grid container spacing={6}>
{case_studies.map((item) => {
return <PubCard pub={item} key={item.image} />;
<Grid container spacing={4}>
{case_studies.map((item, index) => {
return (
<React.Fragment key={index}>
{small ? (
<PubCardSmall pub={item} key={item.image} />
) : index % 2 === 0 ? (
<PubCardLarge pub={item} key={item.image} align={true} />
) : (
<PubCardLarge pub={item} key={item.image} />
)}
</React.Fragment>
);
})}
</Grid>
</div>
Expand Down
20 changes: 17 additions & 3 deletions src/Components/Publications.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,30 @@ import { Grid } from "@mui/material";
import React from "react";
import { case_studies } from "../Constants/case_studies";
import ButtonSwipe from "./ButtonSwipe";
import PubCard from "./PubCard";
import { PubCardSmall, PubCardLarge } from "./PubCard";
import useMediaQuery from "@mui/material/useMediaQuery";

const Publications = () => {
const small = useMediaQuery("(max-width:1000px)");

return (
<div className="publications-wrapper">
<h1>Publications and Case Studies</h1>
<div style={{ margin: "2rem 0" }}>
<Grid container spacing={4}>
<PubCard pub={case_studies[0]} />
<PubCard pub={case_studies[1]} />
{case_studies.slice(0,2).map((item, index) => {
return (
<React.Fragment key={index}>
{small ? (
<PubCardSmall pub={item} key={item.image} />
) : index % 2 === 0 ? (
<PubCardLarge pub={item} key={item.image} align={true} />
) : (
<PubCardLarge pub={item} key={item.image} />
)}
</React.Fragment>
);
})}
</Grid>
</div>
<ButtonSwipe link="/publications">Read more {">"}</ButtonSwipe>
Expand Down
32 changes: 32 additions & 0 deletions src/Components/TeamCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Grid } from "@mui/material";
import React from "react";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faCode } from "@fortawesome/free-solid-svg-icons";
import { faTwitter, faLinkedin } from "@fortawesome/free-brands-svg-icons";

const TeamCard = ({ x }) => {
return (
<Grid item xs={12} sm={12} md={6}>
<div className="team-card">
<img src={x.image} alt=""></img>
<div className="team-content">
<h3>{x.name}</h3>
<p>{x.about}</p>
<Grid container>
<a href="/">
<FontAwesomeIcon icon={faCode} />
</a>
<a href="/">
<FontAwesomeIcon icon={faLinkedin} />
</a>
<a href="/">
<FontAwesomeIcon icon={faTwitter} />
</a>
</Grid>
</div>
</div>
</Grid>
);
};

export default TeamCard;
Loading

0 comments on commit e297e80

Please sign in to comment.