Moved li element into Login and SignedIn components and added class names for more precise styling. Adjusted the search bar hits so they're centered on the page again. (#290)

This commit is contained in:
Kristofer Koishigawa
2018-09-27 20:44:30 +09:00
committed by Mrugesh Mohapatra
parent 3801cecb72
commit b19ebd0cdf
4 changed files with 64 additions and 32 deletions

View File

@ -4,14 +4,16 @@ import { Button } from 'react-bootstrap';
function Login() { function Login() {
return ( return (
<li className='sign-in-btn'>
<Button <Button
bsStyle='default' bsStyle='default'
className='btn-cta' className='btn-cta sign-in-btn'
href={HOME_PATH + '/signin'} href={HOME_PATH + '/signin'}
target='_blank' target='_blank'
> >
Sign In Sign In
</Button> </Button>
</li>
); );
} }

View File

@ -11,9 +11,11 @@ const mapStateToProps = createSelector(userSelector, ({ picture }) => ({
function SignedIn({ picture }) { function SignedIn({ picture }) {
return ( return (
<li className='user-settings'>
<a href={HOME_PATH + '/settings'}> <a href={HOME_PATH + '/settings'}>
<img height='38px' src={picture} /> <img className='profile-pic' src={picture} />
</a> </a>
</li>
); );
} }

View File

@ -7,33 +7,41 @@ header {
#top-nav { #top-nav {
background: #006400; background: #006400;
margin-bottom: 0.45rem;
height: 36px;
margin-bottom: 0px;
border-radius: 0;
border: none;
display: flex; display: flex;
justify-content: space-between; margin: auto;
height: 36px;
padding: 0 30px 0 15px; padding: 0 30px 0 15px;
line-height: 1;
} }
#top-nav .home-link { #top-left-nav {
display: flex; display: flex;
flex-grow: 0.29;
margin: 0;
justify-content: center;
align-items: center; align-items: center;
} }
#top-nav img { .home-link {
padding: 5.5px 15px;
display: flex;
align-items: center;
justify-content: center;
}
.nav-logo {
max-height: 25px; max-height: 25px;
min-width: 35px; min-width: 35px;
margin: 0 5px 0 15px; margin: auto;
} }
#top-right-nav { #top-right-nav {
display: flex; display: flex;
width: auto; width: auto;
margin: 0; margin: 0 0 0 auto;
list-style: none; list-style: none;
justify-content: space-around; justify-content: space-around;
align-items: center;
} }
#top-right-nav a, #top-right-nav a,
@ -61,7 +69,7 @@ header {
} }
#top-right-nav > li > a { #top-right-nav > li > a {
padding: 10px 15px; padding: 7.5px 15px;
} }
.sign-in-btn { .sign-in-btn {
@ -94,18 +102,31 @@ header {
} }
.user-state-spinner { .user-state-spinner {
height: 40px; height: 36px;
margin-left: 11px;
} }
.user-state-spinner > div { .user-state-spinner > div {
animation-duration: 1.5s !important; animation-duration: 1.5s !important;
} }
#top-right-nav > li.user-settings {
margin-left: 15px;
}
#top-right-nav li.user-settings > a {
padding: 0;
}
.profile-pic {
height: 36px;
width: 36px;
}
/* Search bar */ /* Search bar */
.fcc_searchBar { .fcc_searchBar {
flex-grow: 0.4; width: auto;
padding: 3px 10px 0; flex-grow: 1;
margin-right: auto;
} }
.ais-SearchBox-input { .ais-SearchBox-input {
max-height: 30px; max-height: 30px;
@ -116,5 +137,11 @@ header {
.ais-Hits { .ais-Hits {
left: 0; left: 0;
right: 0; right: 0;
margin: 0 auto; margin-left: auto;
margin-right: auto;
width: 90vw;
/* rules above used so the search
hits search bar's margin-right
and are centered on the page */
background-color: #fff;
} }

View File

@ -11,10 +11,12 @@ function Header() {
return ( return (
<header> <header>
<nav id='top-nav'> <nav id='top-nav'>
<a className='home-link' href='https://www.freecodecamp.org'> <ul id='top-left-nav'>
<a className='home-link' href='https://freecodecamp.org'>
<NavLogo /> <NavLogo />
</a> </a>
<FCCSearch /> <FCCSearch />
</ul>
<ul id='top-right-nav'> <ul id='top-right-nav'>
<li className='nav-btn'> <li className='nav-btn'>
<Link to='/'>Curriculum</Link> <Link to='/'>Curriculum</Link>
@ -30,7 +32,6 @@ function Header() {
</a> </a>
</li> </li>
<li className='sign-in-btn'> <li className='sign-in-btn'>
<UserState /> <UserState />
</li> </li>
</ul> </ul>