Skip to content

Commit e637402

Browse files
MichaelDeBoeySaraVieira
authored andcommitted
Refactor layout to functional component with hooks (codesandbox#1941)
1 parent 948ee71 commit e637402

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

packages/homepage/src/components/layout.js

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,18 @@ import Footer from '@codesandbox/common/lib/components/Footer';
88
import '../css/typography.css';
99
import '../css/global.css';
1010

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-
<main style={{ maxWidth: '100vw', overflowX: 'hidden' }}>
22-
{children}
23-
</main>
24-
<Footer />
25-
</div>
26-
</ThemeProvider>
27-
);
28-
}
29-
}
11+
const TemplateWrapper = ({ children }) => (
12+
<ThemeProvider theme={theme}>
13+
<div>
14+
<div style={{ position: 'absolute', left: 0, right: 0, zIndex: 20 }}>
15+
<Navigation />
16+
</div>
17+
18+
<main style={{ maxWidth: '100vw', overflowX: 'hidden' }}>{children}</main>
19+
20+
<Footer />
21+
</div>
22+
</ThemeProvider>
23+
);
24+
25+
export default TemplateWrapper;

0 commit comments

Comments
 (0)