[Glitch] Show media modal on public timeline

Port e0b1e17bd0 to glitch-soc
This commit is contained in:
Thibaut Girka committed 2018-08-01 00:18:42 +02:00
1 parent 5cd7fe21bf
commit d2b3eebe00
3 files changed
+22 -3

No files matched your search

@@ -44,6 +44,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', 'FAVOURITE', 'DOODLE', 'CONFIRM', 'ACTIONS'].indexOf(modalId) === -1 ? <ModalLoading /> : null;
}