mckeemseattleu / St-Francis

Internal dashboard for customer intake
https://st-francis.vercel.app/
2 stars 3 forks source link

Add a save button on checkout page #72

Closed ducmvo closed 1 year ago

ducmvo commented 1 year ago

Currently in checkout page there only a save and checkout button. There should be a save button to update visit data without checking out a client The save and check out button should display only for currently checked in client

lmeng25 commented 1 year ago

Currently VisitInfoForm has only one submit button and the button is used on multiple pages, like check-in, check-out, and editing visit details. I am thinking about adding another button in VisitInfoForm next to the existing one, conditionally displayed and controlled by adding a new param showSaveButton. Like: `{showSaveButton && ( <Button type="submit" className={styles.submitBtn} onClick={handleSubmit}

Save )} `

The problem is that I'm not sure how to avoid triggering the Modal on the checkout page when clicking on the new save button. Currently the two buttons perform the same functionality.

Any thoughts would be appreciated! @Kevinjchang98 @ducmvo

ducmvo commented 1 year ago

Currently VisitInfoForm has only one submit button and the button is used on multiple pages, like check-in, check-out, and editing visit details. I am thinking about adding another button in VisitInfoForm next to the existing one, conditionally displayed and controlled by adding a new param showSaveButton. Like: {showSaveButton && ( <Button type="submit" className={styles.submitBtn} onClick={handleSubmit} > Save </Button> )}

The problem is that I'm not sure how to avoid triggering the Modal on the checkout page when clicking on the new save button. Currently the two buttons perform the same functionality.

Any thoughts would be appreciated! @Kevinjchang98 @ducmvo

Can we add a Save only button on the checkout Modal itself instead since it's more specific to the checkout page than the VisitInfoForm? @lmeng25 @Kevinjchang98

lmeng25 commented 1 year ago

Currently VisitInfoForm has only one submit button and the button is used on multiple pages, like check-in, check-out, and editing visit details. I am thinking about adding another button in VisitInfoForm next to the existing one, conditionally displayed and controlled by adding a new param showSaveButton. Like: {showSaveButton && ( <Button type="submit" className={styles.submitBtn} onClick={handleSubmit} > Save </Button> )} The problem is that I'm not sure how to avoid triggering the Modal on the checkout page when clicking on the new save button. Currently the two buttons perform the same functionality. Any thoughts would be appreciated! @Kevinjchang98 @ducmvo

Can we add a Save only button on the checkout Modal itself instead since it's more specific to the checkout page than the VisitInfoForm? @lmeng25 @Kevinjchang98

Okay sound good to me! Are we talking about something like this? @ducmvo

image

ducmvo commented 1 year ago

Currently VisitInfoForm has only one submit button and the button is used on multiple pages, like check-in, check-out, and editing visit details. I am thinking about adding another button in VisitInfoForm next to the existing one, conditionally displayed and controlled by adding a new param showSaveButton. Like: {showSaveButton && ( <Button type="submit" className={styles.submitBtn} onClick={handleSubmit} > Save </Button> )} The problem is that I'm not sure how to avoid triggering the Modal on the checkout page when clicking on the new save button. Currently the two buttons perform the same functionality. Any thoughts would be appreciated! @Kevinjchang98 @ducmvo

Can we add a Save only button on the checkout Modal itself instead since it's more specific to the checkout page than the VisitInfoForm? @lmeng25 @Kevinjchang98

Okay sound good to me! Are we talking about something like this? @ducmvo

image

Yes

Nit: could we move the "Save Only" button to the middle since since the primary action is "Confirm Checkout"