-
Notifications
You must be signed in to change notification settings - Fork 3
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
Adds transcript form #25
Conversation
}; | ||
|
||
const setAlert = () => { | ||
if (showAlert) { |
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.
this logic of showAlert
should be in the place where it's importing this CustomAlert. I wonder if in storybooks you can add a button to toggle the alert to come up?
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.
Ooh yeah - I think that's the knobs. I'll try and add one :)
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.
So I'm not sure knobs work as expected with functional components — I've managed to allow users to toggle a button to turn the alert on and off, but the component doesn't re-render when the props change using the add-on.
I have separated the CustomAlert from the TranscriptCard; I think you're right in that that will be handled by the parent component.
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.
The showAlert should probably be a state of the parent component 🤔 which also implies that maybe the actual handling functions should also be in the parent component.
Co-Authored-By: Eimi Okuno <[email protected]>
Co-Authored-By: Eimi Okuno <[email protected]>
Co-Authored-By: Eimi Okuno <[email protected]>
Co-Authored-By: Eimi Okuno <[email protected]>
Co-Authored-By: Eimi Okuno <[email protected]>
Some comments re: the code review:
|
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.
suggestion: ShowAlert in parent component as state? Maybe this is a bigger refactor step. Might be something we can put off for a bit. Everything else seems good though! Just wanted to get your thoughts on it :)
}; | ||
|
||
const setAlert = () => { | ||
if (showAlert) { |
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.
The showAlert should probably be a state of the parent component 🤔 which also implies that maybe the actual handling functions should also be in the parent component.
No definitely agree! I think a step further down the line because so far, there isn't a parent component in Storybook. But agree 100% |
Is your Pull Request request related to another issue in this repository ?
Issue #7
Describe what the PR does
ItemForm
from theFormModal
storyFormModal
story featuringTranscriptForm
CustomAlert
component as part of theTranscriptForm
component, as per the ticketState whether the PR is ready for review or whether it needs extra work
Ready
Additional context
Outstanding question: I'm not sure the CustomAlert should be a part of the TranscriptForm; when in the cycle would the TranscriptForm know that a transcription has failed? Because the ApiWrapper has now been decoupled, and that logic left to a parent component, we probably wouldn't pass error messages back down...? @jamesdools and @emettely let me know what you think.