Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit eea18f6

Browse files
committed
seperate container in body
1 parent d851c19 commit eea18f6

File tree

23 files changed

+263
-501
lines changed

23 files changed

+263
-501
lines changed

components/BodyLayout/index.js

Lines changed: 0 additions & 41 deletions
This file was deleted.

containers/Banner/index.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
*
3+
* Banner
4+
*
5+
*/
6+
7+
import React from 'react'
8+
import { inject, observer } from 'mobx-react'
9+
10+
// import Link from 'next/link'
11+
12+
import {
13+
makeDebugger,
14+
storeSelector,
15+
getSVGIconPath,
16+
} from '../../utils/functions'
17+
18+
import * as logic from './logic'
19+
20+
import { Banner, BannerLogo } from './styles'
21+
22+
const debug = makeDebugger('C:Banner')
23+
24+
class BannerContainer extends React.Component {
25+
componentWillMount() {
26+
debug('mount')
27+
logic.init(this.props.banner)
28+
}
29+
30+
render() {
31+
const { banner } = this.props
32+
const { curUrlPath } = banner
33+
34+
const defaultIcon = 'js'
35+
const iconKey = curUrlPath === '/' ? defaultIcon : curUrlPath
36+
37+
return (
38+
<Banner>
39+
<BannerLogo path={getSVGIconPath(iconKey)} />
40+
</Banner>
41+
)
42+
}
43+
}
44+
45+
export default inject(storeSelector('banner'))(observer(BannerContainer))

containers/Banner/lang.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Banner Langs
3+
*
4+
* This contains all the text for the Banner component.
5+
*/
6+
import { defineMessages } from 'react-intl'
7+
8+
export default defineMessages({
9+
header: {
10+
id: 'containers.Banner.header',
11+
defaultMessage: 'This is the Banner component !',
12+
},
13+
})

containers/Banner/logic.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// import R from 'ramda'
2+
3+
import { makeDebugger } from '../../utils/functions'
4+
5+
/* eslint-disable no-unused-vars */
6+
const debug = makeDebugger('L:Banner')
7+
/* eslint-enable no-unused-vars */
8+
9+
let banner = null
10+
11+
export function someMethod() {
12+
debug(banner)
13+
}
14+
15+
export function init(selectedStore) {
16+
banner = selectedStore
17+
}

containers/Banner/styles/index.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import styled from 'styled-components'
2+
import ReactSVG from 'react-svg'
3+
4+
export const Banner = styled.div`
5+
padding: 5px;
6+
padding-left: 80px;
7+
height: 15vh;
8+
border-bottom: 1px solid tomato;
9+
`
10+
11+
export const BannerLogo = styled(ReactSVG)`
12+
margin-top: 2em;
13+
width: 100px;
14+
height: 100px;
15+
`
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// import React from 'react'
22
// import { shallow } from 'enzyme'
33

4-
// import Content from '../index'
4+
// import Banner from '../index'
55

6-
describe('<Content />', () => {
6+
describe('<Banner />', () => {
77
it('Expect to have unit tests specified', () => {
8-
expect(true).toEqual(true)
8+
expect(true).toEqual(false)
99
})
1010
})

containers/Body/Home.js

Lines changed: 0 additions & 76 deletions
This file was deleted.

containers/Body/index.js

Lines changed: 0 additions & 89 deletions
This file was deleted.

0 commit comments

Comments
 (0)