mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-07-30 08:08:03 -05:00
Following changes done for the framework: - Framework for creating React based dynamic form view out of a pre-defined UI schema. Previously, it was based on Backform/Backbone. - The new framework and components will use MaterialUI as the base. Previously, Bootstrap/Backform/jQuery components were used. - The new code uses JSS instead of CSS since material UI and most modern React libraries also use JSS. In the future, this will allow us to change the theme in real-time without refresh. - 90% code covered by 80-85 new jasmine test cases. - Server group node UI Schema migration to new, with schema test cases. - Server node UI Schema migration to new, with schema test cases. - Database node UI Schema migration to new, with schema test cases. - Few other UI changes. Fixes #6130
43 lines
1.3 KiB
React
43 lines
1.3 KiB
React
/////////////////////////////////////////////////////////////
|
|
//
|
|
// pgAdmin 4 - PostgreSQL Tools
|
|
//
|
|
// Copyright (C) 2013 - 2021, The pgAdmin Development Team
|
|
// This software is released under the PostgreSQL Licence
|
|
//
|
|
//////////////////////////////////////////////////////////////
|
|
|
|
import React from 'react';
|
|
import {Box, makeStyles} from '@material-ui/core';
|
|
import clsx from 'clsx';
|
|
import PropTypes from 'prop-types';
|
|
import CustomPropTypes from '../custom_prop_types';
|
|
|
|
const useStyles = makeStyles((theme)=>({
|
|
root: {
|
|
height: '100%',
|
|
padding: theme.spacing(1),
|
|
overflow: 'auto',
|
|
backgroundColor: theme.palette.grey[400]
|
|
}
|
|
}));
|
|
|
|
/* Material UI does not have any tabpanel component, we create one for us */
|
|
export default function TabPanel({children, classNameRoot, className, value, index}) {
|
|
const classes = useStyles();
|
|
const active = value === index;
|
|
return (
|
|
<Box className={clsx(classes.root, classNameRoot)} component="div" hidden={!active}>
|
|
<Box style={{height: '100%'}} className={className}>{children}</Box>
|
|
</Box>
|
|
);
|
|
}
|
|
|
|
TabPanel.propTypes = {
|
|
children: CustomPropTypes.children,
|
|
classNameRoot: CustomPropTypes.className,
|
|
className: CustomPropTypes.className,
|
|
value: PropTypes.any.isRequired,
|
|
index: PropTypes.any.isRequired,
|
|
};
|