web: Refactoring NavMenu

This commit is contained in:
Alexey Safronov 2019-05-24 11:39:46 +03:00
parent 7a23845045
commit 5c40ce9b40
6 changed files with 23 additions and 21 deletions

View File

@ -450,7 +450,7 @@ LoginForm.defaultProps = {
password: ''
};
var _jsxFileName$3 = "D:\\GitHub\\CommunityServer-AspNetCore\\web\\ASC.Web.Components\\src\\components\\Nav\\index.js";
var _jsxFileName$3 = "D:\\GitHub\\CommunityServer-AspNetCore\\web\\ASC.Web.Components\\src\\components\\NavMenu\\index.js";
function _templateObject$3() {
var data = _taggedTemplateLiteral(["\n background: #0f4071;\n color: #c5c5c5;\n height: 48px;\n padding-top: 4px;\n z-index: 1;\n"]);
_templateObject$3 = function _templateObject() {
@ -459,22 +459,22 @@ function _templateObject$3() {
return data;
}
var StyledNav = styled__default(reactstrap.Navbar)(_templateObject$3());
var Nav = function Nav(props) {
var NavMenu = function NavMenu(props) {
var children = props.children;
return core.jsx(StyledNav, {
dark: true,
__source: {
fileName: _jsxFileName$3,
lineNumber: 19
lineNumber: 18
},
__self: this
}, children);
};
Nav.propTypes = {
text: PropTypes.string
NavMenu.propTypes = {
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node])
};
exports.Button = Button;
exports.LoginForm = LoginForm;
exports.Nav = Nav;
exports.NavMenu = NavMenu;
exports.TextInput = TextInput;

View File

@ -442,7 +442,7 @@ LoginForm.defaultProps = {
password: ''
};
var _jsxFileName$3 = "D:\\GitHub\\CommunityServer-AspNetCore\\web\\ASC.Web.Components\\src\\components\\Nav\\index.js";
var _jsxFileName$3 = "D:\\GitHub\\CommunityServer-AspNetCore\\web\\ASC.Web.Components\\src\\components\\NavMenu\\index.js";
function _templateObject$3() {
var data = _taggedTemplateLiteral(["\n background: #0f4071;\n color: #c5c5c5;\n height: 48px;\n padding-top: 4px;\n z-index: 1;\n"]);
_templateObject$3 = function _templateObject() {
@ -451,19 +451,19 @@ function _templateObject$3() {
return data;
}
var StyledNav = styled(Navbar)(_templateObject$3());
var Nav = function Nav(props) {
var NavMenu = function NavMenu(props) {
var children = props.children;
return jsx(StyledNav, {
dark: true,
__source: {
fileName: _jsxFileName$3,
lineNumber: 19
lineNumber: 18
},
__self: this
}, children);
};
Nav.propTypes = {
text: PropTypes.string
NavMenu.propTypes = {
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node])
};
export { Button, LoginForm, Nav, TextInput };
export { Button, LoginForm, NavMenu, TextInput };

View File

@ -1,8 +1,8 @@
import React from 'react';
import { storiesOf } from '@storybook/react';
import { Nav } from 'asc-web-components';
import { NavMenu } from 'asc-web-components';
storiesOf('Components|Nav', module)
storiesOf('Components|NavMenu', module)
.add('base', () => (
<Nav></Nav>
<NavMenu></NavMenu>
));

View File

@ -2,7 +2,6 @@ import React from 'react'
import { Navbar } from 'reactstrap'
import styled from 'styled-components'
import PropTypes from 'prop-types'
import './styles.scss'
const StyledNav = styled(Navbar)`
background: #0f4071;
@ -12,7 +11,7 @@ const StyledNav = styled(Navbar)`
z-index: 1;
`;
const Nav = props => {
const NavMenu = props => {
const { children } = props;
return (
@ -20,8 +19,11 @@ const Nav = props => {
);
}
Nav.propTypes = {
text: PropTypes.string
NavMenu.propTypes = {
children: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.node),
PropTypes.node
])
}
export default Nav
export default NavMenu

View File

@ -1,4 +1,4 @@
export { default as Button } from './components/Button/'
export { default as TextInput } from './components/TextInput/'
export { default as LoginForm } from './components/Forms/Login'
export { default as Nav } from './components/Nav'
export { default as NavMenu } from './components/NavMenu'