0
0
Fork 0

Show media modal on public timeline (#7413)

This commit is contained in:
Yamagishi Kazutoshi 2018-05-08 20:33:09 +09:00 committed by Eugen Rochko
parent 01dfd6dbc8
commit e0b1e17bd0
5 changed files with 26 additions and 3 deletions

View file

@ -40,6 +40,17 @@ export default class ModalRoot extends React.PureComponent {
onClose: PropTypes.func.isRequired,
};
getSnapshotBeforeUpdate () {
const visible = !!this.props.type;
return {
overflowY: visible ? 'hidden' : null,
};
}
componentDidUpdate (prevProps, prevState, { overflowY }) {
document.body.style.overflowY = overflowY;
}
renderLoading = modalId => () => {
return ['MEDIA', 'VIDEO', 'BOOST', 'CONFIRM', 'ACTIONS'].indexOf(modalId) === -1 ? <ModalLoading /> : null;
}