Skip to content

Commit

Permalink
Clutch
Browse files Browse the repository at this point in the history
  • Loading branch information
junidy committed Nov 29, 2023
1 parent 3aaeb38 commit 848b060
Show file tree
Hide file tree
Showing 9 changed files with 107 additions and 40 deletions.
6 changes: 5 additions & 1 deletion MobileApp/src/client/components/BillTable/BillTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import Background from '../../../../assets/images/background.png';

// TODO: Remove later
const ADDRESS = '4000 Central Florida Blvd. Orlando, FL 32816';
const USER_ID = {token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY1NjZmNDYyYmZmNDQ1MzY4MjQzZWZjYSIsImZpcnN0TmFtZSI6IktvYmUiLCJsYXN0TmFtZSI6IkNvbm9tb24iLCJwYXNzd29yZCI6IkJhU0ViQWxsLiwvMjUxIiwiZW1haWwiOiJrY29ub21vbkBnbWFpbC5jb20iLCJhZGRyZXNzIjpudWxsLCJpYXQiOjE3MDEyNzY1NDUsImV4cCI6MTcwMTM2Mjk0NX0.RdiA1yGa76wme91GlTQEy_dgsXz2m7-jhkyZacf_SaI" };
// const USER_ID = {token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY1NjZmNDYyYmZmNDQ1MzY4MjQzZWZjYSIsImZpcnN0TmFtZSI6IktvYmUiLCJsYXN0TmFtZSI6IkNvbm9tb24iLCJwYXNzd29yZCI6IkJhU0ViQWxsLiwvMjUxIiwiZW1haWwiOiJrY29ub21vbkBnbWFpbC5jb20iLCJhZGRyZXNzIjpudWxsLCJpYXQiOjE3MDEyNzY1NDUsImV4cCI6MTcwMTM2Mjk0NX0.RdiA1yGa76wme91GlTQEy_dgsXz2m7-jhkyZacf_SaI" };
const USER_ID = {
token: JSON.parse(sessionStorage.getItem('token'))
// "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY1NjY4Mjk1OWFmZGY5ODc5NDljY2NmZSIsImZpcnN0TmFtZSI6IlRlc3QyIiwibGFzdE5hbWUiOiJUZXN0MiIsInBhc3N3b3JkIjoiIVRlc3QxMjMiLCJlbWFpbCI6IlRlc3RlcjJAdGVzdC5jb20iLCJhZGRyZXNzIjoiNDAwMCBDZW50cmFsIEZsb3JpZGEgQmx2ZC4gT3JsYW5kbywgRkwgMzI4MTYiLCJpYXQiOjE3MDExMTEwMTksImV4cCI6MTcwMTE5NzQxOX0.iKI-ltuvV0Fb5F68UvBdW5rt72HjM_N9FhI8yHwkXHk",
};

const queryClient = new QueryClient();
const MyContext = createContext();
Expand Down
6 changes: 5 additions & 1 deletion MobileApp/src/client/components/BillTable/RepBillTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import representativesList from './representativesList.json';

// TODO: Remove later
const ADDRESS = '4000 Central Florida Blvd. Orlando, FL 32816';
const USER_ID = {token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY1NjY4Mjk1OWFmZGY5ODc5NDljY2NmZSIsImZpcnN0TmFtZSI6IlRlc3QyIiwibGFzdE5hbWUiOiJUZXN0MiIsInBhc3N3b3JkIjoiIVRlc3QxMjMiLCJlbWFpbCI6IlRlc3RlcjJAdGVzdC5jb20iLCJhZGRyZXNzIjoiNDAwMCBDZW50cmFsIEZsb3JpZGEgQmx2ZC4gT3JsYW5kbywgRkwgMzI4MTYiLCJpYXQiOjE3MDEyNzYxNzQsImV4cCI6MTcwMTM2MjU3NH0.VXDPrxC2B5Rr6dM4j28Ying9hap75Cas0vehI629w84" };
// const USER_ID = {token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY1NjY4Mjk1OWFmZGY5ODc5NDljY2NmZSIsImZpcnN0TmFtZSI6IlRlc3QyIiwibGFzdE5hbWUiOiJUZXN0MiIsInBhc3N3b3JkIjoiIVRlc3QxMjMiLCJlbWFpbCI6IlRlc3RlcjJAdGVzdC5jb20iLCJhZGRyZXNzIjoiNDAwMCBDZW50cmFsIEZsb3JpZGEgQmx2ZC4gT3JsYW5kbywgRkwgMzI4MTYiLCJpYXQiOjE3MDEyNzYxNzQsImV4cCI6MTcwMTM2MjU3NH0.VXDPrxC2B5Rr6dM4j28Ying9hap75Cas0vehI629w84" };
const USER_ID = {
token: JSON.parse(sessionStorage.getItem('token'))
// "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY1NjY4Mjk1OWFmZGY5ODc5NDljY2NmZSIsImZpcnN0TmFtZSI6IlRlc3QyIiwibGFzdE5hbWUiOiJUZXN0MiIsInBhc3N3b3JkIjoiIVRlc3QxMjMiLCJlbWFpbCI6IlRlc3RlcjJAdGVzdC5jb20iLCJhZGRyZXNzIjoiNDAwMCBDZW50cmFsIEZsb3JpZGEgQmx2ZC4gT3JsYW5kbywgRkwgMzI4MTYiLCJpYXQiOjE3MDExMTEwMTksImV4cCI6MTcwMTE5NzQxOX0.iKI-ltuvV0Fb5F68UvBdW5rt72HjM_N9FhI8yHwkXHk",
};

const queryClient = new QueryClient();
const MyContext = createContext();
Expand Down
6 changes: 5 additions & 1 deletion MobileApp/src/client/components/BillTable/RepTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import representativesList from './representativesList.json';

// TODO: Remove later
const ADDRESS = '4000 Central Florida Blvd. Orlando, FL 32816';
const USER_ID = {token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY1NjY4Mjk1OWFmZGY5ODc5NDljY2NmZSIsImZpcnN0TmFtZSI6IlRlc3QyIiwibGFzdE5hbWUiOiJUZXN0MiIsInBhc3N3b3JkIjoiIVRlc3QxMjMiLCJlbWFpbCI6IlRlc3RlcjJAdGVzdC5jb20iLCJhZGRyZXNzIjoiNDAwMCBDZW50cmFsIEZsb3JpZGEgQmx2ZC4gT3JsYW5kbywgRkwgMzI4MTYiLCJpYXQiOjE3MDEyNzYxNzQsImV4cCI6MTcwMTM2MjU3NH0.VXDPrxC2B5Rr6dM4j28Ying9hap75Cas0vehI629w84" };
// const USER_ID = {token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY1NjY4Mjk1OWFmZGY5ODc5NDljY2NmZSIsImZpcnN0TmFtZSI6IlRlc3QyIiwibGFzdE5hbWUiOiJUZXN0MiIsInBhc3N3b3JkIjoiIVRlc3QxMjMiLCJlbWFpbCI6IlRlc3RlcjJAdGVzdC5jb20iLCJhZGRyZXNzIjoiNDAwMCBDZW50cmFsIEZsb3JpZGEgQmx2ZC4gT3JsYW5kbywgRkwgMzI4MTYiLCJpYXQiOjE3MDEyNzYxNzQsImV4cCI6MTcwMTM2MjU3NH0.VXDPrxC2B5Rr6dM4j28Ying9hap75Cas0vehI629w84" };
const USER_ID = {
token: JSON.parse(sessionStorage.getItem('token'))
// "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY1NjY4Mjk1OWFmZGY5ODc5NDljY2NmZSIsImZpcnN0TmFtZSI6IlRlc3QyIiwibGFzdE5hbWUiOiJUZXN0MiIsInBhc3N3b3JkIjoiIVRlc3QxMjMiLCJlbWFpbCI6IlRlc3RlcjJAdGVzdC5jb20iLCJhZGRyZXNzIjoiNDAwMCBDZW50cmFsIEZsb3JpZGEgQmx2ZC4gT3JsYW5kbywgRkwgMzI4MTYiLCJpYXQiOjE3MDExMTEwMTksImV4cCI6MTcwMTE5NzQxOX0.iKI-ltuvV0Fb5F68UvBdW5rt72HjM_N9FhI8yHwkXHk",
};

const queryClient = new QueryClient();

Expand Down
2 changes: 1 addition & 1 deletion WebApp/apitest.http
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ content-type: application/json
"password": "!Test123"
}
###
GET http://localhost:5001/api/getUser?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY1NjY4Mjk1OWFmZGY5ODc5NDljY2NmZSIsImZpcnN0TmFtZSI6IlRlc3QyIiwibGFzdE5hbWUiOiJUZXN0MiIsInBhc3N3b3JkIjoiIVRlc3QxMjMiLCJlbWFpbCI6IlRlc3RlcjJAdGVzdC5jb20iLCJhZGRyZXNzIjoiNDAwMCBDZW50cmFsIEZsb3JpZGEgQmx2ZC4gT3JsYW5kbywgRkwgMzI4MTYiLCJpYXQiOjE3MDEyOTEzOTAsImV4cCI6MTcwMTM3Nzc5MH0.h8_LeAOtijRDkuHmHfJgy4mbJ-JnEwyXueHGi06gHqc
GET http://localhost:5001/api/getUser?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY1NjdiYmYxNjNlZWNmNDEyOTllNTE2OSIsImZpcnN0TmFtZSI6IktpbGkiLCJsYXN0TmFtZSI6Ik1peSIsInBhc3N3b3JkIjoiSGVsbG93b3JsZDEiLCJlbWFpbCI6ImtpbGltaXkyNDNAZnJhbmRpbi5jb20iLCJhZGRyZXNzIjoiSEkgNjMsIEhvbm9sdWx1LCBISSA5NjgxOSIsImlhdCI6MTcwMTI5NzM2NSwiZXhwIjoxNzAxMzgzNzY1fQ.1ZRQmcY0hV_1PSrBGUDQ3ootwsb_Z8dNTvCZ4G_8Bmg
###
POST http://localhost:5001/api/searchBillsBasic
content-type: application/json
Expand Down
74 changes: 50 additions & 24 deletions WebApp/frontend/src/components/BillModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,21 @@ const BillModal = ({ isOpen, onClose, billData }) => {

return (
<Modal hasCloseBtn={true} isOpen={isOpen} onClose={onClose}>
<div>
<Title title={billData.Title} />
<div className="ml-2">
<div className="grid grid-cols-10 grid-rows-1">
<div className="col-start-1 col-span-9">
<Title title={billData.Title} />
</div>
<div className="col-start-10">
<LastUpdated lastUpdated={billData.LastUpdated} />
</div>
</div>
<TypeAndCommittee
type={billData.billType}
type={billData.BillType}
number={billData.BillNumber}
committee={billData.Committee}
/>
<LastUpdated lastUpdated={billData.LastUpdated} />

<CongressNum congressNum={billData.CongressNum} />
<Summary
congressNum={billData.CongressNum}
Expand All @@ -29,6 +36,7 @@ const BillModal = ({ isOpen, onClose, billData }) => {
<Sponsor sponsor={billData.Sponsor} />
<Cosponsors cosponsors={billData.Cosponsors} />
<RelatedInterest relatedInterest={billData.RelatedInterest} />
<AccessVotes />
</div>
</Modal>
);
Expand All @@ -38,10 +46,9 @@ const Title = (props) => {
const title = props.title;

return (
<div>
<h1>
<b>Title:</b>
{title}
<div className="mb-4">
<h1 className="text-4xl">
<b>{title}</b>
</h1>
</div>
);
Expand All @@ -52,11 +59,19 @@ const TypeAndCommittee = (props) => {
const number = props.number;
const committee = props.committee;

let billType = type.toUpperCase();

let temp = billType.split('');

let finalBillType = temp.join('.');


return (
<div>
<div className="mb-2">
<h2>
<b>Type+Committee:</b> {type}.{number}, {committee}
<b><u>Bill Type & number</u>: </b>{finalBillType}.{number}
</h2>
<h2><b><u>Committee</u>: </b>{committee}</h2>
</div>
);
};
Expand All @@ -65,9 +80,10 @@ const LastUpdated = (props) => {
const lastUpdated = props.lastUpdated;

return (
<div>
<div className="mb-2">
<h3>
<b>Last updated:</b>
<b><u>Last updated</u>:</b>
<br/>
{lastUpdated}
</h3>
</div>
Expand All @@ -81,10 +97,9 @@ const CongressNum = (props) => {
// TODO: Make superscript

return (
<div>
<div className="mb-2">
<h1>
<b>Congress Num:</b>
{congressNum}th Congress
<b><u>Congress Number</u>: </b>{congressNum}th Congress
</h1>
</div>
);
Expand Down Expand Up @@ -120,11 +135,13 @@ const Summary = (props) => {
if (summary === undefined) {
return <div></div>;
} else if (summary.summaries.length === 0) {
return <div>No Summary</div>;
return <div className="mb-2">No Summary</div>;
} else {
return (
<div>
<h1><b>Summary:</b></h1>
<div className="mb-2">
<h1>
<b><u>Summary</u>:</b>
</h1>
{/* Format string into html object. */}
<div dangerouslySetInnerHTML={{ __html: summary.summaries[0].text }} />
</div>
Expand All @@ -136,8 +153,10 @@ const Sponsor = (props) => {
const sponsor = props.sponsor;

return (
<div>
<h1><b>Sponsor:</b> {sponsor}</h1>
<div className="mb-2">
<h1>
<b><u>Sponsor</u>:</b> {sponsor}
</h1>
</div>
);
};
Expand All @@ -146,10 +165,12 @@ const Cosponsors = (props) => {
const cosponsors = props.cosponsors;

return (
<div>
<h1><b>Cosponsor:</b></h1>
<div className="mb-2">
<h1>
<b><u>Cosponsor(s)</u>:</b>
</h1>
{cosponsors.map((cosponsor) => (
<h2 key={cosponsor}>{cosponsor},</h2>
<div><h2 key={cosponsor}>{cosponsor},</h2></div>
))}
</div>
);
Expand All @@ -160,7 +181,10 @@ const RelatedInterest = (props) => {

return (
<div>
<h1><b>Related Interest: </b>{relatedInterest}</h1>
<h1>
<b><u>Related Interest</u>: </b>
{relatedInterest}
</h1>
</div>
);
};
Expand All @@ -178,6 +202,8 @@ const RelatedSubjects = (props) => {
};

const AccessVotes = (props) => {


return <div></div>;
};

Expand Down
40 changes: 33 additions & 7 deletions WebApp/frontend/src/components/Modal.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useRef, useEffect, useState } from 'react';
import React, { useRef, useEffect, useState } from "react";

const Modal = ({ isOpen, hasCloseBtn = true, onClose, children }) => {
const [isModalOpen, setModalOpen] = useState(isOpen);
Expand All @@ -12,7 +12,7 @@ const Modal = ({ isOpen, hasCloseBtn = true, onClose, children }) => {
};

const handleKeyDown = (event) => {
if (event.key === 'Escape') {
if (event.key === "Escape") {
handleCloseModal();
}
};
Expand All @@ -34,15 +34,41 @@ const Modal = ({ isOpen, hasCloseBtn = true, onClose, children }) => {
}, [isModalOpen]);

return (
<dialog ref={modalRef} onKeyDown={handleKeyDown} className="modal">
<dialog
ref={modalRef}
onKeyDown={handleKeyDown}
className="modal w-5/6 h-5/6 rounded-xl opacity-90"
>
{hasCloseBtn && (
<button className="modal-close-btn" onClick={handleCloseModal}>
Close
</button>
<div className="grid grid-cols-2">
<button
type="button"
class="bg-white rounded-md p-2 inline-flex col-start-13 justify-end text-gray-400 hover:text-gray-500 hover:bg-red-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500"
onClick={handleCloseModal}
>
<span class="sr-only">Close menu</span>
<svg
class="h-6 w-6"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
aria-hidden="true"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M6 18L18 6M6 6l12 12"
/>
</svg>
</button>
</div>
)}

{children}
</dialog>
);
};

export default Modal;
export default Modal;
8 changes: 4 additions & 4 deletions WebApp/frontend/src/components/SideBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const SideBar = () => {
}

return (
<div id="SideBar" className="">
<div id="SideBar" className="ml-14 mr-14 mt-14 rounded-xl">
<PoliticianName politician={reps.Senator1} title="Senator" />
<PoliticianName politician={reps.Senator2} title="Senator" />
<PoliticianName politician={reps.Representative} title="Representative" />
Expand All @@ -46,12 +46,12 @@ const PoliticianName = (props) => {

return (
<div>
<h1>{title}:</h1>
<h2 className="indent-4">{politician}</h2>
<h1 className="text-2xl m-2"><b>{title}:</b></h1>
<h2 className="indent-4 m-2">{politician}</h2>
</div>
);
};

const EditInterests = () => {};

export default SideBar;
export default SideBar;
2 changes: 1 addition & 1 deletion WebApp/frontend/src/components/billList/BillTable.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#billList-row {
background-color: #FAEACF;
background-color: #C5E1DA;
}
3 changes: 3 additions & 0 deletions WebApp/frontend/src/pages/DashboardPage.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#dashboard-background {
background-color: #FAEACF;
}

0 comments on commit 848b060

Please sign in to comment.