Create SideBar with Children props

This commit is contained in:
Angelillo15 2023-08-04 19:22:32 +02:00
parent cc4c5eac21
commit dc6b5e704f
1 changed files with 7 additions and 25 deletions

View File

@ -1,32 +1,14 @@
import React from 'react';
import { NavLink } from 'react-router-dom';
import React, { ReactNode } from 'react';
import '@/assets/css/sidebar.css';
const Sidebar = () => {
type ParentProps = {
children: ReactNode;
};
export default ({ children }: Omit<ParentProps, 'render'>) => {
return (
<>
<div className='sidebar'>
<NavLink to='/'>
Home <i className='bx bxs-home-heart' />
</NavLink>
<NavLink to='/resources'>
Resources <i className='bx bx-list-ul' />
</NavLink>
<NavLink className='router-link-active' to='' v-if='isEditor'>
Editor <i className='bx bx-edit-alt' />
</NavLink>
<a href='https://github.com/Angelillo15' target='_blank' rel='noreferrer'>
GitHub <i className='bx bxl-github' />
</a>
<a href='https://discord.nookure.com' target='_blank' rel='noreferrer'>
Discord <i className='bx bxl-discord-alt' />
</a>
</div>
<div className='sidebar'>{children}</div>
</>
);
};
export default Sidebar;