Skip to content
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

fix(Accordion): Accordion sticky footer story #2483

Merged
merged 1 commit into from Nov 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 17 additions & 8 deletions packages/orbit-components/src/Accordion/Accordion.stories.js
Expand Up @@ -6,15 +6,24 @@ import Text from "../Text";
import Button from "../Button";
import Stack from "../Stack";
import AccordionSection from "./AccordionSection";
import useMediaQuery from "../hooks/useMediaQuery";

import Accordion from "./index";

const tmpFooter = (
<Stack direction="row" justify="between">
<Button type="secondary">Back to previous segment</Button>
<Button type="primarySubtle">Continue to next segment</Button>
</Stack>
);
const Footer = () => {
const { isTablet, isMediumMobile } = useMediaQuery();

return (
<Stack flex shrink justify="between" direction={isMediumMobile ? "row" : "column"}>
<Button fullWidth={!isTablet} type="secondary">
Back to previous segment
</Button>
<Button fullWidth={!isTablet} type="primarySubtle">
Continue to next segment
</Button>
</Stack>
);
};

storiesOf("Accordion", module)
.add("Default", () => {
Expand Down Expand Up @@ -185,7 +194,7 @@ storiesOf("Accordion", module)
<Text size="small">This is a header label</Text>
</Stack>
}
footer={tmpFooter}
footer={<Footer />}
>
<Text type="primary">This is a content text</Text>
<Text type="primary">This is a content text</Text>
Expand All @@ -212,7 +221,7 @@ storiesOf("Accordion", module)
<Text size="small">This is a content text</Text>
</Stack>
}
footer={tmpFooter}
footer={<Footer />}
>
<Text type="primary">This is a content text</Text>
<Text type="primary">This is a content text</Text>
Expand Down
Expand Up @@ -11,6 +11,7 @@ const Wrapper = styled.div`
background-color: ${({ theme }) => theme.orbit.paletteWhite};
position: sticky;
bottom: 0;
box-sizing: border-box;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this help? I tried turning it off and on and it doesn't seem to make a difference.

box-shadow: ${({ theme }) => theme.orbit.boxShadowActionActive};
`;

Expand Down