Add option to save on localstorage#14
Merged
jpedroschmitz merged 1 commit intojpedroschmitz:mainfrom Mar 24, 2026
Merged
Conversation
Contributor
|
@willianjusten is attempting to deploy a commit to the João Pedro Team on Vercel. A member of the Team first needs to authorize it. |
willianjusten
commented
Mar 21, 2026
Comment on lines
-264
to
+279
| <button | ||
| type="submit" | ||
| className="rounded-md bg-indigo-600 px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 mt-10" | ||
| disabled={isGenerating} | ||
| > | ||
| Download PDF | ||
| </button> | ||
| <div className="flex flex-wrap gap-4 mt-10"> | ||
| <Button type="submit" color="indigo" disabled={isGenerating}> |
Contributor
Author
There was a problem hiding this comment.
I know the styles are a little bit different, but as to me, it makes more sense to use the buttons defined in the UI, so they're all cohesive.
willianjusten
commented
Mar 21, 2026
| try { | ||
| const data = getValues(); | ||
| localStorage.setItem(STORAGE_KEY, JSON.stringify(data)); | ||
| setHasSavedData(true); |
Contributor
Author
There was a problem hiding this comment.
I didn't add any posthog event, but if you want, we can add it.
1577f3f to
a016588
Compare
willianjusten
commented
Mar 21, 2026
Comment on lines
+189
to
+193
| <Controller | ||
| control={control} | ||
| name={`services.${index}.amount`} | ||
| render={({ field: { onChange, value, name } }) => ( | ||
| <CurrencyInput |
Contributor
Author
There was a problem hiding this comment.
I needed to change to a controlled input, so it can be reset/loaded with different values, also in order to save only the numbers instead of the full string with currency code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The idea is to keep the privacy of the data, so it's going to be store only on localstorage.
Another detail, is that we don't load the data directly, only if they want and also add an option to clear the data, keeping a bit more safe to the customer as well.
Video
Screen.Recording.2026-03-21.at.20.01.35.mov