-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(modal): add custom modal with scrolling content variant
style(modal): add quotes to backgroundimage style(modal): linter fixes and docs cleanup fix(modal): update image style(modal): add double quotes
- Loading branch information
1 parent
978fef4
commit b9ec7ee
Showing
5 changed files
with
282 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import classnames from 'classnames'; | ||
import { Modal } from './Modal'; | ||
import { Grid } from '../Grid'; | ||
|
||
export const ModalScrollableCols = ({ | ||
active, | ||
className, | ||
headerActions, | ||
headerImage, | ||
form, | ||
isClosing, | ||
onExit, | ||
preview, | ||
title, | ||
...rest | ||
}) => { | ||
const classNames = classnames( | ||
'modal-scrollable-cols__modal', | ||
className, | ||
); | ||
|
||
return ( | ||
<Modal | ||
active={active} | ||
className={classNames} | ||
size={Modal.SIZES.LG} | ||
{...rest} | ||
> | ||
<Modal.Header | ||
image={headerImage} | ||
title={title} | ||
aside={headerActions} | ||
/> | ||
<Modal.Body> | ||
<Grid.Row className="modal-scrollable-cols__container"> | ||
<Grid.Col className="modal-scrollable-cols__sidebar modal-scrollable-cols__fixed-column"> | ||
{form && ( | ||
<div className="modal-scrollable-cols__fixed-column-scroll"> | ||
{ form } | ||
</div> | ||
)} | ||
</Grid.Col> | ||
<Grid.Col className="modal-scrollable-cols__preview modal-scrollable-cols__fixed-column"> | ||
{preview && ( | ||
<div className="modal-scrollable-cols__fixed-column-scroll"> | ||
{ preview } | ||
</div> | ||
)} | ||
</Grid.Col> | ||
</Grid.Row> | ||
</Modal.Body> | ||
</Modal> | ||
); | ||
}; | ||
|
||
ModalScrollableCols.defaultProps = { | ||
active: false, | ||
className: '', | ||
headerActions: null, | ||
headerImage: null, | ||
form: null, | ||
isClosing: PropTypes.bool, | ||
onExit: (val) => val, | ||
preview: null, | ||
title: '', | ||
}; | ||
|
||
ModalScrollableCols.propTypes = { | ||
active: PropTypes.bool, | ||
className: PropTypes.string, | ||
headerActions: PropTypes.node, | ||
headerImage: PropTypes.string, | ||
form: PropTypes.node, | ||
isClosing: PropTypes.bool, | ||
onExit: PropTypes.func, | ||
preview: PropTypes.node, | ||
title: PropTypes.string, | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.