aboutsummaryrefslogtreecommitdiff
path: root/src/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/index.js')
-rw-r--r--src/index.js30
1 files changed, 20 insertions, 10 deletions
diff --git a/src/index.js b/src/index.js
index 512d416..5c657f9 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,22 +1,32 @@
-import React from 'react';
+import React, { useState } from 'react';
import ReactDOM from 'react-dom';
import styled from 'styled-components';
import CssBaseline from '@material-ui/core/CssBaseline'
-import Header from "./components/Header";
+import Header from './components/Header/Header';
-const App = () => (
- <Root>
- <CssBaseline/>
- <Header/>
- <p> Page content here </p>
- </Root>
-);
+const App = () => {
+
+ const [page, setPage] = useState('app');
+
+ return (
+ <Root>
+ <CssBaseline/>
+ <Header setPage={setPage} />
+ <h1> This is the {page} page! </h1>
+ <p>
+ This text is rendered outside of <code>Header</code> component, but
+ interacting with <code>Header</code> can influence content of this page!
+ </p>
+ </Root>
+ );
+};
const Root = styled.div`
- background: lightgrey;
+ background: cornsilk;
+ padding-bottom: 25px;
`;