1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-23 20:07:40 +02:00
unleash.unleash/frontend/src/component/layout/MainLayout/MainLayout.jsx
Fredrik Strand Oseberg 92f3f8af08 Feat/environment crud (#335)
* feat: add env

* fix: create environment form

* feat: create environment

* feat: add deletion protection

* fix: lift up state

* feat: add ability to update environment

* fix: remove env reset

* fix: remove link

* feat: add drag and drop sorting

* fix: remove unused imports

* feat: add methods to toggle env on/off

* feat: only make api call on drop

* fix: disabled text

* fix: add disabled indicator

* fix: add edit env payload

* fix: add E flag

* fix: cleanup

* fix: update snapshots

* fix: remove useFeature

* fix: change property to errorText

* fix: update tests

* fix: change menu

* fix: update snapshots

* feat: toggle view v2

* fix: handle error on sort order api call

* fix: remove unused import

* fix: useFeature

* fix: update tests

* fix: console logs

* fix: use try catch

* fix: update snapshots
2021-09-14 14:20:23 +02:00

73 lines
2.3 KiB
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { makeStyles } from '@material-ui/styles';
import { Grid } from '@material-ui/core';
import styles from '../../styles.module.scss';
import ErrorContainer from '../../error/error-container';
import Header from '../../menu/Header/Header';
import Footer from '../../menu/Footer/Footer';
import Proclamation from '../../common/Proclamation/Proclamation';
import BreadcrumbNav from '../../common/BreadcrumbNav/BreadcrumbNav';
import { ReactComponent as Texture } from '../../../assets/img/texture.svg';
const useStyles = makeStyles(theme => ({
container: {
height: '100%',
justifyContent: 'space-between',
},
contentContainer: {
height: '100%',
padding: '3.25rem 0',
position: 'relative',
[theme.breakpoints.down('sm')]: {
padding: '3.25rem 0.75rem',
},
},
}));
const MainLayout = ({ children, location, uiConfig }) => {
const muiStyles = useStyles();
return (
<>
<Header location={location} />
<Grid container className={muiStyles.container}>
<div className={classnames(styles.contentWrapper)}>
<Grid item className={styles.content} xs={12} sm={12}>
<div
className={muiStyles.contentContainer}
style={{ zIndex: '200' }}
>
<BreadcrumbNav />
<Proclamation toast={uiConfig.toast} />
{children}
</div>
<ErrorContainer />
</Grid>
<div style={{ overflow: 'hidden' }}>
<div
style={{
position: 'fixed',
right: '0',
bottom: '-4px',
zIndex: '1',
}}
>
<Texture />
</div>
</div>
</div>
<Footer />
</Grid>
</>
);
};
MainLayout.propTypes = {
location: PropTypes.object.isRequired,
};
export default MainLayout;