Skip to content

Commit 1d7a354

Browse files
committed
Header adjusts
1 parent 86cea63 commit 1d7a354

File tree

7 files changed

+67
-24
lines changed

7 files changed

+67
-24
lines changed

src/components/back4App/Header/Header.react.js

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default class Header extends React.Component {
2020
}
2121
componentWillMount() {
2222
/*
23-
- Thi-s resource should be implemented following parse-dashboard community standards (using flux).
23+
- This resource should be implemented following parse-dashboard community standards (using flux).
2424
But it was actualy not possible to use the subscribeTo decorator in the Header component
2525
before the App was injected in the router. This is a simple temporary solution.
2626
*/
@@ -49,29 +49,26 @@ export default class Header extends React.Component {
4949
}} />
5050
</div>
5151
</Media>
52-
<Media query="(min-width: 1100px)">
53-
<a className={styles['logo-face']} href="http://www.back4app.com/">
54-
<Icon width={46} height={47} name='back4app-logo-face-blue' fill='#208AEC' />
52+
53+
<a className={styles['logo-face']} href="http://www.back4app.com/">
54+
<Icon width={46} height={47} name='back4app-logo-face-blue' fill='#208AEC' />
55+
</a>
56+
57+
<Media query="(min-width: 680px)">
58+
<a className={styles['logo-text']} href="http://www.back4app.com/">
59+
<Icon width={134} height={53} name='back4app-logo-text-blue' fill='#208AEC' />
5560
</a>
5661
</Media>
57-
<a className={styles['logo-text']} href="http://www.back4app.com/">
58-
<Icon width={134} height={53} name='back4app-logo-text-blue' fill='#208AEC' />
59-
</a>
60-
</div>
6162

63+
</div>
6264
<div className={styles['right-side']}>
63-
64-
<Media query="(min-width: 1100px)">
65-
<Nav items={navData.items} />
66-
</Media>
67-
65+
<Nav items={navData.items} />
6866
<Media query="(min-width: 1100px)">
6967
<div className="ml-auto">
7068
<Dropdown items={navData.dropdownItems}>{this.state.username && `Hello, ${this.state.username}`}<i className="dropdown-icon zmdi zmdi-caret-down"></i></Dropdown>
7169
<Button color="green" weight="700" url="https://dashboard.back4app.com/apps/#!/apps/new">NEW APP</Button>
7270
</div>
7371
</Media>
74-
7572
</div>
7673
</header>
7774
);

src/components/back4App/Header/Header.scss

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
font-family: 'Raleway';
1313
font-size: 16px;
1414
padding-right: 45px;
15-
15+
1616
.left-side {
1717
display: flex;
1818
min-width: 247px;
@@ -41,4 +41,25 @@
4141
padding: 24px 0 0 10px;
4242
white-space: nowrap;
4343
}
44+
45+
// Responsive
46+
@media(max-width: 1100px) {
47+
padding-right: 14px;
48+
.left-side {
49+
min-width: 44px;
50+
max-width: 44px;
51+
margin-left: 14px;
52+
}
53+
54+
.logo-face {
55+
display: none;
56+
57+
@media(max-width: 680px) {
58+
display: block;
59+
position: absolute;
60+
left: 50%;
61+
margin-left: -70px;
62+
}
63+
}
64+
}
4465
}

src/components/back4App/Header/headerNavData.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const headerNavData = {
22
items: [
33
{label: 'My Apps', url: 'https://dashboard.back4app.com/apps/#!/admin'},
4-
{label: 'Dashboard', url: 'https://dashboard.back4app.com/'},
4+
{label: 'Dashboard', url: 'https://parse-dashboard.back4app.com/'},
55
{label: 'Docs', url: 'http://docs.back4app.com/'},
66
{label: 'Community', url: 'https://groups.google.com/forum/#!forum/back4app'},
77
{label: 'Blog', url: 'http://blog.back4app.com/'},
@@ -14,4 +14,9 @@ const headerNavData = {
1414
]
1515
}
1616

17-
export default headerNavData;
17+
headerNavData.sidebarItems = [
18+
...headerNavData.items,
19+
...headerNavData.dropdownItems,
20+
]
21+
22+
export default headerNavData;
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
@import 'stylesheets/back4app.scss';
22

33
.nav {
4+
display: flex;
5+
flex-basis: 100%;
6+
47
.menu {
58
display: flex;
69

@@ -9,4 +12,9 @@
912
margin-top: 0px;
1013
}
1114
}
12-
}
15+
16+
// Responsive
17+
@media(max-width: 1100px) {
18+
justify-content: center;
19+
}
20+
}

src/components/back4App/HeaderNavItem/HeaderNavItem.react.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { Link } from 'react-router';
55
import styles from 'components/back4App/HeaderNavItem/HeaderNavItem.scss';
66

77
let NavItem = props => {
8-
98
return (
109
<li className={`${styles.item} ${props.isCurrent ? styles.active : ''}`}>
1110
{
@@ -21,7 +20,6 @@ let NavItem = props => {
2120
export default class HeaderNavItem extends Component {
2221
constructor(props) {
2322
super(props);
24-
2523
this.state = {
2624
isCurrent: !!(props.index === 1)
2725
}

src/components/back4App/HeaderNavItem/HeaderNavItem.scss

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
@import 'stylesheets/back4app.scss';
22

33
.item {
4-
54
margin-top: 6px;
65

76
&:not(:first-child) {
@@ -22,6 +21,10 @@
2221
color: $dark-gray;
2322
font-weight: 300;
2423
white-space: nowrap;
24+
25+
&:hover {
26+
color: #208ADB;
27+
}
2528
}
2629

2730
.icon {
@@ -30,4 +33,15 @@
3033
color: blue;
3134
}
3235

33-
}
36+
37+
// Responsive
38+
@media(max-width: 1100px) {
39+
&:not(:first-child) {
40+
margin-left: 0;
41+
}
42+
43+
&:not(.active) {
44+
display: none;
45+
}
46+
}
47+
}

src/components/back4App/Sidebar/Sidebar.react.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const _renderHeaderMenuItems = items => items.map(({label, pathname, url}, index
2323
let SidebarNav = props => {
2424
return (
2525
<nav className={styles.menu} id="accordion" role="tablist" aria-multiselectable="true">
26-
{_renderHeaderMenuItems(navData.items)}
26+
{_renderHeaderMenuItems(navData.sidebarItems)}
2727
</nav>
2828
);
2929
};
@@ -42,7 +42,7 @@ let sidebarContent = (
4242
</header>
4343

4444
<div className={styles['menu-wrapper']}>
45-
{ <SidebarNav items={navData.items} /> }
45+
{ <SidebarNav items={navData.sidebarItems} /> }
4646
</div>
4747

4848
<footer className={styles.footer}>

0 commit comments

Comments
 (0)