-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
includes superdesk-ui-framework and uses it for lists
Event list: show the search bar in another bar than the title Custom Modal component
- Loading branch information
Showing
25 changed files
with
293 additions
and
133 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
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 |
---|---|---|
@@ -1,15 +1,8 @@ | ||
.event { | ||
border-left: 4px solid #bababa; | ||
box-sizing: border-box; | ||
.event__title { overflow: hidden; text-overflow: ellipsis } | ||
&--has-planning { | ||
border-left: 4px solid #00aa4d; | ||
} | ||
&--has-been-canceled { | ||
.event__title { text-decoration: line-through; } | ||
} | ||
} | ||
.event__counts { | ||
i { color: #bababa; } | ||
dt { padding-left: 5px } | ||
} |
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 |
---|---|---|
@@ -1,33 +0,0 @@ | ||
.ListItem__list-item { | ||
.media-box { | ||
border-right: 0 solid black; | ||
.item-info { | ||
.line { margin-left: 0; } | ||
.highlights-box { margin-right: 0; } | ||
// second line, with location and icons | ||
.line:nth-child(2) { .container { flex-grow: 1 } } | ||
} | ||
&:hover { | ||
border-right: 0 solid black; | ||
.item-info { padding: 10px 10px 10px 10px; } | ||
.ListItem__actions { visibility: visible; } | ||
} | ||
} | ||
} | ||
|
||
.ListItem__actions { | ||
position: absolute; | ||
right: 0px; | ||
top: 0px; | ||
visibility: hidden; | ||
height: 60px; | ||
padding-top: 20px; | ||
padding-left: 17px; | ||
padding-right: 15px; | ||
&:hover { | ||
i { color: #436278 } | ||
} | ||
} | ||
|
||
.ListItem__list-item:not(.active) .ListItem__actions { background-color: rgb(222, 222, 222) } | ||
.ListItem__list-item.active .ListItem__actions { background-color: rgb(200, 228, 238) } | ||
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,16 @@ | ||
import React from 'react' | ||
import { Modal as _Modal } from 'react-bootstrap' | ||
|
||
export default function Body({ children }) { | ||
return ( | ||
<_Modal.Body className="modal__body"> | ||
{children} | ||
</_Modal.Body>) | ||
} | ||
|
||
Body.propTypes = { | ||
children: React.PropTypes.oneOfType([ | ||
React.PropTypes.element, | ||
React.PropTypes.arrayOf(React.PropTypes.element), | ||
]), | ||
} |
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,16 @@ | ||
import React from 'react' | ||
import { Modal as _Modal } from 'react-bootstrap' | ||
|
||
export default function Footer({ children }) { | ||
return ( | ||
<_Modal.Footer className="modal__footer"> | ||
{children} | ||
</_Modal.Footer>) | ||
} | ||
|
||
Footer.propTypes = { | ||
children: React.PropTypes.oneOfType([ | ||
React.PropTypes.element, | ||
React.PropTypes.arrayOf(React.PropTypes.element), | ||
]), | ||
} |
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,16 @@ | ||
import React from 'react' | ||
import { Modal as _Modal } from 'react-bootstrap' | ||
|
||
export default function Header({ children }) { | ||
return ( | ||
<_Modal.Header className="modal__header"> | ||
{children} | ||
</_Modal.Header>) | ||
} | ||
|
||
Header.propTypes = { | ||
children: React.PropTypes.oneOfType([ | ||
React.PropTypes.element, | ||
React.PropTypes.arrayOf(React.PropTypes.element), | ||
]), | ||
} |
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,41 @@ | ||
import React from 'react' | ||
import classNames from 'classnames' | ||
import { pickBy } from 'lodash' | ||
|
||
export default function ModalDialog({ dialogClassName, children, style, className, ...props }) { | ||
const modalStyle = { | ||
display: 'block', | ||
...style, | ||
} | ||
const bsClasses = [ | ||
'bsClass', | ||
'bsSize', | ||
'bsStyle', | ||
'bsRole', | ||
] | ||
const elementProps = pickBy(props, (value, key) => (bsClasses.indexOf(key) === -1)) | ||
return ( | ||
<div | ||
{...elementProps} | ||
tabIndex="-1" | ||
role="dialog" | ||
style={modalStyle} | ||
className={className}> | ||
<div className={classNames(dialogClassName, 'modal__dialog')}> | ||
<div className="modal__content" role="document"> | ||
{children} | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
ModalDialog.propTypes = { | ||
children: React.PropTypes.oneOfType([ | ||
React.PropTypes.element, | ||
React.PropTypes.arrayOf(React.PropTypes.element), | ||
]), | ||
style: React.PropTypes.object, | ||
className: React.PropTypes.string, | ||
dialogClassName: React.PropTypes.string, | ||
} |
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,51 @@ | ||
import React from 'react' | ||
import { Modal as _Modal } from 'react-bootstrap' | ||
import { default as ModalDialog } from './ModalDialog' | ||
import { default as Header } from './Header' | ||
import { default as Body } from './Body' | ||
import { default as Footer } from './Footer' | ||
import classNames from 'classnames' | ||
import './style.scss' | ||
|
||
export default function Modal({ | ||
show, | ||
handleHide, | ||
children, | ||
large, | ||
fill, | ||
fullscreen, | ||
white, | ||
className, | ||
}) { | ||
const classes = classNames(className, { | ||
'modal': true, | ||
'modal--large': large, | ||
'modal--fill': fill, | ||
'modal--fullscreen': fullscreen, | ||
'modal--white': white, | ||
}) | ||
return ( | ||
<_Modal | ||
show={show} | ||
backdrop={true} | ||
className={classes} | ||
onHide={handleHide} | ||
dialogComponentClass={ModalDialog} | ||
>{children}</_Modal> | ||
) | ||
} | ||
|
||
Modal.propTypes = { | ||
show: React.PropTypes.bool, | ||
handleHide: React.PropTypes.func, | ||
children: React.PropTypes.array, | ||
large: React.PropTypes.bool, | ||
fill: React.PropTypes.bool, | ||
fullscreen: React.PropTypes.bool, | ||
white: React.PropTypes.bool, | ||
className: React.PropTypes.string, | ||
} | ||
|
||
Modal.Header = Header | ||
Modal.Body = Body | ||
Modal.Footer = Footer |
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,10 @@ | ||
@import '~superdesk-core/styles/sass/mixins.scss'; | ||
@import '~superdesk-core/styles/sass/variables.scss'; | ||
// required for extending .modal__backdrop : | ||
@import '~superdesk-ui-framework/app/styles/_mixins.scss'; | ||
@import '~superdesk-ui-framework/app/styles/_modals.scss'; | ||
|
||
|
||
.modal-backdrop { | ||
@extend .modal__backdrop; | ||
} |
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.