ghost-portal/packages/apps/src/SideBar/Item.js
Jaco Greeff ea50c4f1fe
Pull in ui-app components only (#46)
* Pull in ui-app components only

* Undefined check

* Small overall layout updates (buttons)

* Password hide/unhide icons

* Automatically assign name to inputs
2018-05-12 15:05:41 +02:00

33 lines
928 B
JavaScript

// Copyright 2017-2018 Jaco Greeff
// 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/src/Icon';
import Menu from '@polkadot/ui-app/src/Menu';
type Props = I18nProps & Route & {};
export default function Item ({ 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>
);
}