Created separated component with servers dropdown

This commit is contained in:
Alejandro Celaya 2018-06-03 13:18:33 +02:00
parent 2cad352045
commit b1e97ef022
2 changed files with 28 additions and 27 deletions

View file

@ -1,20 +1,11 @@
import plusIcon from '@fortawesome/fontawesome-free-solid/faPlus';
import FontAwesomeIcon from '@fortawesome/react-fontawesome';
import React from 'react';
import {
Collapse, DropdownItem, DropdownMenu,
DropdownToggle,
Nav,
Navbar,
NavbarBrand,
NavbarToggler,
NavItem,
NavLink,
UncontrolledDropdown
} from 'reactstrap';
import { Link } from 'react-router-dom';
import { Collapse, Nav, Navbar, NavbarBrand, NavbarToggler, NavItem, NavLink } from 'reactstrap';
import ServersDropdown from '../servers/ServersDropdown';
import './MainHeader.scss';
import shlinkLogo from './shlink-logo-white.png';
import { Link } from 'react-router-dom';
export default class MainHeader extends React.Component {
constructor(props) {
@ -45,20 +36,7 @@ export default class MainHeader extends React.Component {
<FontAwesomeIcon icon={plusIcon}/>&nbsp; Add server
</NavLink>
</NavItem>
<UncontrolledDropdown nav>
<DropdownToggle nav caret>
Servers
</DropdownToggle>
<DropdownMenu>
<DropdownItem>
Server 1
</DropdownItem>
<DropdownItem>
Server 2
</DropdownItem>
</DropdownMenu>
</UncontrolledDropdown>
<ServersDropdown />
</Nav>
</Collapse>
</Navbar>

View file

@ -0,0 +1,23 @@
import React from 'react';
import { DropdownItem, DropdownMenu, DropdownToggle, UncontrolledDropdown } from 'reactstrap';
export default class ServersDropdown extends React.Component {
render() {
return (
<UncontrolledDropdown nav>
<DropdownToggle nav caret>
Servers
</DropdownToggle>
<DropdownMenu>
<DropdownItem>
Server 1 foo
</DropdownItem>
<DropdownItem>
Server 2 foo
</DropdownItem>
</DropdownMenu>
</UncontrolledDropdown>
);
}
}