forked from 1Hive/gardens-ui
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathHeader.js
78 lines (73 loc) · 2 KB
/
Header.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import React from 'react'
import { GU, Link, useTheme } from '@tecommons/ui'
import AccountModule from './Account/AccountModule'
import headerBackgroundSvg from '../assets/header-background.svg'
import logo from '../assets/logo-light-bg.svg'
import logoFullText from '../assets/tecFullTextLogo.svg'
import logoSvg from '../assets/logo.svg'
function Header({ compact }) {
const theme = useTheme()
const Icon = (
<Link href="/#" external={false}>
<img src={logoSvg} height={compact ? 40 : 60} alt="" />
</Link>
)
const headerItemsWidth = compact ? 'auto' : 25 * GU
return (
<header
css={`
background-color: ${theme.background};
margin-bottom: ${compact ? `${2 * GU}px` : 0};
`}
>
<div
css={`
/* background: url(${headerBackgroundSvg}) no-repeat; */
background-size: 811px 600px;
background-position: center;
padding: ${
compact ? `0px` : `0px 0 ${4 * GU}px 0`
};
`}
>
<div
css={`
display: flex;
justify-content: space-between;
align-items: center;
`}
>
<div
css={`
width: 100%;
`}
>
{ compact ?
Icon
:
<div css={`
display: flex;
align-items: center;
`}>
<img src={logo} height="126" alt="" />
<img src={logoFullText} alt="" css={`
height: 50px;
margin-left: ${4.2 * GU}px;
`} />
</div>
}
</div>
{!compact && <div>{Icon}</div>}
<div
css={`
width: ${headerItemsWidth}px;
`}
>
<AccountModule compact={compact} />
</div>
</div>
</div>
</header>
)
}
export default Header