colouring-montreal/app/src/frontend/building/sidebar.tsx

31 lines
774 B
TypeScript
Raw Normal View History

2018-09-11 15:59:37 -04:00
import React from 'react';
2018-10-01 12:20:25 -04:00
import { Link } from 'react-router-dom';
2019-05-27 13:26:29 -04:00
import PropTypes from 'prop-types';
2018-09-11 15:59:37 -04:00
import './sidebar.css';
import { BackIcon } from '../components/icons';
2018-09-11 15:59:37 -04:00
const Sidebar = (props) => (
<div id="legend" className="info-container">
2018-10-01 12:20:25 -04:00
<header className="sidebar-header">
{
props.back?
<Link className="icon-button back" to={props.back}>
<BackIcon />
</Link>
2019-05-27 11:39:16 -04:00
: null
2018-10-01 12:20:25 -04:00
}
2019-04-04 08:15:54 -04:00
<h2 className="h2">{props.title}</h2>
2018-10-01 12:20:25 -04:00
</header>
2018-09-11 15:59:37 -04:00
{props.children}
</div>
);
2019-05-27 13:26:29 -04:00
Sidebar.propTypes = {
back: PropTypes.string,
title: PropTypes.string.isRequired,
children: PropTypes.node
}
2018-09-11 15:59:37 -04:00
export default Sidebar;