diff --git a/packages/social-previews/src/linkedin-preview/link-preview.tsx b/packages/social-previews/src/linkedin-preview/link-preview.tsx index 28dbff22393d2f..b298abad53436c 100644 --- a/packages/social-previews/src/linkedin-preview/link-preview.tsx +++ b/packages/social-previews/src/linkedin-preview/link-preview.tsx @@ -1,8 +1,7 @@ -import { DEFAULT_PROPS } from './constants'; import { LinkedInPostPreview } from './post-preview'; import { LinkedInPreviewProps } from './types'; -type OptionalProps = Partial< typeof DEFAULT_PROPS >; +type OptionalProps = Partial< Pick< LinkedInPreviewProps, 'name' | 'profileImage' > >; export type LinkedInLinkPreviewProps = Omit< LinkedInPreviewProps, keyof OptionalProps > & OptionalProps; @@ -10,7 +9,8 @@ export type LinkedInLinkPreviewProps = Omit< LinkedInPreviewProps, keyof Optiona export function LinkedInLinkPreview( props: LinkedInLinkPreviewProps ) { return (
- + { profileImage ? : }
-
{ name }
+
+ { name || __( 'Account Name', 'social-previews' ) } +
{ diff --git a/packages/social-previews/src/linkedin-preview/previews.tsx b/packages/social-previews/src/linkedin-preview/previews.tsx index 98cc5806167b96..9141c0cf7bb660 100644 --- a/packages/social-previews/src/linkedin-preview/previews.tsx +++ b/packages/social-previews/src/linkedin-preview/previews.tsx @@ -1,7 +1,6 @@ import { ExternalLink } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; import SectionHeading from '../shared/section-heading'; -import { DEFAULT_PROPS } from './constants'; import { LinkedInLinkPreview } from './link-preview'; import { LinkedInPostPreview } from './post-preview'; import type { LinkedInPreviewsProps } from './types'; @@ -46,7 +45,7 @@ export const LinkedInPreviews: React.FC< LinkedInPreviewsProps > = ( { { __( 'Learn more about links', 'social-previews' ) }

- + ) }
diff --git a/packages/social-previews/src/linkedin-preview/style.scss b/packages/social-previews/src/linkedin-preview/style.scss index 07b2313d7f1d49..cfb4475d4261b9 100644 --- a/packages/social-previews/src/linkedin-preview/style.scss +++ b/packages/social-previews/src/linkedin-preview/style.scss @@ -38,13 +38,18 @@ margin-bottom: 0.8rem; &--avatar { + width: 48px; + height: 48px; + border-radius: 50%; + overflow: hidden; + display: flex; + align-items: center; flex-shrink: 0; } &--avatar img { - width: 48px; - height: 48px; - border-radius: 50%; + width: 100%; + object-fit: contain; } &--profile {