@automattic/social-previews
Version:
A suite of components to generate previews for a post for both social and search engines.
18 lines • 2.08 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TumblrPreviews = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const i18n_1 = require("@wordpress/i18n");
const section_heading_1 = require("../shared/section-heading");
const link_preview_1 = require("./link-preview");
const post_preview_1 = require("./post-preview");
const TumblrPreviews = ({ headingLevel, hideLinkPreview, hidePostPreview, ...props }) => {
const hasMedia = !!props.media?.length;
return ((0, jsx_runtime_1.jsxs)("div", { className: "social-preview tumblr-preview", children: [!hidePostPreview && ((0, jsx_runtime_1.jsxs)("section", { className: "social-preview__section tumblr-preview__section", children: [(0, jsx_runtime_1.jsx)(section_heading_1.SectionHeading, { level: headingLevel, children:
// translators: refers to a social post on Tumblr
(0, i18n_1.__)('Your post', 'social-previews') }), (0, jsx_runtime_1.jsx)("p", { className: "social-preview__section-desc", children: (0, i18n_1.__)('This is what your social post will look like on Tumblr:', 'social-previews') }), hasMedia ? (0, jsx_runtime_1.jsx)(post_preview_1.TumblrPostPreview, { ...props }) : (0, jsx_runtime_1.jsx)(link_preview_1.TumblrLinkPreview, { ...props })] })), !hideLinkPreview && ((0, jsx_runtime_1.jsxs)("section", { className: "social-preview__section tumblr-preview__section", children: [(0, jsx_runtime_1.jsx)(section_heading_1.SectionHeading, { level: headingLevel, children:
// translators: refers to a link on Tumblr
(0, i18n_1.__)('Link preview', 'social-previews') }), (0, jsx_runtime_1.jsx)("p", { className: "social-preview__section-desc", children: (0, i18n_1.__)('This is what it will look like when someone shares the link to your WordPress post on Tumblr.', 'social-previews') }), (0, jsx_runtime_1.jsx)(link_preview_1.TumblrLinkPreview, { ...props, user: undefined })] }))] }));
};
exports.TumblrPreviews = TumblrPreviews;
//# sourceMappingURL=previews.js.map