From 5ff1c7d2d588ee77f7ea7b1c1c9c276b7f983a90 Mon Sep 17 00:00:00 2001 From: AccessiT3ch Date: Mon, 27 Jan 2025 16:13:21 -0800 Subject: [PATCH 1/8] Modularize header comonent --- src/Components/Header/Header.jsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Components/Header/Header.jsx b/src/Components/Header/Header.jsx index 18edff9..5d60e49 100644 --- a/src/Components/Header/Header.jsx +++ b/src/Components/Header/Header.jsx @@ -1,20 +1,25 @@ import { Col, Row } from "react-bootstrap"; import Translate from "../Translate/Translate"; +import PropTypes from "prop-types"; -function Header() { +function Header({ title, lead, disableTranslate }) { return (
-

Know Your Rights

- - {/*

- If you are reading this, you have constitutional rights. -

*/} +

{title || "Know Your Rights"}

+ {!disableTranslate && } + {lead &&

{lead}

}
); } +Header.propTypes = { + title: PropTypes.string, + lead: PropTypes.string, + disableTranslate: PropTypes.bool, +}; + export default Header; From 0eb0a80cc5f7823b3229a242c06ea296187028dd Mon Sep 17 00:00:00 2001 From: AccessiT3ch Date: Mon, 27 Jan 2025 16:13:48 -0800 Subject: [PATCH 2/8] Modularize Resources component --- src/Components/Resources/Resources.jsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Components/Resources/Resources.jsx b/src/Components/Resources/Resources.jsx index 718c6a0..84153f8 100644 --- a/src/Components/Resources/Resources.jsx +++ b/src/Components/Resources/Resources.jsx @@ -6,15 +6,16 @@ import { digitalResources, printableResources, } from "./content"; +import PropTypes from "prop-types"; - -function Resources() { +function Resources({ hideDigitals, hidePrintables }) { const [showModal, setShowModal] = useState(false); const [modalContent, setModalContent] = useState(null); return (
+ {!hideDigitals && (

Digital Resources

@@ -38,6 +39,8 @@ function Resources() {
+ )} + {!hidePrintables && (

Printable Resources

@@ -56,6 +59,7 @@ function Resources() {
+ )} setShowModal(false)}> {modalContent?.title} @@ -93,4 +97,9 @@ function Resources() { ); } +Resources.prototype = { + hideDigitals: PropTypes.bool, + hidePrintables: PropTypes.bool, +}; + export default Resources; From 3fc38049366522c6b951e2eb662d07b47deb9f29 Mon Sep 17 00:00:00 2001 From: AccessiT3ch Date: Mon, 27 Jan 2025 16:14:07 -0800 Subject: [PATCH 3/8] Modularize Rights content --- src/Components/Rights/Rights.jsx | 87 ++++++++----------------------- src/Components/Rights/content.jsx | 61 ++++++++++++++++++++++ 2 files changed, 82 insertions(+), 66 deletions(-) create mode 100644 src/Components/Rights/content.jsx diff --git a/src/Components/Rights/Rights.jsx b/src/Components/Rights/Rights.jsx index cbadb3c..306b3f6 100644 --- a/src/Components/Rights/Rights.jsx +++ b/src/Components/Rights/Rights.jsx @@ -1,63 +1,20 @@ import { Button, Col, Nav, Row, Tab } from "react-bootstrap"; +import { attribution, leftColContent, rightColContent } from "./content"; +import PropTypes from "prop-types"; - -const rightColContent = ( - <> -

- I do not wish to speak with you, answer your questions, or sign or hand - you any documents based on my 5th Amendment rights under the United States - Constitution. -

-

- I do not give you permission to enter my home based on my 4th Amendment - rights under the United States Constitution unless you have a warrant to - enter, signed by a judge or magistrate with my name on it that you slide - under the door. -

-

- I do not give you permission to search any of my belongings based on my - 4th Amendment rights. -

-

I choose to exercise my constitutional rights.

- -); - -const leftColContent = ( - <> -

You have constitutional rights

-

- DO NOT OPEN THE DOOR if an immigration agent is knocking on the - door. -

-

- DO NOT ANSWER ANY QUESTIONS from an immigration agent if they try - to talk to you. You have the right to remain silent. -

-

- DO NOT SIGN ANYTHING without first speaking to a lawyer. You have - the right to speak with a lawyer. -

-

- If you are outside of your home, ask the agent if you are free to leave - and if they say yes, leave calmly. -

-

- GIVE THIS CARD TO THE AGENT. If you are inside of your home, show - the card through the window or slide it under the door. -

- -); - -function Rights() { +function Rights({ ctaUrl, ctaTitle, leftHeader, rightHeader }) { return (
- {leftColContent} + +

{leftHeader || "You have constitutional rights"}

+ {leftColContent} + -

To the agent

+

{rightHeader || "To the agent"}