Skip to content

Commit

Permalink
Make link block and element more general
Browse files Browse the repository at this point in the history
  • Loading branch information
wellyshen committed Oct 19, 2024
1 parent 2cf81f3 commit 24a4c7d
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/block/blocks/link/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export default function Edit( { attributes }: BlockEditProps< Attrs > ) {
target="_blank"
>
<span>{ text }</span>
<span>&#8594;</span>
</a>
);
}
2 changes: 1 addition & 1 deletion src/block/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ export default function Edit( { attributes, setAttributes, clientId }: BlockEdit
getBlockTempate( BlockNames.LINK, KnownElemNames.VIEW_PROFILE, {
className: 'gravatar-block-link--align-right',
linkUrl: profile_url,
text: __( 'View profile', 'gravatar-enhanced' ),
text: __( 'View profile', 'gravatar-enhanced' ),
} );

return [
Expand Down
1 change: 0 additions & 1 deletion src/block/elements/get-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export default function getLink( { linkUrl, text, className }: Props ): string {
target="_blank"
>
<span>${ text }</span>
<span>&#8594;</span>
</a>
`;
}
3 changes: 0 additions & 3 deletions src/block/shared.scss
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ div.wp-block-gravatar-block.gravatar-block {
}

.gravatar-block-link {
display: flex;
align-items: center;
gap: 4px;
color: $color-gray;

&.gravatar-block-link--align-right {
Expand Down
2 changes: 1 addition & 1 deletion src/block/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ document.addEventListener( 'DOMContentLoaded', () => {
getElement( BlockNames.LINK, KnownElemNames.VIEW_PROFILE, {
className: 'gravatar-block-link--align-right',
linkUrl: profile_url,
text: __( 'View profile', 'gravatar-enhanced' ),
text: __( 'View profile', 'gravatar-enhanced' ),
} );

return `
Expand Down

0 comments on commit 24a4c7d

Please sign in to comment.