Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: request and response height on try-it #1201

Merged
merged 1 commit into from
Nov 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions src/app/views/query-response/QueryResponse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,16 @@ const QueryResponse = (props: IQueryResponseProps) => {
const [showModal, setShowModal] = useState(false);
const [query, setQuery] = useState('');
const [responseHeight, setResponseHeight] = useState('610px');
const [windowWidth, setWindowWidth] = useState(window.innerWidth);
const { dimensions, sampleQuery } = useSelector((state: IRootState) => state);

let isTabletSize: boolean = (windowWidth <= 1320) ? true : false;

const {
intl: { messages }
}: any = props;

useEffect(() => {
setResponseHeight(convertVhToPx(dimensions.response.height, 50));
window.addEventListener('resize', handleWindowResize, false);
return () => window.removeEventListener('resize', handleWindowResize);
}, [dimensions, windowWidth]);

const handleWindowResize = () => {
const currentWindowWidth = window.innerWidth;
isTabletSize = false;
if (currentWindowWidth <= 1320) {
isTabletSize = true;
}
setWindowWidth(currentWindowWidth);
}
}, [dimensions]);

const toggleShareQueryDialogState = () => {
setShareQuaryDialogStatus(!showShareQueryDialog);
Expand Down Expand Up @@ -133,12 +120,12 @@ const QueryResponse = (props: IQueryResponseProps) => {
}}
>
<div className='query-response' style={{
minHeight: responseHeight,
minHeight: 350,
height: responseHeight
}}>

<Pivot overflowBehavior="menu" onLinkClick={handlePivotItemClick}
className={isTabletSize ? '' : 'pivot-response'} >
className={'pivot-response'} >
{getPivotItems()}
<PivotItem
headerText='Share'
Expand Down
16 changes: 11 additions & 5 deletions src/app/views/query-response/query-response.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,19 @@
width: 100%;
}

.pivot-response *[data-content='Expand xx'] {
float: right !important;
}

.pivot-response *[data-content='Share xx'] {
float: right !important;
@media screen and (min-width: 1320px){
.pivot-response *[data-content='Expand xx'] {
float: right !important;
}
}


@media screen and (min-width: 1320px){
.pivot-response *[data-content='Share xx'] {
float: right !important;
}
}

.default-text {
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion src/app/views/query-runner/request/Request.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export class Request extends Component<IRequestComponent, any> {
public render() {
const { dimensions } = this.props;
const requestPivotItems = this.getPivotItems(dimensions.request.height);
const minHeight = 60;
const minHeight = 260;
const maxHeight = 800;
return (
<Resizable
Expand Down