Skip to content

Commit 17bb8f7

Browse files
author
Ethan Jon
committed
share in header
1 parent 89ad198 commit 17bb8f7

File tree

2 files changed

+33
-12
lines changed

2 files changed

+33
-12
lines changed

react/components/header.js

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ import getScrollTop from 'dom-helpers/query/scrollTop'
77
import Link from 'next/link'
88
import PropTypes from 'prop-types'
99
import raf from 'raf'
10-
import {IoIosEmailOutline, IoSocialFacebookOutline} from 'react-icons/lib/io'
10+
import {
11+
IoIosEmailOutline as EmailIcon,
12+
IoSocialFacebookOutline as FacebookIcon,
13+
IoShare as ShareIcon
14+
} from 'react-icons/lib/io'
1115
import {observer, PropTypes as MobxReactPropTypes} from 'mobx-react'
1216

1317
@observer
@@ -93,16 +97,26 @@ class Header extends Component {
9397
{'col-12': this.context.headerStore.progress === 1}])}
9498
/>
9599

96-
<div className='absolute top-0 right-0 bottom-0 left-0 flex items-center'>
97-
<img
98-
alt={`${this.context.siteData.name} logo`}
99-
className='fit block mx1 sm-mx2 md-mx3 header-scroll-logo'
100-
src={this.context.siteData.images['apple-icon-180x180']}
101-
/>
100+
<div className='absolute top-0 right-0 bottom-0 left-0 flex items-center justify-between max-width-4 mx-auto'>
101+
<div className='row-12 flex-auto flex items-center'>
102+
<img
103+
alt={`${this.context.siteData.name} logo`}
104+
className='fit block mx1 header-scroll-logo'
105+
src={this.context.siteData.images['apple-icon-180x180']}
106+
/>
102107

103-
{this.context.headerStore.scrollTitle && (
104-
<div className='white h3 nowrap'>{this.context.headerStore.scrollTitle}</div>
105-
)}
108+
{this.context.headerStore.scrollTitle && (
109+
<div className='white h3 nowrap'>{this.context.headerStore.scrollTitle}</div>
110+
)}
111+
</div>
112+
113+
<a
114+
className='icon-wrapper block white h6 ups mx1 p1 hide'
115+
href='javascript:void(0)'
116+
>
117+
<ShareIcon />
118+
<span>{'Share'}</span>
119+
</a>
106120
</div>
107121
</div>
108122
)}
@@ -118,7 +132,7 @@ class Header extends Component {
118132
href='javascript:void(0)'
119133
onClick={this.context.emailModalStore.handleOpen}
120134
>
121-
<IoIosEmailOutline className='header-icon' />
135+
<EmailIcon className='header-icon' />
122136
</a>
123137
</div>
124138

@@ -144,7 +158,7 @@ class Header extends Component {
144158
href='javascript:void(0)'
145159
onClick={this.context.likeModalStore.handleOpen}
146160
>
147-
<IoSocialFacebookOutline className='header-icon' />
161+
<FacebookIcon className='header-icon' />
148162
</a>
149163
)}
150164
</div>

react/styles/app.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ ul { margin: 0; padding: 0; }
3434
.serif { font-family: 'Lora', serif; }
3535
.ups { text-transform: uppercase; }
3636

37+
/* specific classes */
38+
.icon-wrapper {
39+
display: flex;
40+
align-items: center;
41+
> *:first-child { margin-right: 0.25rem; }
42+
}
43+
3744
/* specific size classes */
3845
@mixin spacing { margin-left: 1.25rem; margin-right: 1.25rem; }
3946
.page-x-spacing { @include spacing; }

0 commit comments

Comments
 (0)