zepio/app/components/sidebar/index.js

34 lines
729 B
JavaScript
Raw Normal View History

// @flow
import React from 'react';
import styled from 'styled-components';
import { Link } from 'react-router-dom';
import { MENU_OPTIONS } from '../../constants/sidebar';
import { styles } from './styles';
// TODO: Not sure this is the best approach to styling
// in a StyledComponents-powered application
2018-11-26 18:52:47 -08:00
const Wrapper = styled.div`
${styles.wrapper}
`;
2018-11-26 18:52:47 -08:00
type MenuItem = { route: string, label: string };
type Props = {
options?: MenuItem[],
};
export const SidebarComponent = ({ options }: Props) => (
<Wrapper>
2018-11-26 18:52:47 -08:00
{(options || []).map(item => (
<Link key={item.route} to={item.route}>
{item.label}
</Link>
))}
</Wrapper>
);
2018-11-26 18:52:47 -08:00
SidebarComponent.defaultProps = {
options: MENU_OPTIONS,
};