ghost-portal/packages/apps/src/SideBar/Item.js
Jaco Greeff 9c89026e6e
Copyright project authors (#95)
* Copyright project authors

* Add contributors
2018-06-13 22:32:49 +02:00

35 lines
965 B
JavaScript

// Copyright 2017-2018 @polkadot/apps authors & contributors
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.
// @flow
import type { I18nProps } from '@polkadot/ui-app/types';
import type { Route } from '../types';
import './Item.css';
import React from 'react';
import { NavLink } from 'react-router-dom';
import Icon from '@polkadot/ui-app/Icon';
import Menu from '@polkadot/ui-app/Menu';
type Props = I18nProps & {
route: Route
};
export default function Item ({ route: { i18n, icon, isExact, name, path = '' }, t }: Props): React$Node {
return (
<Menu.Item className='apps--SideBar-Item'>
<NavLink
activeClassName='apps--SideBar-Item-NavLink-active'
className='apps--SideBar-Item-NavLink'
exact={isExact}
to={path || `/${name}`}
>
<Icon name={icon} /> {t(`sidebar.${name}`, i18n)}
</NavLink>
</Menu.Item>
);
}