Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more sharing networks #39353

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Publicize Components: Add more sharing networks.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { __ } from '@wordpress/i18n';

type Network = {
label: string;
networkName: 'x' | 'whatsapp' | 'facebook';
networkName: 'x' | 'whatsapp' | 'facebook' | 'linkedin' | 'tumblr' | 'pinterest' | 'mail';
url: string;
};

Expand All @@ -22,4 +22,24 @@ export const availableNetworks: Array< Network > = [
networkName: 'facebook',
url: 'https://www.facebook.com/sharer/sharer.php?u={{url}}',
},
{
label: __( 'Tumblr', 'jetpack' ),
networkName: 'tumblr',
url: 'https://www.tumblr.com/widgets/share/tool?canonicalUrl={{url}}&title={{text}}',
},
{
label: __( 'LinkedIn', 'jetpack' ),
networkName: 'linkedin',
url: 'https://www.linkedin.com/shareArticle?mini=true&url={{url}}&title={{text}}',
},
{
label: __( 'Pinterest', 'jetpack' ),
networkName: 'pinterest',
url: 'https://pinterest.com/pin/create/button/?url={{url}}&description={{text}}',
},
{
label: __( 'Email', 'jetpack' ),
networkName: 'mail',
url: 'mailto:?subject={{text}}&body={{url}}',
},
];
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
$whatsapp: #2ab318;

.share-buttons {
--color-x-lighten-20: #333;
--color-whatsapp-darken-20: #1f962d;
--color-facebook-darken-20: #003da1;
--color-tumblr-darken-20: #10151b;
--color-linkedin-darken-20: #043653;
--color-pinterest-darken-20: #741316;

display: flex;
flex-wrap: wrap;
gap: 0.7rem;
Expand Down Expand Up @@ -51,24 +56,83 @@ $whatsapp: #2ab318;
}
}

.x {
background-color: var(--jp-black);
}
:global(.components-button.is-primary) {
&.x {
background-color: var(--color-x);

.whatsapp {
background-color: $whatsapp;
}
&:hover {
background-color: var(--color-x-lighten-20);
}
}

.facebook {
background-color: var( --color-facebook );
// I hate !important, but social icon has it, so it needs to be overriden
border-radius: var(--jp-border-radius) !important;
}
&.whatsapp {
background-color: var(--color-whatsapp);

.clipboard {
background-color: #fff;
outline: 1px solid var(--jp-gray);
color: var(--jp-black);
&:hover {
background-color: var(--color-whatsapp-darken-20);
}
}

&.facebook {
background-color: var(--color-facebook);

&:hover {
background-color: var(--color-facebook-darken-20);
}
}

&.tumblr {
background-color: var(--color-tumblr);

&:hover {
background-color: var(--color-tumblr-darken-20);
}
}

&.linkedin {
background-color: var(--color-linkedin);

&:hover {
background-color: var(--color-linkedin-darken-20);
}
}

&.pinterest {
background-color: var(--color-pinterest);

&:hover {
background-color: var(--color-pinterest-darken-20);
}
}

&.mail,
&.clipboard {
&:not(:hover) {
outline: 1px solid var(--jp-gray);
color: var(--jp-black);
background-color: #fff;
}
}

&.mail {
svg {
fill: #fff;
}

svg path {
fill: #000;
}

&:hover {
svg {
fill: #000;
}

svg path {
fill: #fff;
}
}
}
}
}

Expand Down
Loading