Skip to content

Commit

Permalink
Remove scrollbars from expanded modal (#1999)
Browse files Browse the repository at this point in the history
  • Loading branch information
Onokaev authored Aug 12, 2022
1 parent e31f06e commit 1f7781c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/app/views/query-response/QueryResponse.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
Announced, Dialog, DialogFooter, DialogType,
DefaultButton, FontSizes, IconButton,
Modal, Pivot, PivotItem
Modal, Pivot, PivotItem, ITheme, getTheme
} from '@fluentui/react';
import { Resizable } from 're-resizable';
import React, { useState, useEffect } from 'react';
Expand All @@ -21,6 +21,7 @@ import './query-response.scss';
import { IRootState } from '../../../types/root';
import { CopyButton } from '../common/copy/CopyButton';
import { convertVhToPx } from '../common/dimensions/dimensions-adjustment';
import { queryResponseStyles } from './queryResponse.styles';


const QueryResponse = (props: IQueryResponseProps) => {
Expand All @@ -31,6 +32,8 @@ const QueryResponse = (props: IQueryResponseProps) => {
const [responseHeight, setResponseHeight] = useState('610px');
const { sampleQuery, dimensions } = useSelector((state: IRootState) => state);
const [currentTab, setCurrentTab] = useState<string>('response-preview');
const currentTheme: ITheme = getTheme();
const { modalStyles, modalPivotStyles } = queryResponseStyles(currentTheme);

useEffect(() => {
setResponseHeight(convertVhToPx(dimensions.response.height, 50));
Expand Down Expand Up @@ -142,7 +145,7 @@ const QueryResponse = (props: IQueryResponseProps) => {
<Modal
isOpen={showModal}
onDismiss={toggleExpandResponse}
styles={{ main: { width: '80%', height: '90%' } }}
styles={ modalStyles }
>
<IconButton
styles={{
Expand All @@ -157,7 +160,8 @@ const QueryResponse = (props: IQueryResponseProps) => {
/>
<Pivot className='pivot-response'
onLinkClick={(pivotItem) => onModalPivotItemClicked(pivotItem)}
selectedKey={currentTab}>
selectedKey={currentTab}
styles={modalPivotStyles}>
{GetPivotItems()}
</Pivot>
</Modal>
Expand Down
15 changes: 15 additions & 0 deletions src/app/views/query-response/queryResponse.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ export const queryResponseStyles = (theme: ITheme) => {
marginTop: '13%',
marginLeft: '16%'
}
},
modalStyles: {
scrollableContent: {
overflow: 'hidden' as 'hidden'
},
main: {
width: '80%',
height: '90%',
overflow: 'hidden' as 'hidden'
}
},
modalPivotStyles: {
root: {
overflow: 'hidden' as 'hidden'
}
}
};
};

0 comments on commit 1f7781c

Please sign in to comment.