Skip to content

Commit 7e49be3

Browse files
committed
Added share buttons.
1 parent 947ac27 commit 7e49be3

File tree

4 files changed

+113
-2
lines changed

4 files changed

+113
-2
lines changed

css/index.scss

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ header {
6060
footer {
6161
position: fixed;
6262
bottom: 0;
63-
height: 100px;
63+
height: 134px;
6464
padding: 1px 0 1px 1px;
6565
width: 1020px;
66-
background-color: #353744;
66+
background-color: $blue;
6767
color: white;
6868
left: calc(50% - 510px);
6969
/*
@@ -72,8 +72,43 @@ footer {
7272
which causes notice-able stuttering in audio playback when ARP is on.
7373
*/
7474
transform: translate3d(0, 0, 0);
75+
.footer-info {
76+
padding: 4px;
77+
}
78+
p {
79+
font-size: 12px;
80+
display: inline-block;
81+
vertical-align: super;
82+
margin: 0 12px;
83+
font-weight: 400;
84+
letter-spacing: 0.06em;
85+
}
86+
a {
87+
color: white;
88+
}
7589
}
7690

91+
.share-button-row {
92+
display: inline-block;
93+
.share-button-container {
94+
display: inline-block;
95+
}
96+
.share-button {
97+
display: inline-block;
98+
border: 1px solid $blue;
99+
border-radius: 24px;
100+
&:hover {
101+
cursor: pointer;
102+
border: 1px solid white;
103+
}
104+
}
105+
.share-count {
106+
display: inline-block;
107+
vertical-align: top;
108+
padding: 5px 8px 0 4px;
109+
font-size: 12px;
110+
}
111+
}
77112

78113
h1 {
79114
font-size: 30px;

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"node-sass": "^4.5.0",
3939
"query-string": "^4.3.1",
4040
"react-select": "^1.0.0-rc.3",
41+
"react-share": "^1.12.1",
4142
"rimraf": "^2.5.4",
4243
"sass-loader": "^4.1.1",
4344
"standard": "^8.6.0",

src/App.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import FilterView from './views/Filter/FilterView.js'
77
import EffectsView from './views/Effects/EffectsView.js'
88
import AmpView from './views/Filter/AmpView.js'
99
import LFOView from './views/LFO/LFOView.js'
10+
import ShareButtonRow from './views/ShareButtons/ShareButtonRow.js'
1011
import Presets from './views/Presets/Presets.js'
1112
import MidiInput from './views/Midi/MidiInput.js'
1213
import {connect} from 'react-redux'
@@ -110,6 +111,15 @@ class App extends React.Component {
110111
<Keyboard
111112
eventEmitter={eventEmitter}
112113
Keyboard={this.props.Keyboard} />
114+
<div className='footer-info'>
115+
<ShareButtonRow />
116+
<p>Made By Elegant Borzoi and Jordan</p>
117+
<p>
118+
<a href='https://github.com/looshi/wavetable-synth-2'>
119+
View Source Code on Github
120+
</a>
121+
</p>
122+
</div>
113123
</footer>
114124

115125
<Synth
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/* eslint-disable react/prefer-stateless-function */
2+
import React from 'react'
3+
import {
4+
ShareButtons,
5+
ShareCounts,
6+
generateShareIcon
7+
} from 'react-share'
8+
9+
const {
10+
FacebookShareButton,
11+
TwitterShareButton
12+
} = ShareButtons
13+
14+
const {
15+
FacebookShareCount
16+
} = ShareCounts
17+
18+
const FacebookIcon = generateShareIcon('facebook')
19+
const TwitterIcon = generateShareIcon('twitter')
20+
21+
const ShareButtonRow = React.createClass({
22+
shouldComponentUpdate: function (nextProps, nextState) {
23+
return false
24+
},
25+
render () {
26+
const shareUrl = 'http://davedave.us/wavetable-synth/'
27+
const title = 'Wavetable Synth'
28+
const shareImage = 'http://davedave.us/wavetable-synth/images/share-image.png'
29+
return (
30+
<div className='share-button-row'>
31+
<div className='share-button-container'>
32+
<FacebookShareButton
33+
url={shareUrl}
34+
title={title}
35+
picture={shareImage}
36+
className='share-button'>
37+
<FacebookIcon
38+
size={24}
39+
round />
40+
</FacebookShareButton>
41+
42+
<FacebookShareCount
43+
url={shareUrl}
44+
className='share-count'>
45+
{count => count}
46+
</FacebookShareCount>
47+
</div>
48+
49+
<div className='share-button-container'>
50+
<TwitterShareButton
51+
url={shareUrl}
52+
title={title}
53+
className='share-button'>
54+
<TwitterIcon
55+
size={24}
56+
round />
57+
</TwitterShareButton>
58+
59+
<div className='share-count' />
60+
</div>
61+
</div>
62+
)
63+
}
64+
})
65+
export default ShareButtonRow

0 commit comments

Comments
 (0)