-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new, empty eviction free site. #1800
Changes from all commits
b58d322
722ac85
22140f0
d589835
e8d99d7
46b148d
489a58a
2a0bee9
4f27d0d
aa2a09f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
[ | ||
["JUSTFIX", "JustFix.nyc"], | ||
["NORENT", "NoRent.org"] | ||
["NORENT", "NoRent.org"], | ||
["EVICTIONFREE", "EvictionFree.org"] | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Trans } from "@lingui/macro"; | ||
import React from "react"; | ||
import { Link } from "react-router-dom"; | ||
import { EvictionFreeRoutes } from "./route-info"; | ||
|
||
export const EvictionFreeHomePage: React.FC<{}> = () => ( | ||
<> | ||
<p> | ||
<Trans>This is a test localization message for EvictionFree.</Trans> | ||
</p> | ||
<p> | ||
{/** This will eventually be replaced by a navbar link. */} | ||
<Link to={EvictionFreeRoutes.dev.home}>Development tools</Link> | ||
</p> | ||
</> | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { createRoutesForSite, ROUTE_PREFIX } from "../util/route-util"; | ||
import { createDevRouteInfo } from "../dev/route-info"; | ||
|
||
function createLocalizedRouteInfo(prefix: string) { | ||
return { | ||
/** The locale prefix, e.g. `/en`. */ | ||
[ROUTE_PREFIX]: prefix, | ||
|
||
/** The home page. */ | ||
home: `${prefix}/`, | ||
}; | ||
} | ||
|
||
export const EvictionFreeRoutes = createRoutesForSite( | ||
createLocalizedRouteInfo, | ||
{ | ||
/** | ||
* Example pages used in integration tests, and other | ||
* development-related pages. | ||
*/ | ||
dev: createDevRouteInfo("/dev"), | ||
} | ||
); | ||
Comment on lines
+1
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice! loving the new |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import loadable from "@loadable/component"; | ||
import { friendlyLoad, LoadingPage } from "../networking/loading-page"; | ||
import React from "react"; | ||
import { NotFound } from "../pages/not-found"; | ||
import { Route, RouteComponentProps, Switch } from "react-router-dom"; | ||
import { EvictionFreeRoutes as Routes } from "./route-info"; | ||
import { EvictionFreeHomePage } from "./homepage"; | ||
|
||
const LoadableDevRoutes = loadable( | ||
() => friendlyLoad(import("../dev/routes")), | ||
{ | ||
fallback: <LoadingPage />, | ||
} | ||
); | ||
|
||
export const EvictionFreeRouteComponent: React.FC<RouteComponentProps> = ( | ||
props | ||
) => { | ||
const { location } = props; | ||
if (!Routes.routeMap.exists(location.pathname)) { | ||
return NotFound(props); | ||
} | ||
return ( | ||
<Switch location={location}> | ||
<Route path={Routes.locale.home} exact component={EvictionFreeHomePage} /> | ||
<Route path={Routes.dev.prefix} component={LoadableDevRoutes} /> | ||
<Route component={NotFound} /> | ||
</Switch> | ||
); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import loadable from "@loadable/component"; | ||
import React from "react"; | ||
import { Route } from "react-router-dom"; | ||
import type { AppSiteProps } from "../app"; | ||
import { createLinguiCatalogLoader } from "../i18n-lingui"; | ||
import { LoadingOverlayManager } from "../networking/loading-page"; | ||
import { EvictionFreeRouteComponent } from "./routes"; | ||
|
||
export const EvictionFreeLinguiI18n = createLinguiCatalogLoader({ | ||
en: loadable.lib( | ||
() => import("../../../locales/en/evictionfree.chunk") as any | ||
), | ||
es: loadable.lib( | ||
() => import("../../../locales/es/evictionfree.chunk") as any | ||
), | ||
}); | ||
|
||
const EvictionFreeSite = React.forwardRef<HTMLDivElement, AppSiteProps>( | ||
(props, ref) => { | ||
return ( | ||
<EvictionFreeLinguiI18n> | ||
<section> | ||
<div ref={ref} data-jf-is-noninteractive tabIndex={-1}> | ||
<LoadingOverlayManager> | ||
<Route component={EvictionFreeRouteComponent} /> | ||
</LoadingOverlayManager> | ||
</div> | ||
</section> | ||
</EvictionFreeLinguiI18n> | ||
); | ||
} | ||
); | ||
|
||
export default EvictionFreeSite; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from "react"; | ||
import { AppTesterPal } from "../../tests/app-tester-pal"; | ||
import { Route } from "react-router-dom"; | ||
import { waitFor } from "@testing-library/react"; | ||
import EvictionFreeSite from "../site"; | ||
|
||
describe("EvictionFreeSite", () => { | ||
const route = <Route render={(props) => <EvictionFreeSite {...props} />} />; | ||
|
||
it("renders 404 page", () => { | ||
const pal = new AppTesterPal(route, { url: "/blarg" }); | ||
waitFor(() => pal.rr.getByText(/doesn't seem to exist/i)); | ||
}); | ||
|
||
it("renders home page", () => { | ||
const pal = new AppTesterPal(route, { url: "/en/" }); | ||
waitFor(() => | ||
pal.rr.getByText(/This is a test localization message for EvictionFree/i) | ||
); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,10 @@ export function hasLoggedInUserAgreedToTerms(s: AllSessionInfo): boolean { | |
|
||
case "NORENT": | ||
return s.onboardingInfo.agreedToNorentTerms; | ||
|
||
case "EVICTIONFREE": | ||
// TODO: Need to figure out if we need separate terms for EvictionFree! | ||
return s.onboardingInfo.agreedToJustfixTerms; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should file a github or clubhouse issue for this to make sure we don't forget about it. |
||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,9 @@ function getSiteBaseName(siteType: SiteChoice): string { | |
|
||
case "NORENT": | ||
return "NoRent.org"; | ||
|
||
case "EVICTIONFREE": | ||
return "EvictionFree.org"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We may need to change this based on what our final domain name is, so we should file an issue to address this later. |
||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,10 @@ function getURLforSite(baseURL: string, site: SiteChoice): string { | |
|
||
case "NORENT": | ||
return `${baseURL}-norent`; | ||
|
||
case "EVICTIONFREE": | ||
// TODO: Figure out if we need a separate privacy policy / terms for EvictionFree! | ||
return baseURL; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, file an issue to address this later. |
||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@charset "utf-8"; | ||
|
||
@import "../../../node_modules/bulma/bulma.sass"; | ||
@import "../_a11y.scss"; | ||
@import "../_safe-mode.scss"; | ||
@import "../_loading-overlay.scss"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should file a github or clubhouse issue for this to make sure we don't forget about it.