Skip to content

Commit

Permalink
fix: panel: footer not sticking to the bottom (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
ychhabra-eightfold authored Apr 28, 2022
1 parent 74c2594 commit 3b77737
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
8 changes: 8 additions & 0 deletions src/components/Panel/Panel.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ export const Default = () => {
<Panel
title={'This is a title'}
visible={visible.medium}
footer={
<div>
<PrimaryButton
text={'Close'}
onClick={() => setVisible({})}
/>
</div>
}
size={PanelSize.medium}
onClose={() => setVisible({})}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Panel/Panel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('Panel', () => {
});
wrapper.find('.panelBackdrop').at(0).simulate('click');

wrapper.find('.buttonDefault').at(0).simulate('click');
wrapper.find('.buttonNeutral').at(0).simulate('click');
expect(onClose).toHaveBeenCalledTimes(2);

wrapper.setProps({
Expand Down
4 changes: 2 additions & 2 deletions src/components/Panel/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React, {
import { classNames, stopPropagation } from '../../shared/utilities';
import { PanelProps, PanelRef, PanelSize } from './';
import { IconName } from '../Icon';
import { DefaultButton } from '../Button';
import { NeutralButton } from '../Button';
import { Portal } from '../Portal';
import { useScrollLock } from '../../hooks/useScrollLock';

Expand Down Expand Up @@ -114,7 +114,7 @@ export const Panel = React.forwardRef<PanelRef, PanelProps>(
<div className={headerClasses}>
<div>{title}</div>
{closable && (
<DefaultButton
<NeutralButton
icon={closeIcon}
ariaLabel={'Close'}
onClick={onClose}
Expand Down
3 changes: 3 additions & 0 deletions src/components/Panel/panel.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
@include backdrop;

.panel {
display: flex;
flex-direction: column;
position: absolute;
padding: 0 $space-xl;
background: var(--background-color);
Expand Down Expand Up @@ -70,6 +72,7 @@

.body {
display: flex;
flex-grow: 1;
flex-direction: column;
align-items: stretch;
}
Expand Down

0 comments on commit 3b77737

Please sign in to comment.