mirror of
https://github.com/owncast/owncast.git
synced 2024-11-29 19:49:31 +03:00
Fix URL Modal scrolling and size (#2410)
* Change iframe style to block - this removes the double scrollbar issue that was occurring * Change and Add default modal sizes
This commit is contained in:
parent
818dde0512
commit
a8fea0df80
1 changed files with 10 additions and 2 deletions
|
@ -27,10 +27,17 @@ export const Modal: FC<ModalProps> = ({
|
||||||
}) => {
|
}) => {
|
||||||
const [loading, setLoading] = useState(!!url);
|
const [loading, setLoading] = useState(!!url);
|
||||||
|
|
||||||
|
let defaultHeight = '100%';
|
||||||
|
let defaultWidth = '520px';
|
||||||
|
if (url) {
|
||||||
|
defaultHeight = '70vh';
|
||||||
|
defaultWidth = '900px';
|
||||||
|
}
|
||||||
|
|
||||||
const modalStyle = {
|
const modalStyle = {
|
||||||
padding: '0px',
|
padding: '0px',
|
||||||
minHeight: height,
|
minHeight: height,
|
||||||
height: height ?? '100%',
|
height: height ?? defaultHeight,
|
||||||
};
|
};
|
||||||
|
|
||||||
const iframe = url && (
|
const iframe = url && (
|
||||||
|
@ -42,6 +49,7 @@ export const Modal: FC<ModalProps> = ({
|
||||||
sandbox="allow-same-origin allow-scripts allow-popups allow-forms"
|
sandbox="allow-same-origin allow-scripts allow-popups allow-forms"
|
||||||
frameBorder="0"
|
frameBorder="0"
|
||||||
allowFullScreen
|
allowFullScreen
|
||||||
|
style={{ display: 'block' }}
|
||||||
// eslint-disable-next-line react/no-unknown-property
|
// eslint-disable-next-line react/no-unknown-property
|
||||||
onLoad={() => setLoading(false)}
|
onLoad={() => setLoading(false)}
|
||||||
/>
|
/>
|
||||||
|
@ -57,7 +65,7 @@ export const Modal: FC<ModalProps> = ({
|
||||||
onCancel={handleCancel}
|
onCancel={handleCancel}
|
||||||
afterClose={afterClose}
|
afterClose={afterClose}
|
||||||
bodyStyle={modalStyle}
|
bodyStyle={modalStyle}
|
||||||
width={width}
|
width={width ?? defaultWidth}
|
||||||
zIndex={999}
|
zIndex={999}
|
||||||
footer={null}
|
footer={null}
|
||||||
centered
|
centered
|
||||||
|
|
Loading…
Reference in a new issue