Skip to content

Commit 1a3787c

Browse files
committed
add support for short and long descs
1 parent 7948563 commit 1a3787c

5 files changed

Lines changed: 55 additions & 8 deletions

File tree

src/components/QuestionSection.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import React from "react";
2+
3+
const QuestionSection = (props) => {
4+
return (
5+
<div>
6+
<h1>{props.questionText}</h1>
7+
{props.shortDesc ?
8+
<div class="shortDesc"><p>{props.shortDesc}</p></div>
9+
:
10+
<></>
11+
}
12+
{props.longDesc ?
13+
<div class="longDesc"><details><summary>Learn more about this question</summary>{props.longDesc}</details></div>
14+
:
15+
<></>
16+
}
17+
<br />
18+
{props.children}
19+
</div>
20+
21+
);
22+
}
23+
24+
export default QuestionSection;

src/components/clauses/YesNoState.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from "react";
33
import AppContext from "../AppContext";
44
import { navigate } from "gatsby";
55

6-
const YesNoState = ({ stateName, questionText, yesText, noText, yes, no }) => {
6+
const YesNoState = ({ stateName, questionText, yesText, noText, yes, no, shortDesc, longDesc }) => {
77
var dict = {
88
en: { yes: "Yes", no: "No" },
99
es: { yes: "Si", no: "No" }
@@ -27,7 +27,11 @@ const YesNoState = ({ stateName, questionText, yesText, noText, yes, no }) => {
2727
{({ appCtx, updateContext }) => {
2828
return (
2929
<div>
30-
<p>{questionText}</p>
30+
{ questionText ?
31+
<h2>{questionText}</h2>
32+
:
33+
<></>
34+
}
3135
<StyledPrimaryButton
3236
onClick={e => {
3337
onChange(true, appCtx, updateContext);

src/pages/eligibility/index.mdx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import Zip from "../../components/Zip"
22
import FlowSelector from "../../components/FlowSelector"
3+
import QuestionSection from "../../components/QuestionSection"
34

4-
What's your zip code? Depending on where you live, different laws can apply. Your zip code can help us figure out which protections may apply to you.
5-
6-
<Zip /><p></p>
5+
<QuestionSection
6+
questionText="What's your zip code?"
7+
shortDesc="Depending on where you live, different laws can apply. Your zip code can help us figure out which protections may apply to you."
8+
>
9+
<p><Zip /></p>
710
<FlowSelector errText="Please enter a valid California ZIP code" btnText="Look up!" />
11+
</QuestionSection>
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import YesNoState from "../../../components/clauses/YesNoState";
2+
import QuestionSection from "../../../components/QuestionSection";
23

4+
<QuestionSection
5+
questionText="Has everyone in your home lived there for at least 1 year (12 months), or, has at least 1 person lived in your home continuously for at least 2 years (24 months)?"
6+
longDesc={<><p>This questions helps us validate some criteria around eviction protections. In order to recieve 'just-cause' eviction protection everyone must have been a tenant for at least 1+ years (12+ months), or one of the tenants must have been a tenant for 2+ years (24+ months). When working out who is a tenant you shouldn't include children (under the age of 18) or elderly dependants (who live with a legal guardian).</p><p><strong>For example:</strong> Brian lives with his partner Maxine, their daughter Roxy and Brian's son Jake. Brian, Maxine and Roxy have been living in their unit for 14 months but Jake has only been living with Brian and Maxine for 6 months. Since Brian and Maxine have been been living in the unit for more than a year, and Roxy and Jake are both children then all the tenants have been in the unit for more than a year. Brian should answer 'yes' to this question.</p></>}
7+
>
38
<YesNoState
49
yes="/eligibility/state/ineligibleType"
510
no="/eligibility/state/ineligibleType"
6-
questionText="Has everyone in your home lived there for at least 1 year (12 months), or, has at least 1 person lived in your home continuously for at least 2 years (24 months)?"
11+
questionText=""
712
stateName="ab1482TenancyDuration"
8-
/>
13+
/>
14+
</QuestionSection>
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
import YesNoState from "../../../components/clauses/YesNoState";
2+
import QuestionSection from "../../../components/QuestionSection"
23

4+
<QuestionSection
5+
questionText="Are you renting subsidized housing or a school dorm?"
6+
shortDesc="Include buildings with LIHTC, or other goverment subsidies."
7+
longDesc={<><p>Buildings that recieve goverment subsidies, as well as some other types of building such as school dorms are exempt from the Tenant Protection Act 2019.</p>
8+
<p>If you rent a school dorm only answer yes if it is owned by the school you go to, do not include dorms owned by private landlords. Schools must be either K-12 or accredited higher education colleges.</p>
9+
<p>If you live in housing subsidized by a government program click yes.</p>
10+
<p>This question helps us understand if you may live in a unit that isn't eligible for some or all of the protections in the Tenant Protection Act. That said, most of the units that are exempt from the Teant Protection Act have other forms of protections that you may be eligble for. If in doubt reach out for support to a local housing rights group. Once you finish these eligibility questions we'll give you an easy way to connect with one.</p></>}
11+
>
312
<YesNoState
413
yes="/eligibility/state/vouchers"
514
no="/eligibility/state/buildingAge"
6-
questionText="Are you renting subsidized housing or a college/school dorm? This includes buildings with LIHTC."
715
stateName="ineligibleType"
816
/>
17+
</QuestionSection>

0 commit comments

Comments
 (0)