-
Notifications
You must be signed in to change notification settings - Fork 72
[LG-5760] chore: FormFooter Sticky Styling #3344
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
base: main
Are you sure you want to change the base?
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,7 @@ import { css } from '@leafygreen-ui/emotion'; | |
| import { Icon } from '@leafygreen-ui/icon'; | ||
| import { MenuItem } from '@leafygreen-ui/menu'; | ||
|
|
||
| import FormFooter, { FormFooterProps } from '.'; | ||
| import { FormFooter, FormFooterProps } from '.'; | ||
|
|
||
| const wrapperStyle = css` | ||
| min-width: 40vw; | ||
|
|
@@ -80,6 +80,31 @@ const Template: StoryType<typeof FormFooter> = ({ | |
| /> | ||
| ); | ||
|
|
||
| const StickyTemplate: StoryType<typeof FormFooter> = ({ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this is intended to be a chromatic snapshot, it could be made more realistic by setting
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know if we necessarily need to test that the sticky behavior works on scroll, and just leave it with a test confirming that adding |
||
| primaryButtonProps, | ||
| ...args | ||
| }: FormFooterStoryProps) => ( | ||
| <div style={{ margin: `-100px` }}> | ||
| <div | ||
| className={css` | ||
| padding: 24px; | ||
| height: 100vh; | ||
| overflow: hidden; | ||
| `} | ||
| > | ||
| <h2>Scroll down to see the sticky footer in action</h2> | ||
| <p>This content creates scrollable space...</p> | ||
| </div> | ||
| <FormFooter | ||
| {...args} | ||
| primaryButtonProps={{ children: 'Button', variant: 'primary' }} | ||
| className={css` | ||
| position: sticky; | ||
| bottom: 0; | ||
| `} | ||
| /> | ||
| </div> | ||
| ); | ||
| export const LiveExample: StoryObj<FormFooterProps> = { | ||
| render: Template, | ||
| parameters: { | ||
|
|
@@ -120,3 +145,15 @@ export const DarkMode: StoryObj<typeof FormFooter> = { | |
| darkMode: true, | ||
| }, | ||
| }; | ||
|
|
||
| export const StickyFooter: StoryObj<typeof FormFooter> = { | ||
| render: StickyTemplate, | ||
| decorators: [], | ||
| parameters: { | ||
| layout: 'fullscreen', | ||
adamrasheed marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| args: { | ||
| backButtonProps: { children: 'Back' }, | ||
| cancelButtonProps: { children: 'Cancel' }, | ||
| }, | ||
| }; | ||
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.
missing changeset