Skip to content

Commit 9217a1c

Browse files
Added discord in social links.
1 parent 0d35e9f commit 9217a1c

12 files changed

+59
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* WordPress dependencies
3+
*/
4+
import { Path, SVG } from '@wordpress/primitives';
5+
6+
export const DiscordIcon = () => (
7+
<SVG width="24" height="24" viewBox="0 0 24 24">
8+
<Path d="M20.317 4.369A19.88 19.88 0 0 0 15.894 3a14.145 14.145 0 0 0-.719 1.518 19.205 19.205 0 0 0-5.351 0A14.183 14.183 0 0 0 9.104 3 19.896 19.896 0 0 0 4.682 4.369a18.921 18.921 0 0 0-3.012 12.52 19.929 19.929 0 0 0 6.081 3.097c.487-.65.922-1.339 1.3-2.061a12.445 12.445 0 0 1-1.958-.896c.165-.12.326-.246.483-.374a12.445 12.445 0 0 0 8.946 0c.157.128.318.253.483.374-.627.371-1.281.683-1.958.896.379.722.813 1.41 1.3 2.061a19.94 19.94 0 0 0 6.081-3.097 18.921 18.921 0 0 0-3.012-12.52ZM8.12 15.233c-1.202 0-2.184-1.09-2.184-2.431 0-1.34.97-2.431 2.184-2.431 1.213 0 2.202 1.09 2.184 2.431 0 1.341-.97 2.431-2.184 2.431Zm7.757 0c-1.202 0-2.184-1.09-2.184-2.431 0-1.34.97-2.431 2.184-2.431 1.213 0 2.202 1.09 2.184 2.431 0 1.341-.97 2.431-2.184 2.431Z" />
9+
</SVG>
10+
);

packages/block-library/src/social-link/icons/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export * from './bluesky';
55
export * from './chain';
66
export * from './codepen';
77
export * from './deviantart';
8+
export * from './discord';
89
export * from './dribbble';
910
export * from './dropbox';
1011
export * from './etsy';

packages/block-library/src/social-link/index.php

+4
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ function block_core_social_link_services( $service = '', $field = '' ) {
169169
'name' => 'DeviantArt',
170170
'icon' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M 18.19 5.636 18.19 2 18.188 2 14.553 2 14.19 2.366 12.474 5.636 11.935 6 5.81 6 5.81 10.994 9.177 10.994 9.477 11.357 5.81 18.363 5.81 22 5.811 22 9.447 22 9.81 21.634 11.526 18.364 12.065 18 18.19 18 18.19 13.006 14.823 13.006 14.523 12.641 18.19 5.636z"></path></svg>',
171171
),
172+
'discord' => array(
173+
'name' => 'Discord',
174+
'icon' => '<svg width="24" height="24" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M20.317 4.369A19.88 19.88 0 0 0 15.894 3a14.145 14.145 0 0 0-.719 1.518 19.205 19.205 0 0 0-5.351 0A14.183 14.183 0 0 0 9.104 3 19.896 19.896 0 0 0 4.682 4.369a18.921 18.921 0 0 0-3.012 12.52 19.929 19.929 0 0 0 6.081 3.097c.487-.65.922-1.339 1.3-2.061a12.445 12.445 0 0 1-1.958-.896c.165-.12.326-.246.483-.374a12.445 12.445 0 0 0 8.946 0c.157.128.318.253.483.374-.627.371-1.281.683-1.958.896.379.722.813 1.41 1.3 2.061a19.94 19.94 0 0 0 6.081-3.097 18.921 18.921 0 0 0-3.012-12.52ZM8.12 15.233c-1.202 0-2.184-1.09-2.184-2.431 0-1.34.97-2.431 2.184-2.431 1.213 0 2.202 1.09 2.184 2.431 0 1.341-.97 2.431-2.184 2.431Zm7.757 0c-1.202 0-2.184-1.09-2.184-2.431 0-1.34.97-2.431 2.184-2.431 1.213 0 2.202 1.09 2.184 2.431 0 1.341-.97 2.431-2.184 2.431Z"/></svg>',
175+
),
172176
'dribbble' => array(
173177
'name' => 'Dribbble',
174178
'icon' => '<svg width="24" height="24" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M12,22C6.486,22,2,17.514,2,12S6.486,2,12,2c5.514,0,10,4.486,10,10S17.514,22,12,22z M20.434,13.369 c-0.292-0.092-2.644-0.794-5.32-0.365c1.117,3.07,1.572,5.57,1.659,6.09C18.689,17.798,20.053,15.745,20.434,13.369z M15.336,19.876c-0.127-0.749-0.623-3.361-1.822-6.477c-0.019,0.006-0.038,0.013-0.056,0.019c-4.818,1.679-6.547,5.02-6.701,5.334 c1.448,1.129,3.268,1.803,5.243,1.803C13.183,20.555,14.311,20.313,15.336,19.876z M5.654,17.724 c0.193-0.331,2.538-4.213,6.943-5.637c0.111-0.036,0.224-0.07,0.337-0.102c-0.214-0.485-0.448-0.971-0.692-1.45 c-4.266,1.277-8.405,1.223-8.778,1.216c-0.003,0.087-0.004,0.174-0.004,0.261C3.458,14.207,4.29,16.21,5.654,17.724z M3.639,10.264 c0.382,0.005,3.901,0.02,7.897-1.041c-1.415-2.516-2.942-4.631-3.167-4.94C5.979,5.41,4.193,7.613,3.639,10.264z M9.998,3.709 c0.236,0.316,1.787,2.429,3.187,5c3.037-1.138,4.323-2.867,4.477-3.085C16.154,4.286,14.17,3.471,12,3.471 C11.311,3.471,10.641,3.554,9.998,3.709z M18.612,6.612C18.432,6.855,17,8.69,13.842,9.979c0.199,0.407,0.389,0.821,0.567,1.237 c0.063,0.148,0.124,0.295,0.184,0.441c2.842-0.357,5.666,0.215,5.948,0.275C20.522,9.916,19.801,8.065,18.612,6.612z"></path></svg>',

packages/block-library/src/social-link/socials-with-bg.scss

+5
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
color: #fff;
3434
}
3535

36+
.wp-social-link-discord {
37+
background-color: #5865f2;
38+
color: #fff;
39+
}
40+
3641
.wp-social-link-dribbble {
3742
background-color: #e94c89;
3843
color: #fff;

packages/block-library/src/social-link/socials-without-bg.scss

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
color: #02e49b;
2323
}
2424

25+
.wp-social-link-discord {
26+
color: #5865f2;
27+
}
28+
2529
.wp-social-link-dribbble {
2630
color: #e94c89;
2731
}

packages/block-library/src/social-link/variations.js

+7
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
ChainIcon,
1010
CodepenIcon,
1111
DeviantArtIcon,
12+
DiscordIcon,
1213
DribbbleIcon,
1314
DropboxIcon,
1415
EtsyIcon,
@@ -108,6 +109,12 @@ const variations = [
108109
title: 'DeviantArt',
109110
icon: DeviantArtIcon,
110111
},
112+
{
113+
name: 'discord',
114+
attributes: { service: 'discord' },
115+
title: 'Discord',
116+
icon: DiscordIcon,
117+
},
111118
{
112119
name: 'dribbble',
113120
attributes: { service: 'dribbble' },

test/integration/fixtures/blocks/core__separator-color.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"isValid": true,
55
"attributes": {
66
"opacity": "alpha-channel",
7-
"backgroundColor": "accent",
8-
"tagName": "hr"
7+
"tagName": "hr",
8+
"backgroundColor": "accent"
99
},
1010
"innerBlocks": []
1111
}

test/integration/fixtures/blocks/core__separator-custom-color.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
"isValid": true,
55
"attributes": {
66
"opacity": "alpha-channel",
7+
"tagName": "hr",
78
"style": {
89
"color": {
910
"background": "#5da54c"
1011
}
11-
},
12-
"tagName": "hr"
12+
}
1313
},
1414
"innerBlocks": []
1515
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!-- wp:social-link-discord {"url":"https://example.com/"} /-->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[
2+
{
3+
"name": "core/social-link",
4+
"isValid": true,
5+
"attributes": {
6+
"url": "https://example.com/",
7+
"service": "discord"
8+
},
9+
"innerBlocks": []
10+
}
11+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[
2+
{
3+
"blockName": "core/social-link-discord",
4+
"attrs": {
5+
"url": "https://example.com/"
6+
},
7+
"innerBlocks": [],
8+
"innerHTML": "",
9+
"innerContent": []
10+
}
11+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!-- wp:social-link {"url":"https://example.com/","service":"discord"} /-->

0 commit comments

Comments
 (0)