Skip to content

Commit

Permalink
Social Links: add Threads Icon (#52685)
Browse files Browse the repository at this point in the history
* Social Links: add Threads Icon

Fixes #52463

* Fix array alignment

* Update color following feedback

* Update svg

See #52685 (comment)

Co-authored-by: Joen A <[email protected]>

* Remove fill from the new svg

---------

Co-authored-by: Joen A <[email protected]>
Co-authored-by: Rich Tabor <[email protected]>
  • Loading branch information
3 people committed Jul 27, 2023
1 parent fa4f5a5 commit b0dbcf8
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/block-library/src/social-link/icons/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export * from './snapchat';
export * from './soundcloud';
export * from './spotify';
export * from './telegram';
export * from './threads';
export * from './tiktok';
export * from './tumblr';
export * from './twitch';
Expand Down
10 changes: 10 additions & 0 deletions packages/block-library/src/social-link/icons/threads.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* WordPress dependencies
*/
import { Path, SVG } from '@wordpress/primitives';

export const ThreadsIcon = () => (
<SVG width="24" height="24" viewBox="0 0 24 24" version="1.1">
<Path d="M16.3 11.3c-.1 0-.2-.1-.2-.1-.1-2.6-1.5-4-3.9-4-1.4 0-2.6.6-3.3 1.7l1.3.9c.5-.8 1.4-1 2-1 .8 0 1.4.2 1.7.7.3.3.5.8.5 1.3-.7-.1-1.4-.2-2.2-.1-2.2.1-3.7 1.4-3.6 3.2 0 .9.5 1.7 1.3 2.2.7.4 1.5.6 2.4.6 1.2-.1 2.1-.5 2.7-1.3.5-.6.8-1.4.9-2.4.6.3 1 .8 1.2 1.3.4.9.4 2.4-.8 3.6-1.1 1.1-2.3 1.5-4.3 1.5-2.1 0-3.8-.7-4.8-2S5.7 14.3 5.7 12c0-2.3.5-4.1 1.5-5.4 1.1-1.3 2.7-2 4.8-2 2.2 0 3.8.7 4.9 2 .5.7.9 1.5 1.2 2.5l1.5-.4c-.3-1.2-.8-2.2-1.5-3.1-1.3-1.7-3.3-2.6-6-2.6-2.6 0-4.7.9-6 2.6C4.9 7.2 4.3 9.3 4.3 12s.6 4.8 1.9 6.4c1.4 1.7 3.4 2.6 6 2.6 2.3 0 4-.6 5.3-2 1.8-1.8 1.7-4 1.1-5.4-.4-.9-1.2-1.7-2.3-2.3zm-4 3.8c-1 .1-2-.4-2-1.3 0-.7.5-1.5 2.1-1.6h.5c.6 0 1.1.1 1.6.2-.2 2.3-1.3 2.7-2.2 2.7z" />
</SVG>
);
4 changes: 4 additions & 0 deletions packages/block-library/src/social-link/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,10 @@ function block_core_social_link_services( $service = '', $field = '' ) {
'name' => 'Telegram',
'icon' => '<svg width="24" height="24" viewBox="0 0 128 128" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M28.9700376,63.3244248 C47.6273373,55.1957357 60.0684594,49.8368063 66.2934036,47.2476366 C84.0668845,39.855031 87.7600616,38.5708563 90.1672227,38.528 C90.6966555,38.5191258 91.8804274,38.6503351 92.6472251,39.2725385 C93.294694,39.7979149 93.4728387,40.5076237 93.5580865,41.0057381 C93.6433345,41.5038525 93.7494885,42.63857 93.6651041,43.5252052 C92.7019529,53.6451182 88.5344133,78.2034783 86.4142057,89.5379542 C85.5170662,94.3339958 83.750571,95.9420841 82.0403991,96.0994568 C78.3237996,96.4414641 75.5015827,93.6432685 71.9018743,91.2836143 C66.2690414,87.5912212 63.0868492,85.2926952 57.6192095,81.6896017 C51.3004058,77.5256038 55.3966232,75.2369981 58.9976911,71.4967761 C59.9401076,70.5179421 76.3155302,55.6232293 76.6324771,54.2720454 C76.6721165,54.1030573 76.7089039,53.4731496 76.3346867,53.1405352 C75.9604695,52.8079208 75.4081573,52.921662 75.0095933,53.0121213 C74.444641,53.1403447 65.4461175,59.0880351 48.0140228,70.8551922 C45.4598218,72.6091037 43.1463059,73.4636682 41.0734751,73.4188859 C38.7883453,73.3695169 34.3926725,72.1268388 31.1249416,71.0646282 C27.1169366,69.7617838 23.931454,69.0729605 24.208838,66.8603276 C24.3533167,65.7078514 25.9403832,64.5292172 28.9700376,63.3244248 Z" /></svg>',
),
'threads' => array(
'name' => 'Threads',
'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="M16.3 11.3c-.1 0-.2-.1-.2-.1-.1-2.6-1.5-4-3.9-4-1.4 0-2.6.6-3.3 1.7l1.3.9c.5-.8 1.4-1 2-1 .8 0 1.4.2 1.7.7.3.3.5.8.5 1.3-.7-.1-1.4-.2-2.2-.1-2.2.1-3.7 1.4-3.6 3.2 0 .9.5 1.7 1.3 2.2.7.4 1.5.6 2.4.6 1.2-.1 2.1-.5 2.7-1.3.5-.6.8-1.4.9-2.4.6.3 1 .8 1.2 1.3.4.9.4 2.4-.8 3.6-1.1 1.1-2.3 1.5-4.3 1.5-2.1 0-3.8-.7-4.8-2S5.7 14.3 5.7 12c0-2.3.5-4.1 1.5-5.4 1.1-1.3 2.7-2 4.8-2 2.2 0 3.8.7 4.9 2 .5.7.9 1.5 1.2 2.5l1.5-.4c-.3-1.2-.8-2.2-1.5-3.1-1.3-1.7-3.3-2.6-6-2.6-2.6 0-4.7.9-6 2.6C4.9 7.2 4.3 9.3 4.3 12s.6 4.8 1.9 6.4c1.4 1.7 3.4 2.6 6 2.6 2.3 0 4-.6 5.3-2 1.8-1.8 1.7-4 1.1-5.4-.4-.9-1.2-1.7-2.3-2.3zm-4 3.8c-1 .1-2-.4-2-1.3 0-.7.5-1.5 2.1-1.6h.5c.6 0 1.1.1 1.6.2-.2 2.3-1.3 2.7-2.2 2.7z"/></svg>',
),
'tiktok' => array(
'name' => 'TikTok',
'icon' => '<svg width="24" height="24" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false"><path d="M16.708 0.027c1.745-0.027 3.48-0.011 5.213-0.027 0.105 2.041 0.839 4.12 2.333 5.563 1.491 1.479 3.6 2.156 5.652 2.385v5.369c-1.923-0.063-3.855-0.463-5.6-1.291-0.76-0.344-1.468-0.787-2.161-1.24-0.009 3.896 0.016 7.787-0.025 11.667-0.104 1.864-0.719 3.719-1.803 5.255-1.744 2.557-4.771 4.224-7.88 4.276-1.907 0.109-3.812-0.411-5.437-1.369-2.693-1.588-4.588-4.495-4.864-7.615-0.032-0.667-0.043-1.333-0.016-1.984 0.24-2.537 1.495-4.964 3.443-6.615 2.208-1.923 5.301-2.839 8.197-2.297 0.027 1.975-0.052 3.948-0.052 5.923-1.323-0.428-2.869-0.308-4.025 0.495-0.844 0.547-1.485 1.385-1.819 2.333-0.276 0.676-0.197 1.427-0.181 2.145 0.317 2.188 2.421 4.027 4.667 3.828 1.489-0.016 2.916-0.88 3.692-2.145 0.251-0.443 0.532-0.896 0.547-1.417 0.131-2.385 0.079-4.76 0.095-7.145 0.011-5.375-0.016-10.735 0.025-16.093z" /></svg>',
Expand Down
5 changes: 5 additions & 0 deletions packages/block-library/src/social-link/socials-with-bg.scss
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@
color: #fff;
}

.wp-social-link-threads {
background-color: #000;
color: #fff;
}

.wp-social-link-tiktok {
background-color: #000;
color: #fff;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@
color: #2aabee;
}

.wp-social-link-threads {
color: #000;
}

.wp-social-link-tiktok {
color: #000;
}
Expand Down
7 changes: 7 additions & 0 deletions packages/block-library/src/social-link/variations.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import {
SoundCloudIcon,
SpotifyIcon,
TelegramIcon,
ThreadsIcon,
TiktokIcon,
TumblrIcon,
TwitchIcon,
Expand Down Expand Up @@ -255,6 +256,12 @@ const variations = [
title: 'Telegram',
icon: TelegramIcon,
},
{
name: 'threads',
attributes: { service: 'threads' },
title: 'Threads',
icon: ThreadsIcon,
},
{
name: 'tiktok',
attributes: { service: 'tiktok' },
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- wp:social-link-threads {"url":"https://example.com/"} /-->
11 changes: 11 additions & 0 deletions test/integration/fixtures/blocks/core__social-link-threads.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"name": "core/social-link",
"isValid": true,
"attributes": {
"url": "https://example.com/",
"service": "threads"
},
"innerBlocks": []
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"blockName": "core/social-link-threads",
"attrs": {
"url": "https://example.com/"
},
"innerBlocks": [],
"innerHTML": "",
"innerContent": []
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- wp:social-link {"url":"https://example.com/","service":"threads"} /-->

1 comment on commit b0dbcf8

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in b0dbcf8.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5680333081
📝 Reported issues:

Please sign in to comment.