Skip to content

Commit

Permalink
Merge pull request #215 from policy-design-lab/release-0.12.0
Browse files Browse the repository at this point in the history
Release 0.12.0
  • Loading branch information
pengyin-shan authored Nov 17, 2023
2 parents cb17642 + e2e0d43 commit 4ff692e
Show file tree
Hide file tree
Showing 12 changed files with 412 additions and 12 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [0.12.0] - 2023-11-17

### Added

- Add the issue release/white paper page [#210](https://github.com/policy-design-lab/pdl-frontend/issues/210)
- Add iFrame component to the release/white paper page [#214](https://github.com/policy-design-lab/pdl-frontend/issues/214)

## [0.11.0] - 2023-11-08

### Added
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "policy-design-lab",
"version": "0.11.0",
"version": "0.12.0",
"description": "the front end of policy design lab",
"repository": "https://github.com/policy-design-lab/pdl-frontend",
"main": "src/app.tsx",
Expand Down
31 changes: 23 additions & 8 deletions src/components/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ import { Link } from "react-router-dom";
import PDLLogo from "./PDLLogo";

const drawerWidth = 240;
const navItems = ["HOME", "EXPLORE FARM BILL DATA", "ABOUT PDL"];
const navItems = [
{ title: "HOME", link: "/" },
{ title: "ISSUES & WHITE PAPERS", link: "/issue_whitepaper" },
{ title: "ABOUT PDL" }
];
export default function NavBar({
bkColor = "rgba(255, 255, 255, 1)",
ftColor = "rgba(255, 255, 255, 1)",
Expand Down Expand Up @@ -47,9 +51,15 @@ export default function NavBar({
<Divider />
<List>
{navItems.map((item) => (
<ListItem key={item} disablePadding>
<ListItem key={item.title} disablePadding>
<ListItemButton sx={{ textAlign: "center" }}>
<ListItemText primary={item} />
{item.link ? (
// <a href={item.link}>
<ListItemText primary={item.title} />
) : (
// </a>
<ListItemText primary={item.title} />
)}
</ListItemButton>
</ListItem>
))}
Expand Down Expand Up @@ -92,16 +102,21 @@ export default function NavBar({
</Button>
<Box sx={{ display: { xs: "none", sm: "block" } }}>
{navItems.map((item) => {
if (item === "HOME") {
if (item.link) {
return (
<Button component={Link} to="/" key={item} sx={{ color: ftColor }}>
{item}
<Button
component={Link}
to={item.link}
key={item.title}
sx={{ color: ftColor }}
>
{item.title}
</Button>
);
}
return (
<Button key={item} sx={{ color: ftColor }}>
{item}
<Button key={item.title} sx={{ color: ftColor }}>
{item.title}
</Button>
);
})}
Expand Down
102 changes: 102 additions & 0 deletions src/components/issueWhitePaper/cardIframe.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
import { Button, Grid, Typography } from "@mui/material";
import { makeStyles } from "@mui/styles";
import * as React from "react";
import DownloadIcon from "@mui/icons-material/Download";

export default function CardIFrame({
title,
author,
date,
link,
iframeTitle,
iframeLink,
iframeWidth,
iframeHeight
}): JSX.Element {
const useStyles = makeStyles(() => ({
downloadButton: {
"&:hover": {
backgroundColor: "transparent"
}
}
}));
const classes = useStyles();

return (
<Grid container className="paperCard" sx={{ display: "flex", justifyContent: "space-between" }}>
<Grid container xs={12} sm={12}>
<Grid className="inCardContainer mainItems" container xs={12} sm={12}>
<Grid
container
xs={12}
sm={12}
sx={{ display: "flex", alignItems: "center", justifyContent: "space-between" }}
>
<Grid item xs={12} sm={9}>
<Typography variant="h3" component="div">
{title}
</Typography>
</Grid>
<Grid item xs={12} sm={3} sx={{ display: "flex", justifyContent: "end" }}>
<a href={link} target="_blank" rel="noopener noreferrer">
<Button
variant="contained"
className={classes.downloadButton}
sx={{
border: "2px solid #2F7164",
backgroundColor: "transparent",
color: "#2F7164",
minWidth: 15,
minHeight: 4,
borderRadius: 0
}}
>
<Typography variant="subtitle1">
<strong>Download PDF</strong>
</Typography>{" "}
<DownloadIcon sx={{ mx: 1, my: 2 }} />
</Button>
</a>
</Grid>
</Grid>
</Grid>
<Grid className="inCardContainer subItems" container xs={12} sm={12} sx={{ display: "flex" }}>
<Grid item xs={12} sm={6}>
<Typography variant="body1" component="div">
Author: {author}
</Typography>
</Grid>
<Grid item xs={12} sm={6} sx={{ display: "flex", justifyContent: "end" }}>
<Typography variant="body1" component="div">
Date: {date}
</Typography>
</Grid>
</Grid>
<Grid item xs={12} sm={12} className="inCardContainer subItems" sx={{ justifyContent: "center" }}>
<Typography variant="body1" component="div">
As Congress considers reauthorizing the Farm Bill, vital resources that are available to farmers
and ranchers today are at risk — specifically the $18 billion investment from the Inflation
Reduction Act (IRA) for the U.S. Department of Agriculture’s (USDA) popular conservation
programs. This issue brief provides a first look at what farmers stand to lose in each state if
these investments are eliminated by Congress.
</Typography>
</Grid>
<Grid
className="inCardContainer subItems"
container
xs={12}
sm={12}
sx={{ display: "flex", justifyContent: "center" }}
>
<iframe
title={iframeTitle}
width={iframeWidth}
height={iframeHeight}
src={iframeLink}
allowFullScreen
/>
</Grid>
</Grid>
</Grid>
);
}
72 changes: 72 additions & 0 deletions src/components/issueWhitePaper/cardPaper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import { Button, Grid, Typography } from "@mui/material";
import { makeStyles } from "@mui/styles";
import * as React from "react";
import DownloadIcon from "@mui/icons-material/Download";

export default function CardPaper({ title, author, date, link }): JSX.Element {
const useStyles = makeStyles(() => ({
downloadButton: {
"&:hover": {
backgroundColor: "transparent"
}
}
}));
const classes = useStyles();
return (
<Grid
container
className="paperCard"
sx={{ display: "flex", alignItems: "end", justifyContent: "space-between" }}
>
<Grid container xs={12} sm={7}>
<Grid className="inCardContainer mainItems" container xs={12} sm={12}>
<Grid item xs={12} sm={12}>
<Typography variant="h3" component="div">
{title}
</Typography>
</Grid>
</Grid>
<Grid
className="inCardContainer subItems"
container
xs={12}
sm={8}
sx={{ display: "flex", justifyContent: "space-between" }}
>
<Grid item xs={12} sm={8}>
<Typography variant="body1" component="div">
Author: {author}
</Typography>
</Grid>
<Grid item xs={12} sm={4}>
<Typography variant="body1" component="div">
Date: {date}
</Typography>
</Grid>
</Grid>
</Grid>

<Grid container xs={12} sm={5} sx={{ display: "flex", justifyContent: "flex-end" }}>
<a href={link} target="_blank" rel="noopener noreferrer">
<Button
variant="contained"
className={classes.downloadButton}
sx={{
border: "2px solid #2F7164",
backgroundColor: "transparent",
color: "#2F7164",
minWidth: 15,
minHeight: 4,
borderRadius: 0
}}
>
<Typography variant="subtitle1">
<strong>Download PDF</strong>
</Typography>{" "}
<DownloadIcon sx={{ mx: 1, my: 2 }} />
</Button>
</a>
</Grid>
</Grid>
);
}
Binary file added src/files/ISSUE.pdf
Binary file not shown.
2 changes: 2 additions & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import SNAPPage from "./pages/SNAPPage";
import TitleIPage from "./pages/TitleIPage";
import CropInsurancePage from "./pages/CropInsurancePage";
import ACEPPage from "./pages/ACEPPage";
import IssueWhitePaperPage from "./pages/IssueWhitePaperPage";

const ScrollToTop = (props: any) => {
const location = useLocation();
Expand All @@ -32,6 +33,7 @@ export default function Main(): JSX.Element {
<Route path="/title1" element={<TitleIPage />} />
<Route path="/cropinsurance" element={<CropInsurancePage />} />
<Route path="/snap" element={<SNAPPage />} />
<Route path="/issue_whitepaper" element={<IssueWhitePaperPage />} />
</Routes>
</ScrollToTop>
);
Expand Down
Loading

0 comments on commit 4ff692e

Please sign in to comment.