-
Notifications
You must be signed in to change notification settings - Fork 11
[Enhancement] - Update Landing Page UI #218
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
Changes from all commits
b87b8d8
dc228c4
322fcdb
07cac3e
a0cb431
751478f
f9b584c
8e33af5
8bbb346
ef36915
8f149a3
a8f2985
2d0377b
929abfc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import { Link } from "react-router-dom"; | ||
|
|
||
| interface Props { | ||
| isOngoing: boolean; | ||
| } | ||
|
|
||
| export default function LetterDisclaimer({ isOngoing }: Props) { | ||
| return isOngoing ? ( | ||
| <span> | ||
| <strong>Disclaimer</strong>: This tool provides general information and | ||
| drafts letters based solely on what you enter. It is not legal advice and | ||
| does not create an attorney–client relationship. As explained further in | ||
| the{" "} | ||
| <Link to="/privacy-policy" target="_blank" className="underline"> | ||
| Privacy Policy | ||
| </Link> | ||
| , we do not save any data from these conversations, but you can enter your | ||
| personal information into the chatbox and it will appear in the | ||
| corresponding brackets of the letter. | ||
| </span> | ||
| ) : ( | ||
| <span> | ||
| The information provided by this chatbot is general information only and | ||
| does not constitute legal advice. While Tenant First Aid strives to keep | ||
| the content accurate and up to date, completeness and accuracy is not | ||
| guaranteed. If you have a specific legal issue or question, consider | ||
| contacting a qualified attorney or a local legal aid clinic for | ||
| personalized assistance. | ||
| </span> | ||
| ); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| interface Props { | ||
| ref: React.RefObject<HTMLDialogElement | null>; | ||
| } | ||
|
|
||
| export default function LetterGenerationDialog({ ref }: Props) { | ||
| return ( | ||
| <dialog | ||
| ref={ref} | ||
| aria-label="letter-dialog-modal" | ||
| aria-labelledby="letter-dialog-title" | ||
| aria-describedby="letter-dialog-description" | ||
| className="rounded-lg p-6 min-w-[300px] max-w-[600px] fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2" | ||
| > | ||
| <div className="flex flex-col items-end"> | ||
| <h2 id="letter-dialog-title" className="sr-only"> | ||
| Letter Generation Notice | ||
| </h2> | ||
| <p id="letter-dialog-description"> | ||
| You've been redirected here so we can help you create a letter to your | ||
| landlord. It'll take a few seconds to complete your initial letter. | ||
| You could instruct the tool to update the letter to your liking after | ||
| it's generated. Once your letter is complete, you should go back to | ||
| your previous page and follow the remaining steps. | ||
|
Comment on lines
+18
to
+23
Contributor
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. Should we store this in a
Contributor
Author
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. When we start making more modals, think it'll be a good time to move this to a const It should be fine for a one off |
||
| </p> | ||
| <button | ||
| onClick={() => ref.current?.close()} | ||
| className="cursor-pointer underline text-blue-600 hover:text-blue-500 text-sm" | ||
| > | ||
| close | ||
| </button> | ||
| </div> | ||
| </dialog> | ||
| ); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| import { | ||
| CitySelectOptions, | ||
| type CitySelectOptionType, | ||
| } from "../../Chat/components/CitySelectField"; | ||
|
|
||
| interface IBuildLetterReturnType { | ||
| userMessage: string; | ||
| selectedLocation: CitySelectOptionType; | ||
| } | ||
|
|
||
| function buildLetterUserMessage( | ||
| org: string, | ||
| loc: string | undefined, | ||
| ): IBuildLetterReturnType | null { | ||
| const selectedLocation = CitySelectOptions[loc || "oregon"]; | ||
| if (selectedLocation === undefined) return null; | ||
| const locationString = | ||
| selectedLocation.city && selectedLocation.state | ||
| ? `${selectedLocation.city}, ${selectedLocation.state}` | ||
| : selectedLocation.city || selectedLocation.state?.toUpperCase() || ""; | ||
| const sanitizedOrg = org | ||
| .replace(/[<>'"{}[\]]/g, "") | ||
| .trim() | ||
| .slice(0, 100); | ||
| const promptParts = [ | ||
| `Hello, I've been redirected from ${sanitizedOrg}.`, | ||
| `Draft a letter related to housing issues for my area${locationString ? ` (${locationString})` : ""} to my landlord.`, | ||
| `Use the information in this prompt to generate a letter to my landlord.`, | ||
| `The issue could be maintenance issues, unsafe conditions, or anything else affecting my home, use a broken faucet as an example.`, | ||
| `Update the letter as we discuss.`, | ||
| `Update all placeholders for city and state in the letter with${locationString ? ` (${locationString})` : ""}`, | ||
| `When all but the signature placeholder have been replaced, please confirm that I have proof-read the letter for accuracy in content and tone,`, | ||
| `provide instructions for how to copy and paste(formatted) the letter from the browser into a application of my choice,`, | ||
| `the necessary and optional notification / deliveries to the recipient(s), and retention / receipt best practices.`, | ||
| `Have the user follow the steps mention from ${sanitizedOrg} first after letter completion, if there were any.`, | ||
| ]; | ||
|
|
||
| return { | ||
| userMessage: promptParts.join(" "), | ||
| selectedLocation, | ||
| }; | ||
| } | ||
|
|
||
| export { buildLetterUserMessage }; |
Uh oh!
There was an error while loading. Please reload this page.