mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 09:15:58 +02:00
52 lines
1.3 KiB
TypeScript
52 lines
1.3 KiB
TypeScript
import React, { FC, HTMLAttributes, PropsWithChildren } from "react"
|
|
import Scrollbar from "react-perfect-scrollbar"
|
|
import "react-perfect-scrollbar/dist/css/styles.css"
|
|
import cx from "classnames"
|
|
import { ThemeToggler } from "../ThemeToggler"
|
|
import * as SC from "./styles"
|
|
|
|
interface IMenuItemProps {
|
|
to: string
|
|
}
|
|
|
|
const MenuItem: FC<IMenuItemProps> = ({ children, to }) => {
|
|
return (
|
|
<SC.MenuItem to={to} activeClassName="active">
|
|
{children}
|
|
</SC.MenuItem>
|
|
)
|
|
}
|
|
|
|
export const Sidebar: FC<PropsWithChildren<HTMLAttributes<HTMLDivElement>>> = (
|
|
props
|
|
) => {
|
|
const { children, ...restProps } = props
|
|
|
|
return (
|
|
<SC.SidebarWrapper {...restProps}>
|
|
<Scrollbar>
|
|
<SC.Title to="/">
|
|
The
|
|
<br />
|
|
Programmer's
|
|
<br />
|
|
Hangout
|
|
</SC.Title>
|
|
<SC.Inner>
|
|
{children}
|
|
|
|
<SC.Menu className={cx({ "has-border": Boolean(children) })}>
|
|
<MenuItem to="/about">about</MenuItem>
|
|
<MenuItem to="/rules">rules</MenuItem>
|
|
<MenuItem to="/faq">faq</MenuItem>
|
|
<MenuItem to="/resources">resources</MenuItem>
|
|
<MenuItem to="/archives">tech spotlights</MenuItem>
|
|
</SC.Menu>
|
|
|
|
<ThemeToggler />
|
|
</SC.Inner>
|
|
</Scrollbar>
|
|
</SC.SidebarWrapper>
|
|
)
|
|
}
|