Create sidebar
This commit is contained in:
parent
60dc0b56bb
commit
adf86ebea1
4 changed files with 44 additions and 8 deletions
|
@ -3,14 +3,29 @@ import { IAvailableContainerModel } from '../../Interfaces/IAvailableContainerMo
|
|||
|
||||
interface ISidebarProps {
|
||||
componentOptions: IAvailableContainerModel[]
|
||||
isOpen: boolean;
|
||||
onClick: () => void;
|
||||
}
|
||||
|
||||
export default class Sidebar extends React.PureComponent<ISidebarProps> {
|
||||
export default class Sidebar extends React.Component<ISidebarProps> {
|
||||
public render() {
|
||||
return (
|
||||
<nav className='bg-blue min-h-full'>
|
||||
const listElements = this.props.componentOptions.map(componentOption =>
|
||||
<button className='hover:bg-blue-600 transition-all sidebar-row' key='{componentOption.Type}'>
|
||||
{componentOption.Type}
|
||||
</button>
|
||||
);
|
||||
|
||||
</nav>
|
||||
const isOpenClasses = this.props.isOpen ? 'left-0' : '-left-64';
|
||||
return (
|
||||
<div className={`fixed bg-blue-500 dark:bg-blue-500 text-white transition-all h-screen w-64 overflow-y-auto z-10 ${isOpenClasses}`}>
|
||||
<div className='w-full h-auto p-4 flex justify-end' onClick={this.props.onClick}>
|
||||
<button className='text-lg'>×</button>
|
||||
</div>
|
||||
<div className='bg-blue-400 sidebar-row'>
|
||||
Composants
|
||||
</div>
|
||||
{listElements}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue