-
Notifications
You must be signed in to change notification settings - Fork 429
/
Demo.tsx
319 lines (286 loc) · 8.79 KB
/
Demo.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
/* eslint-disable react/prefer-stateless-function */
/* eslint-disable import/no-unresolved, import/extensions, import/no-extraneous-dependencies */
import React, { Component } from 'react';
import {
FacebookShareCount,
PinterestShareCount,
VKShareCount,
OKShareCount,
RedditShareCount,
TumblrShareCount,
HatenaShareCount,
FacebookShareButton,
FacebookMessengerShareButton,
FacebookMessengerIcon,
LinkedinShareButton,
TwitterShareButton,
PinterestShareButton,
VKShareButton,
OKShareButton,
TelegramShareButton,
WhatsappShareButton,
RedditShareButton,
EmailShareButton,
TumblrShareButton,
LivejournalShareButton,
MailruShareButton,
ViberShareButton,
WorkplaceShareButton,
LineShareButton,
WeiboShareButton,
PocketShareButton,
InstapaperShareButton,
HatenaShareButton,
FacebookIcon,
XIcon,
LinkedinIcon,
PinterestIcon,
VKIcon,
OKIcon,
TelegramIcon,
WhatsappIcon,
RedditIcon,
TumblrIcon,
MailruIcon,
EmailIcon,
LivejournalIcon,
ViberIcon,
WorkplaceIcon,
LineIcon,
PocketIcon,
InstapaperIcon,
WeiboIcon,
HatenaIcon,
} from '../src';
import './Demo.css';
import exampleImage from './react-share-pin-example.png';
class Demo extends Component {
render() {
const shareUrl = 'http://github.com';
const title = 'GitHub';
return (
<div className="Demo__container">
<div className="Demo__some-network">
<FacebookShareButton
url={shareUrl}
quote={title}
className="Demo__some-network__share-button"
>
<FacebookIcon size={32} round />
</FacebookShareButton>
<div>
<FacebookShareCount url={shareUrl} className="Demo__some-network__share-count">
{count => count}
</FacebookShareCount>
</div>
</div>
<div className="Demo__some-network">
<FacebookMessengerShareButton
url={shareUrl}
appId="521270401588372"
className="Demo__some-network__share-button"
>
<FacebookMessengerIcon size={32} round />
</FacebookMessengerShareButton>
</div>
<div className="Demo__some-network">
<TwitterShareButton
url={shareUrl}
title={title}
className="Demo__some-network__share-button"
>
<XIcon size={32} round />
</TwitterShareButton>
<div className="Demo__some-network__share-count"> </div>
</div>
<div className="Demo__some-network">
<TelegramShareButton
url={shareUrl}
title={title}
className="Demo__some-network__share-button"
>
<TelegramIcon size={32} round />
</TelegramShareButton>
<div className="Demo__some-network__share-count"> </div>
</div>
<div className="Demo__some-network">
<WhatsappShareButton
url={shareUrl}
title={title}
separator=":: "
className="Demo__some-network__share-button"
>
<WhatsappIcon size={32} round />
</WhatsappShareButton>
<div className="Demo__some-network__share-count"> </div>
</div>
<div className="Demo__some-network">
<LinkedinShareButton url={shareUrl} className="Demo__some-network__share-button">
<LinkedinIcon size={32} round />
</LinkedinShareButton>
</div>
<div className="Demo__some-network">
<PinterestShareButton
url={String(window.location)}
media={`${String(window.location)}/${exampleImage}`}
className="Demo__some-network__share-button"
>
<PinterestIcon size={32} round />
</PinterestShareButton>
<div>
<PinterestShareCount url={shareUrl} className="Demo__some-network__share-count" />
</div>
</div>
<div className="Demo__some-network">
<VKShareButton
url={shareUrl}
image={`${String(window.location)}/${exampleImage}`}
className="Demo__some-network__share-button"
>
<VKIcon size={32} round />
</VKShareButton>
<div>
<VKShareCount url={shareUrl} className="Demo__some-network__share-count" />
</div>
</div>
<div className="Demo__some-network">
<OKShareButton
url={shareUrl}
image={`${String(window.location)}/${exampleImage}`}
className="Demo__some-network__share-button"
>
<OKIcon size={32} round />
</OKShareButton>
<div>
<OKShareCount url={shareUrl} className="Demo__some-network__share-count" />
</div>
</div>
<div className="Demo__some-network">
<RedditShareButton
url={shareUrl}
title={title}
windowWidth={660}
windowHeight={460}
className="Demo__some-network__share-button"
>
<RedditIcon size={32} round />
</RedditShareButton>
<div>
<RedditShareCount url={shareUrl} className="Demo__some-network__share-count" />
</div>
</div>
<div className="Demo__some-network">
<TumblrShareButton
url={shareUrl}
title={title}
className="Demo__some-network__share-button"
>
<TumblrIcon size={32} round />
</TumblrShareButton>
<div>
<TumblrShareCount url={shareUrl} className="Demo__some-network__share-count" />
</div>
</div>
<div className="Demo__some-network">
<LivejournalShareButton
url={shareUrl}
title={title}
description={shareUrl}
className="Demo__some-network__share-button"
>
<LivejournalIcon size={32} round />
</LivejournalShareButton>
</div>
<div className="Demo__some-network">
<MailruShareButton
url={shareUrl}
title={title}
className="Demo__some-network__share-button"
>
<MailruIcon size={32} round />
</MailruShareButton>
</div>
<div className="Demo__some-network">
<EmailShareButton
url={shareUrl}
subject={title}
body="body"
className="Demo__some-network__share-button"
>
<EmailIcon size={32} round />
</EmailShareButton>
</div>
<div className="Demo__some-network">
<ViberShareButton
url={shareUrl}
title={title}
className="Demo__some-network__share-button"
>
<ViberIcon size={32} round />
</ViberShareButton>
</div>
<div className="Demo__some-network">
<WorkplaceShareButton
url={shareUrl}
quote={title}
className="Demo__some-network__share-button"
>
<WorkplaceIcon size={32} round />
</WorkplaceShareButton>
</div>
<div className="Demo__some-network">
<LineShareButton
url={shareUrl}
title={title}
className="Demo__some-network__share-button"
>
<LineIcon size={32} round />
</LineShareButton>
</div>
<div className="Demo__some-network">
<WeiboShareButton
url={shareUrl}
title={title}
image={`${String(window.location)}/${exampleImage}`}
className="Demo__some-network__share-button"
>
<WeiboIcon size={32} round />
</WeiboShareButton>
</div>
<div className="Demo__some-network">
<PocketShareButton
url={shareUrl}
title={title}
className="Demo__some-network__share-button"
>
<PocketIcon size={32} round />
</PocketShareButton>
</div>
<div className="Demo__some-network">
<InstapaperShareButton
url={shareUrl}
title={title}
className="Demo__some-network__share-button"
>
<InstapaperIcon size={32} round />
</InstapaperShareButton>
</div>
<div className="Demo__some-network">
<HatenaShareButton
url={shareUrl}
title={title}
windowWidth={660}
windowHeight={460}
className="Demo__some-network__share-button"
>
<HatenaIcon size={32} round />
</HatenaShareButton>
<div>
<HatenaShareCount url={shareUrl} className="Demo__some-network__share-count" />
</div>
</div>
</div>
);
}
}
export default Demo;