Merge pull request #85 from nikolabjelo/master
Centralising container, aligning with bootstrap breakpoints, adding a "toTop" handle, and adding HomePage buttons to the mobile menu
This commit is contained in:
7 files changed
+175
-125
No files matched your search
@@ -12,10 +12,3 @@ npm-debug.log*
|
||||
|
||||
#Mac specific files
|
||||
.DS_Store
|
||||
client/package-lock.json
|
||||
client/package-lock.json
|
||||
server/package-lock.json
|
||||
server/package-lock.json
|
||||
client/package-lock.json
|
||||
server/package-lock.json
|
||||
client/package-lock.json
|
||||
Generated
+37
-23
@@ -81,9 +81,9 @@
|
||||
}
|
||||
},
|
||||
"@advancedalgos/users-client": {
|
||||
"version": "0.0.19",
|
||||
"resolved": "https://registry.npmjs.org/@advancedalgos/users-client/-/users-client-0.0.19.tgz",
|
||||
"integrity": "sha512-quYzZvQVIN4UFQFPIvt21Dko7mRdRpRbQXxRdvithoIB5ej/NNamwJAIZJ0ILXRkEQiuEfAi/f4DEmAKOShVGA==",
|
||||
"version": "0.0.21",
|
||||
"resolved": "https://registry.npmjs.org/@advancedalgos/users-client/-/users-client-0.0.21.tgz",
|
||||
"integrity": "sha512-u51GZOIVLtE6asigUx+2fOEtEgmikWS5wDUENyd4jyXMGsn5JgFWpD+psonSbWFgFL8FdiKmMrKwpqHyvHVFWQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@material-ui/core": "^3.2.0",
|
||||
@@ -2271,7 +2271,7 @@
|
||||
},
|
||||
"array-equal": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz",
|
||||
"integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=",
|
||||
"dev": true
|
||||
},
|
||||
@@ -2731,7 +2731,7 @@
|
||||
"dependencies": {
|
||||
"jsesc": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz",
|
||||
"integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=",
|
||||
"dev": true
|
||||
},
|
||||
@@ -6111,16 +6111,16 @@
|
||||
"integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk="
|
||||
},
|
||||
"fast-glob": {
|
||||
"version": "2.2.3",
|
||||
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.3.tgz",
|
||||
"integrity": "sha512-NiX+JXjnx43RzvVFwRWfPKo4U+1BrK5pJPsHQdKMlLoFHrrGktXglQhHliSihWAq+m1z6fHk3uwGHrtRbS9vLA==",
|
||||
"version": "2.2.4",
|
||||
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.4.tgz",
|
||||
"integrity": "sha512-FjK2nCGI/McyzgNtTESqaWP3trPvHyRyoyY70hxjc3oKPNmDe8taohLZpoVKoUjW85tbU5txaYUZCNtVzygl1g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@mrmlnc/readdir-enhanced": "^2.2.1",
|
||||
"@nodelib/fs.stat": "^1.0.1",
|
||||
"@nodelib/fs.stat": "^1.1.2",
|
||||
"glob-parent": "^3.1.0",
|
||||
"is-glob": "^4.0.0",
|
||||
"merge2": "^1.2.1",
|
||||
"merge2": "^1.2.3",
|
||||
"micromatch": "^3.1.10"
|
||||
},
|
||||
"dependencies": {
|
||||
@@ -7135,12 +7135,14 @@
|
||||
"balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
@@ -7155,17 +7157,20 @@
|
||||
"code-point-at": {
|
||||
"version": "1.1.0",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"console-control-strings": {
|
||||
"version": "1.1.0",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"core-util-is": {
|
||||
"version": "1.0.2",
|
||||
@@ -7282,7 +7287,8 @@
|
||||
"inherits": {
|
||||
"version": "2.0.3",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"ini": {
|
||||
"version": "1.3.5",
|
||||
@@ -7294,6 +7300,7 @@
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"number-is-nan": "^1.0.0"
|
||||
}
|
||||
@@ -7308,6 +7315,7 @@
|
||||
"version": "3.0.4",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
@@ -7315,12 +7323,14 @@
|
||||
"minimist": {
|
||||
"version": "0.0.8",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"minipass": {
|
||||
"version": "2.2.4",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"safe-buffer": "^5.1.1",
|
||||
"yallist": "^3.0.0"
|
||||
@@ -7339,6 +7349,7 @@
|
||||
"version": "0.5.1",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"minimist": "0.0.8"
|
||||
}
|
||||
@@ -7419,7 +7430,8 @@
|
||||
"number-is-nan": {
|
||||
"version": "1.0.1",
|
||||
"bundled": true,
|
||||
"dev": true
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"object-assign": {
|
||||
"version": "4.1.1",
|
||||
@@ -7431,6 +7443,7 @@
|
||||
"version": "1.4.0",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
@@ -7552,6 +7565,7 @@
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"code-point-at": "^1.0.0",
|
||||
"is-fullwidth-code-point": "^1.0.0",
|
||||
@@ -8162,7 +8176,7 @@
|
||||
},
|
||||
"hoek": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz",
|
||||
"resolved": "http://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz",
|
||||
"integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==",
|
||||
"dev": true
|
||||
},
|
||||
@@ -14298,9 +14312,9 @@
|
||||
}
|
||||
},
|
||||
"object-hash": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.0.tgz",
|
||||
"integrity": "sha512-05KzQ70lSeGSrZJQXE5wNDiTkBJDlUT/myi6RX9dVIvz7a7Qh4oH93BQdiPMn27nldYvVQCKMUaM83AfizZlsQ==",
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.1.tgz",
|
||||
"integrity": "sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA==",
|
||||
"dev": true
|
||||
},
|
||||
"object-keys": {
|
||||
@@ -16963,7 +16977,7 @@
|
||||
},
|
||||
"cacache": {
|
||||
"version": "10.0.4",
|
||||
"resolved": "https://registry.npmjs.org/cacache/-/cacache-10.0.4.tgz",
|
||||
"resolved": "http://registry.npmjs.org/cacache/-/cacache-10.0.4.tgz",
|
||||
"integrity": "sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
@@ -20540,7 +20554,7 @@
|
||||
},
|
||||
"topo": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/topo/-/topo-2.0.2.tgz",
|
||||
"resolved": "http://registry.npmjs.org/topo/-/topo-2.0.2.tgz",
|
||||
"integrity": "sha1-zVYVdSU5BXwNwEkaYhw7xvvh0YI=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
import { createMuiTheme } from '@material-ui/core/styles'
|
||||
|
||||
export const theme = createMuiTheme({
|
||||
breakpoints: {
|
||||
values: {
|
||||
xs: 0,
|
||||
sm: 768,
|
||||
md: 992,
|
||||
lg: 1200,
|
||||
xl: 1920
|
||||
}
|
||||
},
|
||||
palette: {
|
||||
primary: {
|
||||
main: '#303036',
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
$break-big: 1280px;
|
||||
$break-middle: 992px;
|
||||
$break-small: 768px;
|
||||
$break-extra-small: 532px;
|
||||
$break-lg: 1200px;
|
||||
$break-md: 992px;
|
||||
$break-sm: 768px;
|
||||
$break-xs: 540px;
|
||||
|
||||
$height-large-device: 131px;
|
||||
$height-small-device: 220px;
|
||||
$height-nav-bar: 131px;
|
||||
|
||||
$height-not-top: 87px;
|
||||
|
||||
@@ -65,6 +64,23 @@ body{
|
||||
}
|
||||
}
|
||||
|
||||
.container{
|
||||
padding: 15px 15px 15px 15px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
|
||||
width: 100%;
|
||||
@media screen and (min-width: $break-sm) {
|
||||
width: 768px;
|
||||
}
|
||||
@media screen and (min-width: $break-md) {
|
||||
width: 970px;
|
||||
}
|
||||
@media screen and (min-width: $break-lg) {
|
||||
width: 1170px;
|
||||
}
|
||||
}
|
||||
|
||||
header.menu{
|
||||
transition: $transition-time;
|
||||
&.notOnTop{
|
||||
@@ -82,7 +98,7 @@ header.menu{
|
||||
margin-bottom: ( $height-not-top - $mobile-handle-height ) / 2 ;
|
||||
}
|
||||
nav.links{
|
||||
@media screen and (min-width: $break-big) {
|
||||
@media screen and (min-width: $break-lg) {
|
||||
ul.primaryMenu{
|
||||
li.primaryLink{
|
||||
padding-top: ( $height-not-top - $text-height ) / 2;
|
||||
@@ -94,36 +110,23 @@ header.menu{
|
||||
}
|
||||
}
|
||||
position: fixed;
|
||||
height: $height-large-device;
|
||||
height: $height-nav-bar;
|
||||
width: 100vw;
|
||||
z-index: 125;
|
||||
|
||||
@media screen and (max-width: $break-extra-small) {
|
||||
height: $height-small-device;
|
||||
}
|
||||
.container{
|
||||
padding-top: 0px;
|
||||
padding-bottom: 0px;
|
||||
height: 100%;
|
||||
border-bottom: 1px solid rgba(142, 144, 146, 0.3);
|
||||
|
||||
width: 100%;
|
||||
@media screen and (min-width: $break-small) {
|
||||
width: 750px;
|
||||
}
|
||||
@media screen and (min-width: $break-middle) {
|
||||
width: 970px;
|
||||
}
|
||||
@media screen and (min-width: $break-big) {
|
||||
width: 1270px;
|
||||
}
|
||||
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
img.logo{
|
||||
transition: $transition-time;
|
||||
margin-top: ( $height-large-device - $image-height-big ) / 2 ;
|
||||
margin-top: ( $height-nav-bar - $image-height-big ) / 2 ;
|
||||
height: $image-height-big;
|
||||
@media screen and (max-width: $break-xs) {
|
||||
height: $image-height-small;
|
||||
margin-top: ( $height-nav-bar - $image-height-small ) / 2 ;
|
||||
}
|
||||
}
|
||||
.mobileHandle.openedMobile{
|
||||
&:before{
|
||||
@@ -169,21 +172,21 @@ header.menu{
|
||||
float: right;
|
||||
width: auto;
|
||||
clear: none;
|
||||
margin-top: ( $height-large-device - $mobile-handle-height ) / 2 ;
|
||||
margin-bottom: ( $height-large-device - $mobile-handle-height ) / 2 ;
|
||||
margin-left: 0;
|
||||
margin-top: ( $height-nav-bar - $mobile-handle-height ) / 2 ;
|
||||
margin-bottom: ( $height-nav-bar - $mobile-handle-height ) / 2 ;
|
||||
margin-left: 0 !important;
|
||||
margin-right: 20px;
|
||||
margin: 41px 0 42px 20px;
|
||||
padding: 0 18px 0 40px;
|
||||
position: relative;
|
||||
text-decoration: none;
|
||||
border-radius: 31px;
|
||||
@media screen and (min-width: $break-big) {
|
||||
@media screen and (min-width: $break-lg) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
nav.links{
|
||||
@media screen and (max-width: $break-big - 1) {
|
||||
@media screen and (max-width: $break-lg - 1) {
|
||||
display: none;
|
||||
&.openedMobile{
|
||||
display: block;
|
||||
@@ -209,7 +212,7 @@ header.menu{
|
||||
border: solid white;
|
||||
border-width: 0 2px 2px 0;
|
||||
padding: 3px;
|
||||
margin-top: 18px;
|
||||
margin-top: -32px;
|
||||
margin-right: 7px;
|
||||
transform: rotate(45deg);
|
||||
-webkit-transform: rotate(45deg);
|
||||
@@ -245,7 +248,7 @@ header.menu{
|
||||
}
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: $break-big) {
|
||||
@media screen and (min-width: $break-lg) {
|
||||
display: block;
|
||||
float: right;
|
||||
ul.primaryMenu{
|
||||
@@ -262,10 +265,10 @@ header.menu{
|
||||
display: block;
|
||||
float: left;
|
||||
position: relative;
|
||||
padding-top: ( $height-large-device - $text-height ) / 2;
|
||||
padding-bottom: ( $height-large-device - $text-height ) / 2;
|
||||
padding-right: 21px;
|
||||
padding-left: 21px;
|
||||
padding-top: ( $height-nav-bar - $text-height ) / 2;
|
||||
padding-bottom: ( $height-nav-bar - $text-height ) / 2;
|
||||
padding-right: 14px;
|
||||
padding-left: 14px;
|
||||
&.hasChildren{
|
||||
&:after{
|
||||
content: '';
|
||||
@@ -327,6 +330,7 @@ header.menu{
|
||||
|
||||
.bannerTopBar{
|
||||
background-position: center center;
|
||||
background-size: cover;
|
||||
background-image: url(https://advancedalgos.net/img/photos/teams.jpg);
|
||||
width: 100%;
|
||||
height: 220px;
|
||||
@@ -354,42 +358,31 @@ header.menu{
|
||||
font-size: 64px;
|
||||
line-height: 78px;
|
||||
font-weight: 100;
|
||||
@include fluid-type($break-extra-small, $break-big, 26px, 64px);
|
||||
@include fluid-type($break-xs, $break-lg, 26px, 64px);
|
||||
}
|
||||
.text{
|
||||
color: white;
|
||||
line-height: 30px;
|
||||
font-weight: 600;
|
||||
padding: 20px 0 0.5em 0;
|
||||
@include fluid-type($break-extra-small, $break-big, 18px, 20px);
|
||||
@include fluid-type($break-xs, $break-lg, 18px, 20px);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.homePage{
|
||||
.homePage.container{
|
||||
padding-top: 70px;
|
||||
padding-bottom: 70px;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
@media screen and (min-width: $break-small) {
|
||||
width: 750px;
|
||||
}
|
||||
@media screen and (min-width: $break-middle) {
|
||||
width: 970px;
|
||||
}
|
||||
@media screen and (min-width: 1200px) {
|
||||
width: 1170px;
|
||||
}
|
||||
.title{
|
||||
padding: 0 0 10px 0;
|
||||
font-size: 45px;
|
||||
@include fluid-type($break-xs, $break-lg, 24px, 45px);
|
||||
line-height: 55px;
|
||||
padding: 40px 0 0.5em 0;
|
||||
font-weight: 100;
|
||||
}
|
||||
.subtitle{
|
||||
padding-bottom: 5px;
|
||||
font-size: 20px;
|
||||
@include fluid-type($break-xs, $break-lg, 18px, 20px);
|
||||
line-height: 19px;
|
||||
font-weight: 100;
|
||||
text-transform: uppercase;
|
||||
@@ -402,7 +395,7 @@ header.menu{
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
@media screen and (min-width: $break-small) {
|
||||
@media screen and (min-width: $break-sm) {
|
||||
width: 50%;
|
||||
}
|
||||
p{
|
||||
@@ -421,5 +414,26 @@ header.menu{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.toTop{
|
||||
position: fixed;
|
||||
height: 40px;
|
||||
width: 40px;
|
||||
bottom: 20px;
|
||||
right: 20px;
|
||||
z-index: 1;
|
||||
background-color: #1a1a1a;
|
||||
border-radius: 100%;
|
||||
&:after{
|
||||
content: '';
|
||||
float: right;
|
||||
border: solid white;
|
||||
border-width: 0 3px 3px 0;
|
||||
padding: 3px;
|
||||
margin-top: 18px;
|
||||
margin-right: 15px;
|
||||
transform: rotate(-135deg);
|
||||
-webkit-transform: rotate(-135deg);
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ class Home extends Component {
|
||||
text='Enabling the evolutionary race towards the emergence of superalgos'
|
||||
backgroundUrl='https://aacorporatesitedevelop.azurewebsites.net/img/photos/superalgos-platform.jpg'
|
||||
/>
|
||||
<div className='homePage'>
|
||||
<div className='homePage container'>
|
||||
<Typography variant='h1' align='center' className='title'>Welcome to the Advanced Algos Platform!</Typography>
|
||||
<Typography variant='h2' align='center' className='subtitle'>CO-CREATE >> COMPETE >> EVOLVE</Typography>
|
||||
<div className='column'>
|
||||
|
||||
@@ -9,12 +9,14 @@ import {
|
||||
Group,
|
||||
Adb,
|
||||
VpnKey,
|
||||
Home,
|
||||
AddCircleOutline
|
||||
} from '@material-ui/icons'
|
||||
|
||||
const usersMenus = {
|
||||
title: 'Users',
|
||||
to: '/users',
|
||||
icon: Home,
|
||||
submenus: [
|
||||
{ title: 'Directory', to: '/users/browse', icon: ImportContacts },
|
||||
{ title: 'Search', to: '/users/search', icon: Search },
|
||||
@@ -26,6 +28,7 @@ const usersMenus = {
|
||||
const teamsMenus = {
|
||||
title: 'Teams',
|
||||
to: '/teams',
|
||||
icon: Home,
|
||||
submenus: [
|
||||
{ title: 'Explore teams', to: '/teams/explore', icon: Search },
|
||||
{ title: 'Your teams', to: '/teams/manage-teams', icon: Group, authenticated: true },
|
||||
@@ -38,6 +41,7 @@ const teamsMenus = {
|
||||
const eventsMenus = {
|
||||
title: 'Events',
|
||||
to: '/events',
|
||||
icon: Home,
|
||||
submenus: [
|
||||
{ title: 'All events', to: '/events', icon: Search },
|
||||
{ title: 'Your events', to: '/events/my', icon: GamepadRounded, authenticated: true },
|
||||
@@ -50,6 +54,7 @@ const eventsMenus = {
|
||||
const keyvaultMenus = {
|
||||
title: 'Key Vault',
|
||||
to: '/key-vault',
|
||||
icon: Home,
|
||||
authenticated: true,
|
||||
submenus: [
|
||||
{ title: 'Manage keys', to: '/key-vault/browse', icon: VpnKey },
|
||||
|
||||
@@ -29,6 +29,11 @@ class Header extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
scrollToTop () {
|
||||
document.body.scrollTop = 0 // For Safari
|
||||
document.documentElement.scrollTop = 0 // For Chrome, Firefox, IE and Opera
|
||||
}
|
||||
|
||||
toggleMobileOpen () {
|
||||
this.setState({ mobileOpen: !this.state.mobileOpen })
|
||||
}
|
||||
@@ -75,7 +80,7 @@ class Header extends Component {
|
||||
}
|
||||
let user = JSON.parse(this.state.user)
|
||||
|
||||
const menus = allMenus.map(({ to, title, submenus, authenticated }, index) => {
|
||||
const menus = allMenus.map(({ icon: Icon, to, title, submenus, authenticated }, index) => {
|
||||
if (authenticated && !(this.state.user !== undefined && this.state.user !== null)) {
|
||||
return
|
||||
}
|
||||
@@ -86,20 +91,27 @@ class Header extends Component {
|
||||
key={index}
|
||||
className={openedMenu === index ? 'primaryLink hasChildren selected' : 'primaryLink hasChildren'}
|
||||
>
|
||||
<Link to={to} onClick={() => this.toggleMenuOpen(index, true)}> {title} </Link>
|
||||
{ bigScreen
|
||||
? <Link to={to} onClick={() => this.toggleMenuOpen(index, true)}> {title} </Link>
|
||||
: <a onClick={() => this.toggleMenuOpen(index, true)}> {title} </a>
|
||||
}
|
||||
<ul className='subMenu'>
|
||||
{ bigScreen
|
||||
? ''
|
||||
: <li key={index + 'home'}><a href={to}> <Icon /> Homepage </a></li>
|
||||
}
|
||||
{
|
||||
submenus.map(({ icon: Icon, to: subTo, title: subTitle, externalLink, authenticated: subAuthenticated }, subindex) => {
|
||||
submenus.map(({ icon: SubIcon, to: subTo, title: subTitle, externalLink, authenticated: subAuthenticated }, subindex) => {
|
||||
if (subAuthenticated && !(this.state.user !== undefined && this.state.user !== null)) {
|
||||
return
|
||||
}
|
||||
if (externalLink) {
|
||||
return (
|
||||
<li key={subindex}><a href={subTo}> <Icon /> {subTitle} </a></li>
|
||||
<li key={subindex}><a href={subTo}> <SubIcon /> {subTitle} </a></li>
|
||||
)
|
||||
}
|
||||
return (
|
||||
<li key={subindex}><Link to={subTo} onClick={() => this.closeAll(index)}> <Icon /> {subTitle} </Link></li>
|
||||
<li key={subindex}><Link to={subTo} onClick={() => this.closeAll(index)}> <SubIcon /> {subTitle} </Link></li>
|
||||
)
|
||||
})}
|
||||
</ul>
|
||||
@@ -108,41 +120,44 @@ class Header extends Component {
|
||||
})
|
||||
|
||||
return (
|
||||
<header className={onTop ? 'menu' : 'menu notOnTop'}>
|
||||
<div className='container'>
|
||||
<Link to='/'> <img className='logo' src={AALogo} alt='Advanced Algos' /> </Link>
|
||||
<div className={mobileOpen ? 'mobileHandle openedMobile' : 'mobileHandle'} onClick={() => this.toggleMobileOpen()}>
|
||||
Menu
|
||||
</div>
|
||||
<nav className={mobileOpen ? 'links openedMobile' : 'links'}>
|
||||
<ul className='primaryMenu'>
|
||||
<li className='primaryLink'>
|
||||
<Link to='/charts'> Charts </Link>
|
||||
</li>
|
||||
{menus}
|
||||
<li className='primaryLink'>
|
||||
<a href='https://www.advancedalgos.net/documentation-quick-start.shtml'> Docs </a>
|
||||
</li>
|
||||
{this.state.user !== undefined && this.state.user !== null ? (
|
||||
<LoggedIn
|
||||
user={user}
|
||||
auth={auth}
|
||||
bigScreen={bigScreen}
|
||||
openedMenu={openedMenu}
|
||||
toggleMenuOpen={(keyValue, allowedValue) => this.toggleMenuOpen(keyValue, allowedValue)}
|
||||
mouseLeave={(allowedValue) => this.mouseLeave(allowedValue)}
|
||||
closeAll={() => this.closeAll()}
|
||||
/>
|
||||
) : (
|
||||
|
||||
<React.Fragment>
|
||||
<header className={onTop ? 'menu' : 'menu notOnTop'}>
|
||||
<div className='container'>
|
||||
<Link to='/'> <img className='logo' src={AALogo} alt='Advanced Algos' /> </Link>
|
||||
<div className={mobileOpen ? 'mobileHandle openedMobile' : 'mobileHandle'} onClick={() => this.toggleMobileOpen()}>
|
||||
Menu
|
||||
</div>
|
||||
<nav className={mobileOpen ? 'links openedMobile' : 'links'}>
|
||||
<ul className='primaryMenu'>
|
||||
<li className='primaryLink'>
|
||||
<a href='#' onClick={() => auth.login()}> Login / Sign Up </a>
|
||||
<Link to='/charts'> Charts </Link>
|
||||
</li>
|
||||
)}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
{menus}
|
||||
<li className='primaryLink'>
|
||||
<a href='https://www.advancedalgos.net/documentation-quick-start.shtml'> Docs </a>
|
||||
</li>
|
||||
{this.state.user !== undefined && this.state.user !== null ? (
|
||||
<LoggedIn
|
||||
user={user}
|
||||
auth={auth}
|
||||
bigScreen={bigScreen}
|
||||
openedMenu={openedMenu}
|
||||
toggleMenuOpen={(keyValue, allowedValue) => this.toggleMenuOpen(keyValue, allowedValue)}
|
||||
mouseLeave={(allowedValue) => this.mouseLeave(allowedValue)}
|
||||
closeAll={() => this.closeAll()}
|
||||
/>
|
||||
) : (
|
||||
|
||||
<li className='primaryLink'>
|
||||
<a href='#' onClick={() => auth.login()}> Login / Sign Up </a>
|
||||
</li>
|
||||
)}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
{onTop ? '' : <div className='toTop' onClick={() => { this.scrollToTop() }} />}
|
||||
</React.Fragment>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user