-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
531 additions
and
107 deletions.
There are no files selected for viewing
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
7 changes: 3 additions & 4 deletions
7
src/Sulu/Bundle/AdminBundle/Resources/js/components/Backdrop/backdrop.scss
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 |
---|---|---|
@@ -1,17 +1,16 @@ | ||
@import '../../containers/Application/colors.scss'; | ||
|
||
$backdropBackground: $black; | ||
$backdropBackground: rgba($dustyGrey, .9); | ||
|
||
.backdrop { | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background-color: $backdropBackground; | ||
opacity: 0; | ||
background: transparent; | ||
|
||
&.is-visible { | ||
opacity: .4; | ||
background: $backdropBackground; | ||
} | ||
} |
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
6 changes: 6 additions & 0 deletions
6
...le/AdminBundle/Resources/js/components/Backdrop/tests/__snapshots__/Backdrop.test.js.snap
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
83 changes: 71 additions & 12 deletions
83
src/Sulu/Bundle/AdminBundle/Resources/js/components/Modal/Modal.js
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
59 changes: 59 additions & 0 deletions
59
src/Sulu/Bundle/AdminBundle/Resources/js/components/Modal/ModalBox.js
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,59 @@ | ||
// @flow | ||
import React from 'react'; | ||
import Icon from '../Icon'; | ||
import type {ModalProps, Action} from './types'; | ||
import modalBoxStyles from './modalBox.scss'; | ||
|
||
type Props = ModalProps & { | ||
onRequestClose: () => void, | ||
} | ||
|
||
const CLOSE_ICON = 'times'; | ||
|
||
export default class ModalBox extends React.PureComponent<Props> { | ||
static defaultProps = { | ||
actions: [], | ||
}; | ||
|
||
render() { | ||
return ( | ||
<div className={modalBoxStyles.box}> | ||
<div className={modalBoxStyles.header}> | ||
{this.props.title} | ||
<Icon | ||
name={CLOSE_ICON} | ||
className={modalBoxStyles.icon} | ||
onClick={this.props.onRequestClose} /> | ||
</div> | ||
<div className={modalBoxStyles.content}> | ||
{this.props.children} | ||
</div> | ||
<div className={modalBoxStyles.footer}> | ||
{ModalBox.renderActions(this.props.actions)} | ||
<button | ||
className={modalBoxStyles.confirmButton} | ||
onClick={this.props.onConfirm}>{this.props.confirmText}</button> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
static renderActions(actions: Array<Action>) { | ||
if (actions.length > 0) { | ||
return ( | ||
<div className={modalBoxStyles.actions}> | ||
{actions.map(ModalBox.renderAction)} | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
static renderAction(action: Action, index: number) { | ||
return ( | ||
<button | ||
key={index} | ||
className={modalBoxStyles.action} | ||
onClick={action.handleAction}>{action.title}</button> | ||
); | ||
} | ||
} |
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
Oops, something went wrong.