Skip to content

Commit e475f37

Browse files
authored
Debug Gatsby (codesandbox#394)
* Change something to layout * Another change * Make layout a class
1 parent 606632f commit e475f37

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed
Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import styled, { ThemeProvider } from 'styled-components';
2+
import { ThemeProvider } from 'styled-components';
33

44
import theme from 'common/theme';
55
import '../css/typography.css';
@@ -8,23 +8,22 @@ import '../css/global.css';
88
import Navigation from '../components/Navigation';
99
import Footer from '../components/Footer';
1010

11-
const Absolute = styled.div`
12-
position: absolute;
13-
left: 0;
14-
right: 0;
15-
z-index: 20;
16-
`;
17-
18-
const TemplateWrapper = ({ children }) => (
19-
<ThemeProvider theme={theme}>
20-
<div>
21-
<Absolute>
22-
<Navigation />
23-
</Absolute>
24-
<div style={{ maxWidth: '100vw', overflowX: 'hidden' }}>{children()}</div>
25-
<Footer />
26-
</div>
27-
</ThemeProvider>
28-
);
29-
30-
export default TemplateWrapper;
11+
// eslint-disable-next-line
12+
export default class TemplateWrapper extends React.Component {
13+
render() {
14+
const { children } = this.props;
15+
return (
16+
<ThemeProvider theme={theme}>
17+
<div>
18+
<div style={{ position: 'absolute', left: 0, right: 0, zIndex: 20 }}>
19+
<Navigation />
20+
</div>
21+
<div style={{ maxWidth: '100vw', overflowX: 'hidden' }}>
22+
{children()}
23+
</div>
24+
<Footer />
25+
</div>
26+
</ThemeProvider>
27+
);
28+
}
29+
}

0 commit comments

Comments
 (0)