1
0
mirror of https://github.com/franjsco/tick3t synced 2024-12-27 09:53:37 +01:00

refactor: Navbar component

This commit is contained in:
Francesco Esposito 2019-07-31 15:55:18 +02:00
parent e5ff4d781c
commit 4e146f4dd5
2 changed files with 23 additions and 11 deletions

View File

@ -1,13 +1,12 @@
.custom-toggler .navbar-toggler-icon {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(9,55,150, 1)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E");
}
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(9,55,150, 1)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E");
}
.title {
background: -webkit-linear-gradient(#0eaed3, #8346f6);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background: -webkit-linear-gradient(#0eaed3, #8346f6);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-size: 30px;
font-weight: 900;
line-height: 0.8;
}
}

View File

@ -1,5 +1,7 @@
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import { connect } from 'react-redux';
import { userActions } from '../_actions';
import {
Container,
Collapse,
@ -10,8 +12,6 @@ import {
NavItem
} from 'reactstrap';
import { isLogin } from '../utils/auth';
import Button from '../components/Button';
import './NavBar.css';
import logo from '../assets/admin.svg';
@ -74,7 +74,7 @@ class NavBar extends Component {
<Nav className="ml-auto" navbar>
<NavItem>
{
isLogin() ? (
this.props.loggedIn ? (
<Button
onClick={this.closeNavbar}
tag={Link}
@ -101,4 +101,17 @@ class NavBar extends Component {
}
}
export default NavBar;
const mapStateToProps = (state) => {
return {
loggedIn: state.user.loggedIn,
error: state.user.error
};
}
const mapDispatchToProps = (dispatch) => {
return {
logout: () => dispatch(userActions.logout())
};
}
export default connect(mapStateToProps, mapDispatchToProps) (NavBar);