From e13e630cd6e4fc0b1ff92098a28a770794c7bb9a Mon Sep 17 00:00:00 2001
From: gabrhr <73925454+gabrhr@users.noreply.github.com>
Date: Wed, 20 Apr 2022 10:19:29 -0500
Subject: =?UTF-8?q?A=C3=B1adir=20plantilla?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Base para front
---
.../app/containers/Templates/Dashboard.js | 114 ++++++++++++++++
front/odiparpack/app/containers/Templates/Outer.js | 34 +++++
.../app/containers/Templates/appStyles-jss.js | 144 +++++++++++++++++++++
3 files changed, 292 insertions(+)
create mode 100644 front/odiparpack/app/containers/Templates/Dashboard.js
create mode 100644 front/odiparpack/app/containers/Templates/Outer.js
create mode 100644 front/odiparpack/app/containers/Templates/appStyles-jss.js
(limited to 'front/odiparpack/app/containers/Templates')
diff --git a/front/odiparpack/app/containers/Templates/Dashboard.js b/front/odiparpack/app/containers/Templates/Dashboard.js
new file mode 100644
index 0000000..5f24777
--- /dev/null
+++ b/front/odiparpack/app/containers/Templates/Dashboard.js
@@ -0,0 +1,114 @@
+import React, { useState, useEffect } from 'react';
+import { PropTypes } from 'prop-types';
+import classNames from 'classnames';
+import { bindActionCreators } from 'redux';
+import { connect } from 'react-redux';
+import { withStyles } from '@material-ui/core/styles';
+import { Header, Sidebar, BreadCrumb } from 'ba-components';
+import { toggleAction, openAction, playTransitionAction } from 'ba-actions/UiActions';
+import { Fade } from '@material-ui/core';
+import styles from './appStyles-jss';
+
+function Dashboard(props) {
+ const {
+ classes,
+ children,
+ history,
+ toggleDrawer,
+ sidebarOpen,
+ initialOpen,
+ loadTransition,
+ pageLoaded
+ } = props;
+ const [transform, setTransform] = useState(0);
+
+ const darker = true;
+
+ const handleScroll = () => {
+ const doc = document.documentElement;
+ const scroll = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);
+ setTransform(scroll);
+ };
+
+ useEffect(() => {
+ // Scroll content to top
+ window.addEventListener('scroll', handleScroll);
+
+ // Set expanded sidebar menu
+ const currentPath = history.location.pathname;
+ initialOpen(currentPath);
+
+ // Play page transition
+ loadTransition(true);
+
+ // Execute all arguments when page changes
+ const unlisten = history.listen(() => {
+ window.scrollTo(0, 0);
+ setTimeout(() => {
+ loadTransition(true);
+ }, 500);
+ });
+
+ return () => {
+ unlisten();
+ };
+ }, []);
+
+ return (
+
+
30 && darker} margin={sidebarOpen} />
+ 30 && darker}
+ />
+
+
+
+
+
+ );
+}
+
+Dashboard.propTypes = {
+ classes: PropTypes.object.isRequired,
+ history: PropTypes.object.isRequired,
+ children: PropTypes.node.isRequired,
+ initialOpen: PropTypes.func.isRequired,
+ toggleDrawer: PropTypes.func.isRequired,
+ loadTransition: PropTypes.func.isRequired,
+ sidebarOpen: PropTypes.bool.isRequired,
+ pageLoaded: PropTypes.bool.isRequired
+};
+
+const reducer = 'ui';
+const mapStateToProps = state => ({
+ sidebarOpen: state.getIn([reducer, 'sidebarOpen']),
+ pageLoaded: state.getIn([reducer, 'pageLoaded'])
+});
+
+const mapDispatchToProps = dispatch => ({
+ toggleDrawer: () => dispatch(toggleAction),
+ initialOpen: bindActionCreators(openAction, dispatch),
+ loadTransition: bindActionCreators(playTransitionAction, dispatch),
+});
+
+const DashboardMaped = connect(
+ mapStateToProps,
+ mapDispatchToProps
+)(Dashboard);
+
+export default (withStyles(styles)(DashboardMaped));
diff --git a/front/odiparpack/app/containers/Templates/Outer.js b/front/odiparpack/app/containers/Templates/Outer.js
new file mode 100644
index 0000000..f6448be
--- /dev/null
+++ b/front/odiparpack/app/containers/Templates/Outer.js
@@ -0,0 +1,34 @@
+import React from 'react';
+import { PropTypes } from 'prop-types';
+import { withStyles } from '@material-ui/core/styles';
+import brand from 'ba-api/brand';
+import logo from 'ba-images/logo.svg';
+import { Hidden } from '@material-ui/core';
+import styles from './appStyles-jss';
+
+function Outer(props) {
+ const {
+ classes,
+ children,
+ } = props;
+ return (
+
+
+
+
+

+
{brand.name}
+
+
+ {children}
+
+
+ );
+}
+
+Outer.propTypes = {
+ classes: PropTypes.object.isRequired,
+ children: PropTypes.node.isRequired,
+};
+
+export default (withStyles(styles)(Outer));
diff --git a/front/odiparpack/app/containers/Templates/appStyles-jss.js b/front/odiparpack/app/containers/Templates/appStyles-jss.js
new file mode 100644
index 0000000..f9175eb
--- /dev/null
+++ b/front/odiparpack/app/containers/Templates/appStyles-jss.js
@@ -0,0 +1,144 @@
+import bg from 'ba-images/material_bg.svg';
+import { fade } from '@material-ui/core/styles/colorManipulator';
+
+const appFrame = {
+ display: 'flex',
+ width: '100%',
+ minHeight: '100%',
+ zIndex: 1,
+};
+
+const styles = theme => ({
+ root: {
+ width: '100%',
+ minHeight: '100%',
+ marginTop: 0,
+ zIndex: 1,
+ },
+ appFrameInner: {
+ ...appFrame,
+ flexDirection: 'row'
+ },
+ appFrameOuter: {
+ ...appFrame,
+ },
+ content: {
+ backgroundColor: theme.palette.background.default,
+ width: '100%',
+ padding: theme.spacing(1.5),
+ paddingLeft: 0,
+ minHeight: '100%',
+ overflow: 'hidden',
+ },
+ outerContent: {
+ background: `url(${bg}) no-repeat ${theme.palette.primary.main} left bottom`,
+ width: '100%',
+ backgroundSize: 'cover',
+ flexDirection: 'column',
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ [theme.breakpoints.down('md')]: {
+ padding: '20px 0'
+ },
+ },
+ bgbar: {
+ backgroundColor: theme.palette.primary.main,
+ width: '100%',
+ position: 'fixed',
+ height: 184,
+ top: 0,
+ left: 0
+ },
+ mainWrap: {
+ position: 'relative',
+ marginTop: theme.spacing(6),
+ marginLeft: theme.spacing(1.5),
+ height: '100%',
+ '& > div': {
+ paddingBottom: theme.spacing(4),
+ willChange: 'inherit !important' // hack for floating form issue whne expaded
+ }
+ },
+ preloader: {
+ position: 'absolute',
+ top: 0,
+ left: 0,
+ width: '100%',
+ zIndex: 1000,
+ background: 'transparent',
+ height: 3,
+ },
+ materialBg: {
+ position: 'absolute',
+ left: 0,
+ bottom: 0,
+ width: '100%',
+ opacity: 0.5
+ },
+ contentPadding: {
+ paddingLeft: 80
+ },
+ hideApp: {
+ display: 'none'
+ },
+ circularProgress: {
+ position: 'absolute',
+ top: 'calc(50% - 100px)',
+ left: 'calc(50% - 100px)',
+ },
+ brand: {
+ height: 54,
+ display: 'flex',
+ padding: '10px 10px 5px',
+ position: 'relative',
+ alignItems: 'center',
+ justifyContent: 'center',
+ '& img': {
+ width: 20
+ },
+ '& h3': {
+ margin: 0,
+ fontSize: 16,
+ fontWeight: 500,
+ paddingLeft: 10,
+ color: theme.palette.common.white,
+ }
+ },
+ btn: {},
+ icon: {},
+ btnPicker: {
+ position: 'fixed',
+ zIndex: 2000,
+ right: 0,
+ top: 200,
+ background: fade(theme.palette.background.paper, 0.8),
+ borderRadius: '30px 0 0 30px',
+ padding: '4px 8px 4px 4px',
+ overflow: 'hidden',
+ border: `1px solid ${theme.palette.grey[300]}`,
+ '& $btn': {
+ background: theme.palette.secondary.main,
+ borderRadius: 30,
+ padding: 8,
+ boxShadow: theme.shadows[4],
+ display: 'flex',
+ alignItems: 'center',
+ width: 40,
+ height: 40,
+ textCenter: 'cener',
+ overflow: 'hidden',
+ color: 'transparent',
+ transition: 'all 0.3s ease',
+ '& $icon': {
+ color: theme.palette.background.paper,
+ },
+ '&:hover': {
+ color: theme.palette.background.paper,
+ width: 90
+ }
+ }
+ }
+});
+
+export default styles;
--
cgit v1.2.3