1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

better sidepane

This commit is contained in:
muerwre 2019-07-26 14:00:53 +07:00
parent 1b001db91a
commit e315b33284
19 changed files with 253 additions and 99 deletions

View file

@ -5,8 +5,10 @@ import { hot } from 'react-hot-loader';
import { ConnectedRouter } from "connected-react-router";
import { history } from "~/redux/store";
import { NavLink, Switch, Route } from 'react-router-dom';
import { FlowLayout } from "~/containers/FlowLayout";
import { LoginLayout } from "~/containers/LoginLayout";
import { FlowLayout } from "~/containers/flow/FlowLayout";
import { LoginLayout } from "~/containers/login/LoginLayout";
import { MainLayout } from "~/containers/main/MainLayout";
import { ImageExample } from "~/containers/examples/ImageExample";
interface IAppProps {}
interface IAppState {}
@ -15,19 +17,17 @@ class Component extends React.Component<IAppProps, IAppState> {
render() {
return (
<ConnectedRouter history={history}>
<div>
<MainLayout>
<Switch>
<Route
exact
path="/"
component={FlowLayout}
/>
<Route path="/examples/image" component={ImageExample} />
<Route path="/" component={FlowLayout} />
<Route
path="/login"
component={LoginLayout}
/>
</Switch>
</div>
</MainLayout>
</ConnectedRouter>
);
}

View file

@ -1,13 +0,0 @@
import * as React from 'react';
import { MainLayout } from "~/containers/MainLayout";
import { HeroPlaceholder } from "~/components/flow/HeroPlaceholder";
import { TestGrid } from "~/components/flow/TestGrid";
// const style = require('./style.scss');
export const FlowLayout = () => (
<MainLayout>
<div className="default_container content_container">
<TestGrid />
</div>
</MainLayout>
);

View file

@ -1,17 +0,0 @@
import * as React from 'react';
import { SidePane } from "~/components/main/SidePane";
import { Header } from "~/components/main/Header";
import * as styles from './styles.scss';
export const MainLayout = ({ children }) => (
<div className={styles.wrapper}>
{
// <Header />
}
{
<SidePane />
}
{children}
</div>
);

View file

@ -1,4 +0,0 @@
.wrapper {
width: 100%;
padding: $gap 0;
}

View file

@ -0,0 +1,9 @@
import React, { FC } from 'react';
interface IProps {}
const ImageExample: FC<IProps> = () => (
<div>image example</div>
);
export { ImageExample };

View file

@ -0,0 +1,10 @@
import * as React from 'react';
import { MainLayout } from "~/containers/main/MainLayout";
import { TestGrid } from "~/components/flow/TestGrid";
// const style = require('./style.scss');
export const FlowLayout = () => (
<div className="default_container content_container">
<TestGrid />
</div>
);

View file

@ -3,15 +3,15 @@ import { LoginForm } from '~/components/login/LoginForm';
import { Header } from "~/components/main/Header";
import { GodRays } from "~/components/main/GodRays";
const style = require('./style.scss');
import * as styles from './styles.scss';
export const LoginLayout: React.FunctionComponent<{}> = () => (
<div className={style.wrapper}>
<div className={styles.wrapper}>
<GodRays />
<div className={style.header}>
<div className={styles.header}>
<Header />
</div>
<div className={style.container}>
<div className={styles.container}>
<LoginForm />
</div>
</div>

View file

@ -0,0 +1,18 @@
import * as React from 'react';
import { SidePane } from "~/components/main/SidePane";
import * as styles from './styles.scss';
import { useRef } from "react";
export const MainLayout = ({ children }) => {
const container = useRef(null);
return (
<div className={styles.wrapper}>
<div className={styles.content} ref={container}>
{children}
</div>
<SidePane container={container} />
</div>
);
};

View file

@ -0,0 +1,15 @@
.wrapper {
width: 100%;
padding: $gap $gap 0 74px;
display: flex;
align-items: flex-start;
justify-content: center;
flex-direction: row;
box-sizing: border-box;
}
.content {
flex: 0 1 $content_width;
position: relative;
background: red;
}

View file

@ -0,0 +1,10 @@
import React, { FC } from 'react';
import * as styles from './styles.scss';
interface IProps {}
const NodeLayout: FC<IProps> = () => (
<div></div>
);
export { NodeLayout };