1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00
vault-frontend/src/components/main/SidePane/index.tsx
2019-06-04 04:06:11 +07:00

38 lines
996 B
TypeScript

import React, { useEffect, useState } from 'react';
import * as styles from './styles.scss';
import classNames from 'classnames';
export const SidePane = ({ }) => {
const [left, setLeft] = useState(0);
const moveThis = () => {
const shift = ((document.body.getBoundingClientRect().width - 1024) / 2) - 54 - 10;
setLeft(shift);
};
useEffect(() => {
window.addEventListener('resize', moveThis)
return () => { window.removeEventListener('resize', moveThis); }
});
useEffect(moveThis, []);
return (
<div className={styles.pane} style={{ left }}>
<div className={classNames(styles.group, 'logo')} />
<div className={styles.group}>
<div className={styles.btn} />
<div className={styles.btn} />
<div className={styles.btn} />
<div className={styles.btn} />
</div>
<div className={styles.flexy} />
<div className={styles.group}>
<div className={styles.btn} />
</div>
</div>
);
};