spike: using history.back() for 'Back' button#8
Open
hqtan wants to merge 2 commits intowork-onsite-days-page-initial-setupfrom
Open
spike: using history.back() for 'Back' button#8hqtan wants to merge 2 commits intowork-onsite-days-page-initial-setupfrom
history.back() for 'Back' button#8hqtan wants to merge 2 commits intowork-onsite-days-page-initial-setupfrom
Conversation
- replaced `<BackButton>` component with `<Button>` component from Chakra UI - `onClick` handler for 'Back' `<Button>` will save responses, send logs, then browse back to previous page (using browser history)
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/hqtan/hqtan-council-emissions-calculator-spike/7eoaSp6LeQrrhzHw5tQSESqoSnJU |
hqtan
commented
Mar 14, 2022
Comment on lines
+56
to
+64
| <Button | ||
| onClick={() => backButtonOnClickHandler()} | ||
| variant="ghost" | ||
| > | ||
| <BackArrow /> | ||
| <Text ms={2} as="u" color="var(--chakra-colors-blue-600)"> | ||
| {"Back"} | ||
| </Text> | ||
| </Button> |
Owner
Author
There was a problem hiding this comment.
replace <BackButton> component with regular Chakra <Button> component:
- we no longer have to wrap
<Button>component inside a<Link>component
hqtan
commented
Mar 14, 2022
Comment on lines
+48
to
+50
| const backButtonOnClickHandler = (msg="Back button clicked") => { | ||
| saveDataAndShowLog(msg) | ||
| history.back(); |
Owner
Author
There was a problem hiding this comment.
'Back' <Button>'s onClick handler.
saves responses, and sends logs, then goes to previous page using browser's history.back() function.
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.
<BackButton>component with<Button>component from Chakra UIonClickhandler for 'Back'<Button>will save responses, send logs, thenbrowse back to previous page (using browser history)