Skip to content

Commit 5843924

Browse files
committed
feat(app): fix styling of header
1 parent 5bcce14 commit 5843924

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

pages/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ type Props = {
1111
url: any;
1212
}
1313
const IndexPage: NextPage = (props: Props) => {
14-
console.log(props.entries);
14+
1515
return (
16+
1617
<Layout meta={defaultMetaTags}>
1718
<div>Latest posts</div>
18-
1919
</Layout>
2020
)
2121
};

shared/components/header/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ import React, { FunctionComponent } from 'react';
33
type Props = {}
44
const Header: FunctionComponent<Props> = ({}) => {
55
return (
6-
<div>hello</div>
6+
<div className="nav">
7+
<img className="logo" src="/static/logo.png" alt="logo"/>
8+
<style jsx>{`
9+
.nav { background-color: #ffffff; border-bottom: 1px solid #ececec; box-shadow: 0 2px 50px 0 rgba(0,0,0,0.16);}
10+
.logo { border-radius: 50%; width: 10rem; }
11+
`}</style>
12+
</div>
713
);
814
};
915

shared/components/layout/index.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { FunctionComponent, Fragment, ReactNode } from 'react';
22
import Meta from '../meta';
3+
import Header from '../header';
34

45
type Props = {
56
meta: any;
@@ -10,11 +11,17 @@ const Layout: FunctionComponent<Props> = ({meta, children}) => {
1011
return (
1112
<Fragment>
1213
<Meta tag={meta}/>
14+
<div className="header">
15+
<Header/>
16+
</div>
1317
<div className="layout">
1418
<main>
1519
{children}
1620
</main>
1721
</div>
22+
<style jsx global>{`
23+
body { margin: 0; padding: 0}
24+
`}</style>
1825
</Fragment>
1926
);
2027
};

static/logo.png

110 KB
Loading

0 commit comments

Comments
 (0)