• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / wordpress-seo / 968e1951319a69b551587c91336c23b536bcefce

28 Mar 2024 08:42AM UTC coverage: 53.779%. First build
968e1951319a69b551587c91336c23b536bcefce

push

github

igorschoester
Merge branch 'trunk' of github.com:Yoast/wordpress-seo into feature/woo-new-editor

# Conflicts:
#	config/webpack/webpack.config.base.js

7588 of 13915 branches covered (54.53%)

Branch coverage included in aggregate %.

31 of 47 new or added lines in 18 files covered. (65.96%)

29666 of 55358 relevant lines covered (53.59%)

40476.52 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/packages/js/src/components/social/SocialUpsell.js
1
/* global wpseoAdminL10n */
2
import PropTypes from "prop-types";
3
import { __, sprintf } from "@wordpress/i18n";
4
import { noop } from "lodash";
5
import { FeatureUpsell, Label, Root, useRootContext } from "@yoast/ui-library";
6
import styled from "styled-components";
7
import { addQueryArgs } from "@wordpress/url";
8
import { FacebookPreview } from "../../../../social-metadata-previews/src";
9

10
const FeatureUpsellContainer = styled.div`
×
11
        max-width: calc(527px + 1.5rem);
12
`;
13

14
/**
15
 *
16
 * @param {Object} props The properties passed to this component.
17
 * @param {string} props.socialMediumName The social medium platform.
18
 *
19
 * @returns {wp.Element} The FacebookView Component.
20
 */
21
const SocialUpsell = ( props ) => {
×
22
        const premiumUpsellConfig = {
×
23
                "data-action": "load-nfd-ctb",
24
                "data-ctb-id": "f6a84663-465f-4cb5-8ba5-f7a6d72224b2",
25
        };
26

NEW
27
        const labelText = props.socialMediumName === "X"
×
28
                ? __( "X share preview", "wordpress-seo" )
29
                : __( "Social share preview", "wordpress-seo" );
30

31
        const { locationContext } = useRootContext();
×
32

33
        return (
×
34
                <Root>
35
                        <FeatureUpsellContainer>
36
                                <FeatureUpsell
37
                                        shouldUpsell={ true }
38
                                        variant="card"
39
                                        cardLink={ addQueryArgs(
40
                                                wpseoAdminL10n[ "shortlinks.upsell.social_preview." + props.socialMediumName.toLowerCase() ],
41
                                                { context: locationContext } ) }
42
                                        cardText={ sprintf(
43
                                                /* translators: %1$s expands to Yoast SEO Premium. */
44
                                                __( "Unlock with %1$s", "wordpress-seo" ),
45
                                                "Yoast SEO Premium"
46
                                        ) }
47
                                        { ...premiumUpsellConfig }
48
                                >
49
                                        <div className={ "yst-grayscale yst-opacity-50" }>
50
                                                <Label>
51
                                                        { labelText }
52
                                                </Label>
53

54
                                                <FacebookPreview
55
                                                        title={ "" }
56
                                                        description={ "" }
57
                                                        siteUrl={ "" }
58
                                                        imageUrl={ "" }
59
                                                        imageFallbackUrl={ "" }
60
                                                        alt={ "" }
61
                                                        onSelect={ noop }
62
                                                        onImageClick={ noop }
63
                                                        onMouseHover={ noop }
64
                                                />
65
                                        </div>
66
                                </FeatureUpsell>
67
                        </FeatureUpsellContainer>
68
                </Root>
69
        );
70
};
71

72
SocialUpsell.propTypes = {
×
73
        socialMediumName: PropTypes.oneOf( [ "Social", "Twitter", "X" ] ).isRequired,
74
};
75

76
export default SocialUpsell;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc