Skip to content

Commit

Permalink
fix: add templateTagsRef to TemplateTags component
Browse files Browse the repository at this point in the history
  • Loading branch information
pauloiankoski committed Jan 9, 2024
1 parent e44f568 commit 51e2dba
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,16 @@ function CopyTagButton({textToCopy}) {
/**
* @unreleased
*/
export default function TemplateTags({templateTags}: {templateTags: TemplateTag[]}) {
export default function TemplateTags({
templateTags,
templateTagsRef,
}: {
templateTags: TemplateTag[];
templateTagsRef?: Ref<HTMLUListElement>;
}) {
return (
<ul className="givewp-template-tags__list">
{templateTags.map(({ id, description }) => {
<ul className="givewp-template-tags__list" ref={templateTagsRef}>
{templateTags.map(({id, description}) => {
const tagId = `{${id}}`;

return (
Expand All @@ -46,9 +52,7 @@ export default function TemplateTags({templateTags}: {templateTags: TemplateTag[
<CopyTagButton textToCopy={tagId} />
</div>
<div className="givewp-template-tags__list-item-bottom">
<span className="givewp-template-tags__description">
{description}
</span>
<span className="givewp-template-tags__description">{description}</span>
</div>
</li>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ export default function EmailTemplateOptions({notification, settings, setSetting
description={templateTagsDescription}
>
<PanelRow>
<TemplateTags templateTags={emailTemplateTags} />
<TemplateTags
templateTags={emailTemplateTags}
templateTagsRef={templateTagsRef}
/>
</PanelRow>
</SettingsSection>

Expand Down

0 comments on commit 51e2dba

Please sign in to comment.