From 2f5d83d7cd73eedb5112f9bd261310f887dd0116 Mon Sep 17 00:00:00 2001 From: Ethan Edwards Date: Sat, 30 Nov 2024 09:57:58 -0500 Subject: [PATCH] add card links and bill info links --- components/representatives.js | 7 ++++--- pages/congress/[repID].js | 21 +++++++++++++++++++-- styles/congress.module.scss | 23 +++++++++++++++-------- 3 files changed, 38 insertions(+), 13 deletions(-) diff --git a/components/representatives.js b/components/representatives.js index 8ed8b28..36658b9 100644 --- a/components/representatives.js +++ b/components/representatives.js @@ -4,17 +4,18 @@ import Link from 'next/link'; function Card({ individual }) { return ( <> - +
- +
-

{individual.type} {individual.bio.full_name}

+

{individual.type} {individual.bio.full_name}

Party: {individual.bio.party}

Serving since: {individual.typeSince}

Bills Sponsored: {individual.sponsoredLegislationCount}

Bills Cosponsored: {individual.cosponsoredLegislationCount}

+ ); } diff --git a/pages/congress/[repID].js b/pages/congress/[repID].js index 9532502..6ed60a4 100644 --- a/pages/congress/[repID].js +++ b/pages/congress/[repID].js @@ -3,11 +3,28 @@ import { useState, useEffect } from 'react'; import Head from 'next/head'; import styles from '../../styles/congress.module.scss'; +function BillLink({ billObject }) { + let linkDict = new Object(); + linkDict['HR'] = 'house-bill'; + linkDict['HRES'] = 'house-resolution'; + linkDict['HJRES'] = 'house-joint-resolution'; + linkDict['S'] = 'senate-bill'; + linkDict['SRES'] = 'senate-resolution'; + linkDict['SJRES'] = 'senate-joint-resolution'; + + return ( + +
{billObject.type} {billObject.number} {billObject.title}
+ ); +} + export default function LearnMore({ repInfo }) { let billArray = repInfo.sponsoredLegislation.recent.concat(repInfo.cosponsoredLegislation.recent); billArray = billArray.sort((a, b) => b.introducedDate - a.introducedDate) billArray.length = 6; + let isHouse = repInfo.terms[repInfo.terms.length - 1].hasOwnProperty("district"); + return ( <> @@ -27,14 +44,14 @@ export default function LearnMore({ repInfo }) {

Office Term:

-

{repInfo.state} {repInfo.type} since {repInfo.typeSince}

+

{repInfo.state} {isHouse ? <>HD-{repInfo.terms[repInfo.terms.length - 1].district} : <>} {repInfo.type} since {repInfo.typeSince}

Recent Bills:

{billArray.map((bill) => ( -
{bill.type} {bill.number} {bill.title}
+ ))}
diff --git a/styles/congress.module.scss b/styles/congress.module.scss index 8428300..b7f1279 100644 --- a/styles/congress.module.scss +++ b/styles/congress.module.scss @@ -8,7 +8,7 @@ } .link { - text-decoration: underline; + text-decoration: none; color: #363EEB; } @@ -28,19 +28,22 @@ justify-content: space-evenly; } +.photo { + border-style: solid; + border-color: black; + display: block; + margin-left: auto; + margin-right: auto; + height: 225px; +} + .repInfo { + color: black; border-style: solid; border-color: black; padding: 5px; margin: 5px; - .photo { - border-style: solid; - border-color: black; - display: block; - margin-left: auto; - margin-right: auto; - } .text { // padding: 0; @@ -50,6 +53,10 @@ } } +.repInfo:hover { + background-color: lightgrey; +} + .infoPage { margin: 30px; display: grid;