-
Notifications
You must be signed in to change notification settings - Fork 503
/
template.js
91 lines (83 loc) · 2.41 KB
/
template.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
79
80
81
82
83
84
85
86
87
88
89
90
91
import React from 'react'
import styled from 'styled-components'
import Modals from 'modals'
import Alerts from 'components/Alerts'
import Header from './Header'
import MenuLeft from './MenuLeft'
import MenuTop from './MenuTop'
import TrayRight from './TrayRight'
import Page from './Page'
import ErrorBoundary from 'providers/ErrorBoundaryProvider'
import BtcMenu from '../../scenes/Transactions/Bitcoin/Menu'
import BchMenu from '../../scenes/Transactions/Bch/Menu'
import EthMenu from '../../scenes/Transactions/Ether/Menu'
import AddrMenu from '../../scenes/Settings/Addresses/Menu'
import ExchangeMenu from '../Exchange'
import media from 'services/ResponsiveService'
const Wrapper = styled.div`
display: flex;
flex-direction: column;
height: 100%;
`
const Container = styled.div`
display: flex;
position: relative;
width: 100%;
height: calc(100% - 60px);
`
const Nav = styled.div`
flex: 0 0 60px;
background-color: ${props => props.theme['brand-primary']};
`
const Content = styled.div`
position: relative;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: flex-start;
width: calc(100% - 270px);
background-color: ${props => props.theme['white']};
@media(max-width: 768px) { width: 100%; }
`
const Top = styled.div`
display: flex;
height: 115px;
width: 100%;
${media.mobile`
height: 150px;
`}
`
const WalletLayout = props => {
const { location, children } = props
return (
<Wrapper>
<ErrorBoundary>
<Alerts />
<Modals />
<Nav>
<Header />
</Nav>
<Container>
<MenuLeft location={location} />
<TrayRight />
<Content>
<Top>
<MenuTop />
</Top>
{ location.pathname === '/btc/transactions' && <BtcMenu /> }
{ location.pathname === '/bch/transactions' && <BchMenu /> }
{ location.pathname === '/eth/transactions' && <EthMenu /> }
{ location.pathname === '/settings/addresses' && <AddrMenu /> }
{ location.pathname === '/settings/addresses/bch' && <AddrMenu /> }
{ location.pathname === '/exchange' && <ExchangeMenu /> }
{ location.pathname === '/exchange/history' && <ExchangeMenu /> }
<Page>
{children}
</Page>
</Content>
</Container>
</ErrorBoundary>
</Wrapper>
)
}
export default WalletLayout