Skip to content

Commit c4e3447

Browse files
Merge pull request #1783 from hackforla/dev
Dev
2 parents c2b056a + ee083cf commit c4e3447

File tree

8 files changed

+128
-148
lines changed

8 files changed

+128
-148
lines changed

products/statement-generator/public/locales/en/translation.json

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@
5555
"before_you_begin_page": {
5656
"header": "Before you begin",
5757
"sectionTitle1": "Are you eligible?",
58-
"sectionParagraph1": "Be sure you are eligible for expungement. If you’re not sure, the <a target='_blank' href='https://selfhelp.courts.ca.gov/clean-your-record'>California Courts Self-Help Guide</a> or the <a target='_blank' href='https://roadmap.rootandrebound.org/understanding-cleaning-up-your-criminal-record/cleaning-up-your-criminal-record-later-in-reentry/california-expungement-of-state-convictions/chart-which-type-of-expungement-am-i-eligible-for/'>Roadmap to Reentry</a> can help you get started.",
58+
"sectionParagraph1": "Be sure you are eligible for expungement. If you’re not sure, the <Link target='_blank' href=\"https://selfhelp.courts.ca.gov/clean-your-record\">California Courts Self-Help Guide</Link> or the <Link target='_blank' href=\"https://roadmap.rootandrebound.org/understanding-cleaning-up-your-criminal-record/cleaning-up-your-criminal-record-later-in-reentry/california-expungement-of-state-convictions/chart-which-type-of-expungement-am-i-eligible-for/\">Roadmap to Reentry</Link> can help you get started.",
5959
"sectionTitle2": "Take your time",
6060
"sectionParagraph2": "This process may take 30 minutes or longer so it's important that you give yourself enough time to complete your declaration.",
6161
"sectionTitle3": "Need help?",
62-
"sectionParagraph3": "If you have questions, check our <a target='_blank' href='/faq'>FAQ</a>.",
62+
"sectionParagraph3": "If you have questions, check our <Link target='_blank' href=\"/faq\">FAQ</Link>.",
6363
"sectionTitle4": "Avoid Browser Navigation",
6464
"sectionParagraph4": "Using your browser’s back, forward, or refresh buttons will erase your answers. Be sure to use our “next” and “back” buttons only, and keep your browser window open until you are done."
6565
},
@@ -208,56 +208,50 @@
208208
"page_subheader": "This guide will help you learn more about declarations and how to use the tool.",
209209
"section1": "Expungement Basics",
210210
"title1.1": "What is expungement?",
211-
"paragraph1.1a": "Expungement of a past criminal conviction in California means that the conviction is dismissed. It is also called “record clearance,” “dismissal,” or “record relief.”",
212-
"paragraph1.1b": "If your conviction is eligible for dismissal but is not eligible for automatic dismissal, you can apply to, or “petition”, the court for it to be dismissed.",
211+
"paragraph1.1a": "Expungement of a past criminal conviction in California means that the conviction is dismissed. It is also called “record clearance,” “dismissal,” or “record relief.”<br><br>",
212+
"paragraph1.1b": "If your conviction is eligible for dismissal but is not eligible for automatic dismissal, you can apply to, or “petition”, the court for it to be dismissed.<br><br>",
213213
"paragraph1.1c": "Expungement lifts many of the negative effects of a criminal conviction and can give you a fresh start in your life.",
214214
"title1.2": "What is a declaration?",
215-
"paragraph1.2a": "A declaration in California is a written statement in a petition for expungement or reduction of some infractions, misdemeanors, or felonies. It may be required or may be added as supporting evidence depending on your case.",
215+
"paragraph1.2a": "A declaration in California is a written statement in a petition for expungement or reduction of some infractions, misdemeanors, or felonies. It may be required or may be added as supporting evidence depending on your case.<br><br>",
216216
"paragraph1.2b": "It is a written letter that explains why dismissal of your conviction would be in the interest of justice. It allows you to tell the judge your story and describe your circumstances, efforts to reform, and motivation for expungement or reduction. It is often about one page long.",
217217
"title1.3": "Why does reduction or expungement matter to me?",
218-
"paragraph1.3a": "Expungement means that in most cases your past criminal conviction cannot be used against you when applying for a job, housing, state licensing, or student loans. You may also regain some of your rights, like, in some cases, owning a firearm.",
218+
"paragraph1.3a": "Expungement means that in most cases your past criminal conviction cannot be used against you when applying for a job, housing, state licensing, or student loans. You may also regain some of your rights, like, in some cases, owning a firearm.<br><br>",
219219
"paragraph1.3b": "Reduction, also called “reclassification” or “redesignation”, allows you to change a past felony conviction to a misdemeanor, or a misdemeanor to an infraction, even if you have served a sentence. Certain legal provisions allow a felony conviction to be reduced to a misdemeanor and then be expunged.",
220220
"title1.4": "What is the process for expungement in California?",
221-
"paragraph1.4a": "To learn more about the process and eligibility for expungement in California, please check the following California Courts and California Legislature resources:",
222-
"paragraph1.4b": "<a href='https://selfhelp.courts.ca.gov/clean-your-record' target='_blank' rel='noreferrer'>California Records Self-Help Guide: Clean your record</a>",
223-
"paragraph1.4c": "<a href='https://www.courts.ca.gov/partners/documents/ExpSBS.pdf' target='_blank' rel='noreferrer'>Clearing Your Adult Criminal Record in California: A Step-by-Step Guide</a>",
224-
"paragraph1.4d": "<a href='https://leginfo.legislature.ca.gov/faces/billTextClient.xhtml?bill_id=202120220SB731' target='_blank' rel='noreferrer'>California Senate Bill 731</a>",
221+
"paragraph1.4a": "To learn more about the process and eligibility for expungement in California, please check the following California Courts and California Legislature resources:<br><br>",
222+
"paragraph1.4b": "<Link href=\"https://selfhelp.courts.ca.gov/clean-your-record\" target='_blank' rel='noreferrer'>California Records Self-Help Guide: Clean your record</Link><br><br>",
223+
"paragraph1.4c": "<Link href=\"https://www.courts.ca.gov/partners/documents/ExpSBS.pdf\" target='_blank' rel='noreferrer'>Clearing Your Adult Criminal Record in California: A Step-by-Step Guide</Link><br><br>",
224+
"paragraph1.4d": "<Link href=\"https://leginfo.legislature.ca.gov/faces/billTextClient.xhtml?bill_id=202120220SB731\" target='_blank' rel='noreferrer'>California Senate Bill 731</Link><br><br>",
225225
"section2": "Using Expunge Assist",
226226
"title2.1": "What is Expunge Assist?",
227-
"paragraph2.1a": "<p>Expunge Assist is a free step-by-step tool that helps people with past convictions in California write a declaration. This is one part of the process for expungement.</p><p>This tool is provided for free by <a href='https://www.hackforla.org/' target='_blank' rel='noreferrer' style={{ textDecoration: 'underline' }}>Hack for LA</a>, a project under the nonprofit <a href='https://www.civictechstructure.org/' target='_blank' rel='noreferrer' style={{ textDecoration: 'underline' }}>Civic Tech Structure</a>.</p>",
228-
"paragraph2.1b": "This is not a replacement for legal advice.",
227+
"paragraph2.1a": "Expunge Assist is a free step-by-step tool that helps people with past convictions in California write a declaration. This is one part of the process for expungement.<br><br> This tool is provided for free by <Link href=\"https://www.hackforla.org/\" target='_blank' rel='noreferrer'>Hack for LA</Link>, a project under the nonprofit <Link href=\"https://www.civictechstructure.org/\" target='_blank' rel='noreferrer'>Civic Tech Structure</Link>.",
228+
"paragraph2.1b": "<br><br>This is not a replacement for legal advice.",
229229
"title2.2": "How does Expunge Assist protect my privacy?",
230230
"paragraph2.2a": "Expunge Assist does not store or save any of your data. Once you close your browser, your data is cleared. If any person or agencies were to search this site for your data, there would be no data to find. However, once you have downloaded, saved, or copied your declaration from our site to another location, it is your responsibility to keep that data secure.",
231-
"paragraph2.2b": "<p>Check our <a href='https://expungeassist.org/privacy-policy' target='_blank' style={{ textDecoration: 'underline' }}>Privacy Policy</a> to learn more.</p>",
231+
"paragraph2.2b": "<br><br>Check our <Link href=\"./privacy-policy\" target='_self'>Privacy Policy</Link> to learn more.",
232232
"title2.3": "My conviction was not in California. Can I still use Expunge Assist?",
233-
"paragraph2.3a": "This tool is currently intended only for people with past convictions in California. Each state has different rules for expungement, so you should check the laws of the state in which you have your conviction.",
233+
"paragraph2.3a": "This tool is currently intended only for people with past convictions in California. Each state has different rules for expungement, so you should check the laws of the state in which you have your conviction.<br><br>",
234234
"paragraph2.3b": "However, if your state requires or allows a declaration for expungement, then you may want to take a look at the Expunge Assist declaration generator as a guide for the writing process or to help get a better idea of what a declaration may contain.",
235235
"title2.4": "I see incorrect information on this website. What should I do?",
236-
"paragraph2.4a": "<p>Get in touch at <a href='mailto:expungeassist@hackforla.org' rel='noreferrer'>expungeassist@hackforla.org</a>. The laws change often in California, and that could mean some information is outdated in this website. We work to provide correct information, so please let us know if we missed something.</p>",
236+
"paragraph2.4a": "Get in touch at <Link href=\"mailto:expungeassist@hackforla.org\" rel='noreferrer'>expungeassist@hackforla.org</Link>. The laws change often in California, and that could mean some information is outdated in this website. We work to provide correct information, so please let us know if we missed something.<br><br>",
237237
"paragraph2.4b": "Please note: The information provided here is only a brief overview. We encourage you to speak with a lawyer or legal aid organization to learn about the pathway to expungement for your individual case.",
238238
"title2.5": "What if I have a question about Expunge Assist or the declaration generator that has not been answered?",
239-
"paragraph2.5a": "<p>If you have questions specific to Expunge Assist or Hack for LA such as about our site, the declaration generator, or operations and partner organizations, please reach out at <a href='mailto:expungeassist@hackforla.org' rel='noreferrer'>expungeassist@hackforla.org</a>, and we will try our best to answer them.</p>",
239+
"paragraph2.5a": "If you have questions specific to Expunge Assist or Hack for LA such as about our site, the declaration generator, or operations and partner organizations, please reach out at <Link href=\"mailto:expungeassist@hackforla.org\" rel='noreferrer'>expungeassist@hackforla.org</Link>, and we will try our best to answer them.<br><br>",
240240
"paragraph2.5b": "If you have a question about the laws or are seeking legal advice for your individual case, then you should contact a lawyer or local legal aid organization."
241241
},
242242
"about_us_page": {
243243
"page_header": "About Expunge Assist",
244244
"page_subtitle": "Helping Californians seeking expungement",
245245
"title1": "What is Expunge Assist?",
246246
"paragraph1": "Expunge Assist is a free step-by-step tool that helps people with past convictions in California write a declaration. It is one part of the expungement process.",
247-
"paragraph1b_a": "This free tool is provided by ",
248-
"paragraph1b_li1": "Hack for LA",
249-
"paragraph1b_b": ", a project under the nonprofit ",
250-
"paragraph1b_li2": "Civic Tech Structure",
251-
"paragraph1b_c": ".",
247+
"paragraph1b": "This free tool is provided by <Link href=\"https://www.hackforla.org/\" target='_blank' rel='noreferrer'>Hack for LA</Link>, a project under the nonprofit <Link href=\"https://www.civictechstructure.org/\" target='_blank' rel='noreferrer'>Civic Tech Structure</Link>.",
252248
"paragraph1c": "Expunge Assist is not a replacement for legal advice.",
253249
"title2": "Who we are",
254250
"paragraph2": "We are a team of volunteer designers, writers, engineers, and researchers building technology to improve LA County. Meet the current team and past contributors on Hack for LA’s website.",
255251
"title3": "Why expungement matters",
256-
"paragraph3_li1": "1 in 5 adults in California have a criminal record. Source: ",
257-
"paragraph3_li1_link": "Californians for Safety and Justice",
252+
"paragraph3_li1": "1 in 5 adults in California have a criminal record. Source: <Link href=\"https://safeandjust.org/interactivereport/repairing-the-road-to-redemption-in-california/#:~:text=Based%20on%20the%20experiences%20of,increase%20legal%20remedies%20and%20remove\" rel='noreferrer' target='_blank'>Californians for Safety and Justice</Link>",
258253
"paragraph3_li2": "Black people are disproportionately convicted of low-level, nonviolent crimes",
259-
"paragraph3_li3": "Half of those who successfully expunged their records found the process difficult. Source: ",
260-
"paragraph3_li3_link": "Alliance for Safety and Justice",
254+
"paragraph3_li3": "Half of those who successfully expunged their records found the process difficult. Source: <Link href=\"https://asj.allianceforsafetyandjustice.org/people-with-records-survey/\" rel='noreferrer' target='_blank'>Alliance for Safety and Justice</Link>",
261255
"title4": "Partner with us",
262256
"paragraph4": "We are seeking partnerships with clinics and organizations focused on expungement. Partnership means, in part, that Expunge Assist would tailor this product to the needs of your organization and clients, free of charge.",
263257
"paragraph4b": "Contact us to learn more."
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/* eslint-disable jsx-a11y/anchor-is-valid */
2+
// disabling -- lint is not recognizing that hrefs are being dynamically pulled from i18n translations
3+
4+
import React from 'react';
5+
import { Trans } from 'react-i18next';
6+
7+
import { makeStyles, createStyles } from '@material-ui/core';
8+
9+
import { LaunchOutlined } from '@material-ui/icons';
10+
11+
const useStyles = makeStyles(() =>
12+
createStyles({
13+
externalLinkIcon: {
14+
marginLeft: '2px',
15+
verticalAlign: 'middle',
16+
},
17+
link: {
18+
color: '#25003F',
19+
},
20+
})
21+
);
22+
23+
const DynamicLink = (props: React.AnchorHTMLAttributes<HTMLAnchorElement>) => {
24+
const { children, ...rest } = props;
25+
const isExternalLink = rest.href?.startsWith('http') || false;
26+
const classes = useStyles();
27+
28+
return (
29+
<>
30+
<a className={classes.link} {...rest}>
31+
{children}
32+
</a>
33+
{isExternalLink && (
34+
<LaunchOutlined fontSize="small" className={classes.externalLinkIcon} />
35+
)}
36+
</>
37+
);
38+
};
39+
40+
export default function DynamicText({ i18nkey }: any) {
41+
return <Trans i18nKey={i18nkey} components={{ Link: <DynamicLink /> }} />;
42+
}

products/statement-generator/src/components/FAQAccordion.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import MuiAccordionSummary, {
99
} from '@material-ui/core/AccordionSummary';
1010
import { styled } from '@material-ui/core/styles';
1111

12+
import DynamicText from './DynamicText';
13+
1214
interface CustomAccordionProps {
1315
title: string;
1416
content?: string[];
@@ -43,9 +45,7 @@ const useStyles = makeStyles(({ palette }) =>
4345
transform: 'rotate(270deg)',
4446
},
4547
accordionDetailsContainer: {
46-
display: 'flex',
47-
flexDirection: 'column',
48-
gap: '1rem',
48+
display: 'inline',
4949
padding: 0,
5050
width: '100%',
5151
paddingLeft: '40px',
@@ -95,9 +95,7 @@ export const FAQAccordion: React.FC<CustomAccordionProps> = ({
9595
<AccordionDetails style={{ padding: 0, width: '100%' }}>
9696
<div className={classes.accordionDetailsContainer}>
9797
{content &&
98-
content.map((paragraph) => (
99-
<Typography dangerouslySetInnerHTML={{ __html: t(paragraph) }} />
100-
))}
98+
content.map((paragraph) => <DynamicText i18nkey={paragraph} />)}
10199
{children && children}
102100
</div>
103101
</AccordionDetails>

products/statement-generator/src/components/LinkAsText.tsx

Lines changed: 0 additions & 28 deletions
This file was deleted.

products/statement-generator/src/pages-form/BeforeYouBegin.tsx

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { makeStyles, createStyles } from '@material-ui/core';
44

55
import ContentContainer from 'components-layout/ContentContainer';
66
import FlowNavigation from 'components-layout/FlowNavigation';
7+
import DynamicText from 'components/DynamicText';
8+
79
import ErrorRoundedIcon from '@material-ui/icons/ErrorRounded';
810

911
const useStyles = makeStyles(({ palette, breakpoints }) =>
@@ -110,37 +112,25 @@ const BeforeYouBegin = () => {
110112
</h3>
111113

112114
<h6>{t('before_you_begin_page.sectionTitle1')}</h6>
113-
<p
114-
/* eslint-disable-next-line react/no-danger */
115-
dangerouslySetInnerHTML={{
116-
__html: t('before_you_begin_page.sectionParagraph1'),
117-
}}
118-
/>
115+
<p>
116+
<DynamicText i18nkey="before_you_begin_page.sectionParagraph1" />
117+
</p>
119118
<h6>{t('before_you_begin_page.sectionTitle2')}</h6>
120-
<p
121-
/* eslint-disable-next-line react/no-danger */
122-
dangerouslySetInnerHTML={{
123-
__html: t('before_you_begin_page.sectionParagraph2'),
124-
}}
125-
/>
119+
<p>
120+
<DynamicText i18nkey="before_you_begin_page.sectionParagraph2" />
121+
</p>
126122
<h6>{t('before_you_begin_page.sectionTitle3')}</h6>
127-
<p
128-
/* eslint-disable-next-line react/no-danger */
129-
dangerouslySetInnerHTML={{
130-
__html: t('before_you_begin_page.sectionParagraph3'),
131-
}}
132-
/>
123+
<p>
124+
<DynamicText i18nkey="before_you_begin_page.sectionParagraph3" />
125+
</p>
133126
<div className={classes.alert}>
134127
<span>
135128
<ErrorRoundedIcon style={{ color: '#2F6FED' }} />
136129
</span>
137130
<h6>{t('before_you_begin_page.sectionTitle4')}</h6>
138-
<p
139-
/* eslint-disable-next-line react/no-danger */
140-
dangerouslySetInnerHTML={{
141-
__html: t('before_you_begin_page.sectionParagraph4'),
142-
}}
143-
/>
131+
<p>
132+
<DynamicText i18nkey="before_you_begin_page.sectionParagraph4" />
133+
</p>
144134
</div>
145135
<FlowNavigation />
146136
</ContentContainer>

0 commit comments

Comments
 (0)