Skip to content

Commit

Permalink
Tp 2543 change where the button is on forms (#163)
Browse files Browse the repository at this point in the history
* TP-2543-change-where-the-button-is-on-forms
  • Loading branch information
sharlotta93 authored Oct 18, 2024
1 parent 1cfdcea commit 212813d
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 31 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@awell-health/ui-library",
"version": "0.1.72",
"version": "0.1.73",
"description": "UI components to integrate with Awell Health",
"repository": {
"type": "git",
Expand Down
42 changes: 20 additions & 22 deletions src/hostedPages/activities/form/TraditionalForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,28 +114,26 @@ export const TraditionalForm = ({
ref={scrollHintOverlayRef}
className={classes.scroll_hint_overlay}
></div>
<div className={classes.footer_for_traditional_for}>
<HostedPageFooter showScrollHint={false}>
<div className={classes.traditional_button_wrapper}>
{formHasErrors && (
<div>
<Text variant="textSmall" color="var(--awell-signalError100)">
{errorLabels.formHasErrors}
</Text>
</div>
)}
<div></div>
<Button
onClick={submitForm}
type="submit"
data-cy="submitFormButton"
disabled={isSubmittingForm}
>
{buttonLabels.submit}
</Button>
</div>
</HostedPageFooter>
</div>
<HostedPageFooter showScrollHint={false} fixPosition={true}>
<div className={classes.traditional_button_wrapper}>
{formHasErrors && (
<div>
<Text variant="textSmall" color="var(--awell-signalError100)">
{errorLabels.formHasErrors}
</Text>
</div>
)}
<div></div>
<Button
onClick={submitForm}
type="submit"
data-cy="submitFormButton"
disabled={isSubmittingForm}
>
{buttonLabels.submit}
</Button>
</div>
</HostedPageFooter>
</div>
)
}
7 changes: 0 additions & 7 deletions src/hostedPages/activities/form/form.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,3 @@
pointer-events: none; /* Prevent interaction */
transition: top 0.5s ease-in-out;
}

.footer_for_traditional_form {
width: 100%;
position: fixed;
bottom: 0;
left: 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@ import classes from './hostedPageFooter.module.scss'
export interface HostedPageFooterProps {
children: React.ReactNode | string
showScrollHint?: boolean
fixPosition?: boolean
}

export const HostedPageFooter: FC<HostedPageFooterProps> = ({
children,
showScrollHint = false,
fixPosition = false,
}) => {
const footerClass = fixPosition
? `${classes.footer} ${classes.fixed}`
: classes.footer

return (
<footer className={classes.footer}>
<footer className={footerClass}>
<div
className={`${classes.scrollHint} ${
showScrollHint ? classes.visible : classes.hidden
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
height: var(--awell-footer-height);
}

&.fixed {
position: fixed;
bottom: 0;
left: 0;
}

& .scrollHint {
position: absolute;
bottom: var(--awell-mobile-footer-height);
Expand Down

0 comments on commit 212813d

Please sign in to comment.