mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
side pane
This commit is contained in:
parent
62e72d166f
commit
9b93012b08
9 changed files with 95 additions and 5 deletions
38
src/components/main/SidePane/index.tsx
Normal file
38
src/components/main/SidePane/index.tsx
Normal file
|
@ -0,0 +1,38 @@
|
|||
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>
|
||||
);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue