Skip to content

Commit 37b162b

Browse files
authored
Merge pull request #19 from Bunlong/v0.5.0
LiveJournal Share Button and Icon
2 parents 928120f + 016fb88 commit 37b162b

File tree

6 files changed

+129
-1
lines changed

6 files changed

+129
-1
lines changed

README.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Social media share buttons for your next React apps.
2323
* Whatsapp
2424
* Linkedin
2525
* VKShare
26+
* Livejournal
2627

2728
## 🔧 Install
2829

@@ -234,6 +235,23 @@ import {
234235
</VKShareButton>
235236
```
236237

238+
### 🎀 Livejournal
239+
240+
```js
241+
import {
242+
LivejournalShareButton,
243+
LivejournalIcon,
244+
} from 'next-share'
245+
246+
<LivejournalShareButton
247+
url={'https://github.com/next-share'}
248+
title={'Next Share'}
249+
description={'https://github.com/next-share'}
250+
>
251+
<LivejournalIcon size={32} round />
252+
</LivejournalShareButton>
253+
```
254+
237255
## 📚 Icons Documentation
238256

239257
### 📖 Icons Props
@@ -961,6 +979,60 @@ import {
961979
</tr>
962980
</table>
963981

982+
### 📖 LivejournalShareButton Props
983+
984+
<table>
985+
<tr>
986+
<th>Props</th>
987+
<th>Type</th>
988+
<th>Default</th>
989+
<th>Description</th>
990+
<th>Required</th>
991+
</tr>
992+
<tr>
993+
<td>children</td>
994+
<td>React node</td>
995+
<td></td>
996+
<td>React component, HTML element or string.</td>
997+
<td>✅</td>
998+
</tr>
999+
<tr>
1000+
<td>url</td>
1001+
<td>string</td>
1002+
<td></td>
1003+
<td>The URL of the shared page.</td>
1004+
<td>✅</td>
1005+
</tr>
1006+
<tr>
1007+
<td>title</td>
1008+
<td>string</td>
1009+
<td></td>
1010+
<td>The title of the shared page.</td>
1011+
<td>❌</td>
1012+
</tr>
1013+
<tr>
1014+
<td>description</td>
1015+
<td>string</td>
1016+
<td></td>
1017+
<td>Description of the shared page.</td>
1018+
<td>❌</td>
1019+
</tr>
1020+
<tr>
1021+
<td>windowWidth</td>
1022+
<td>number</td>
1023+
<td>550</td>
1024+
<td>Opened window width.</td>
1025+
<td>❌</td>
1026+
</tr>
1027+
<tr>
1028+
<td>windowHeight</td>
1029+
<td>number</td>
1030+
<td>400</td>
1031+
<td>Opened window height.</td>
1032+
<td>❌</td>
1033+
</tr>
1034+
</table>
1035+
9641036
## 💖 Wrap Up
9651037

9661038
If you think any of the `next-share` can be improved, please do open a PR with any updates and submit any issues. Also, I will continue to improve this, so you might want to watch/star this repository to revisit.

examples/javascript/src/App.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ import {
2626
VKIcon,
2727
MailruShareButton,
2828
MailruIcon,
29+
LivejournalShareButton,
30+
LivejournalIcon,
2931
} from 'next-share'
3032

3133
function App() {
@@ -142,6 +144,15 @@ function App() {
142144
<MailruIcon size={32} round />
143145
</div>
144146
</MailruShareButton>
147+
<LivejournalShareButton
148+
url={'https://github.com/next-share'}
149+
title={'Next Share'}
150+
description={'https://github.com/next-share'}
151+
>
152+
<div style={{marginRight: 10, width: 32, height: 32}}>
153+
<LivejournalIcon size={32} round />
154+
</div>
155+
</LivejournalShareButton>
145156
</div>
146157
)
147158
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "next-share",
3-
"version": "0.4.0",
3+
"version": "0.5.0",
44
"description": "Social media share buttons for your next React apps.",
55
"author": "Bunlong <[email protected]>",
66
"license": "MIT",
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import transformObjectToParams from '../../utils';
2+
import createShareButton from '../../hocs/createShareButton';
3+
4+
function livejournalLink(
5+
_url: string,
6+
{ title, description }: { title?: string; description?: string },
7+
) {
8+
return (
9+
'https://www.livejournal.com/update.bml' +
10+
transformObjectToParams({
11+
subject: title,
12+
event: description,
13+
})
14+
);
15+
}
16+
17+
const LivejournalShareButton = createShareButton<{
18+
title?: string;
19+
description?: string;
20+
}>(
21+
'livejournal',
22+
livejournalLink,
23+
(props) => ({
24+
title: props.title,
25+
description: props.description,
26+
}),
27+
{
28+
windowWidth: 660,
29+
windowHeight: 460,
30+
},
31+
);
32+
33+
export default LivejournalShareButton;

src/icons/LivejournalIcon.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import createIcon from '../hocs/createIcon';
2+
3+
const LivejournalIcon = createIcon({
4+
color: '#21A5D8',
5+
name: 'livejournal',
6+
path:
7+
'M18.3407821,28.1764706 L21.9441341,31.789916 L33.0055865,42.882353 C33.0055865,42.882353 33.0893855,42.9663866 33.0893855,42.9663866 L46.6648046,47 C46.6648046,47 46.6648046,47 46.7486034,47 C46.8324022,47 46.8324022,47 46.9162012,46.9159664 C47,46.8319327 47,46.8319327 47,46.7478991 L42.9776536,33.1344537 C42.9776536,33.1344537 42.9776536,33.1344537 42.8938548,33.0504202 L31.1620111,21.3697479 L31.1620111,21.3697479 L28.1452514,18.2605042 C27.3072626,17.4201681 26.5530726,17 25.7150838,17 C24.2905028,17 23.0335195,18.3445378 21.5251397,19.8571429 C21.273743,20.1092437 20.9385475,20.4453781 20.6871508,20.697479 C20.3519553,21.0336134 20.1005586,21.2857143 19.849162,21.5378151 C18.3407821,22.9663866 17.0837989,24.2268908 17,25.7394958 C17.0837989,26.4957983 17.5027933,27.3361345 18.3407821,28.1764706 Z M39.9012319,39.6134454 C39.7336341,39.4453781 39.4822374,37.6806724 40.2364275,36.8403362 C40.9906174,36.0840337 41.6610084,36 42.1638017,36 C42.3313995,36 42.4989973,36 42.5827961,36 L44.8453659,43.5630253 L43.5883828,44.8235295 L36.0464833,42.5546218 C35.9626843,42.2184874 35.8788855,41.2100841 36.8844722,40.2016807 C37.2196676,39.8655463 37.8900587,39.6134454 38.5604498,39.6134454 C39.147042,39.6134454 39.5660364,39.7815126 39.5660364,39.7815126 C39.6498353,39.8655463 39.8174331,39.8655463 39.8174331,39.7815126 C39.9850307,39.7815126 39.9850307,39.697479 39.9012319,39.6134454 Z',
8+
});
9+
10+
export default LivejournalIcon;

src/next-share.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export { default as WhatsappIcon } from './icons/WhatsappIcon';
1212
export { default as LinkedinIcon } from './icons/LinkedinIcon';
1313
export { default as VKIcon } from './icons/VKIcon';
1414
export { default as MailruIcon } from './icons/MailruIcon';
15+
export { default as LivejournalIcon } from './icons/LivejournalIcon';
1516

1617
// Buttons
1718
export { default as FacebookShareButton } from './components/buttons/FacebookShareButton';
@@ -27,3 +28,4 @@ export { default as WhatsappShareButton } from './components/buttons/WhatsappSha
2728
export { default as LinkedinShareButton } from './components/buttons/LinkedinShareButton';
2829
export { default as VKShareButton } from './components/buttons/VKShareButton';
2930
export { default as MailruShareButton } from './components/buttons/MailruShareButton';
31+
export { default as LivejournalShareButton } from './components/buttons/LivejournalShareButton';

0 commit comments

Comments
 (0)