Skip to content

Commit

Permalink
Merge pull request #1795 from tinacms/locate-gtm-error
Browse files Browse the repository at this point in the history
Locate gtm error
  • Loading branch information
joshbermanssw committed May 24, 2024
2 parents 145d0f0 + d934f6f commit f859e18
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions components/blocks/Actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ export const Actions = ({ items, align = 'left' }) => {
>
{items &&
items.map((item, index) => {
const id = sanitizeLabel(item.label);
if (item.variant == 'command') {
//const id = sanitizeLabel(item.label);
return (
<React.Fragment key={item.label}>
{index === 2 && <span className="or-text">or</span>} {}
<CodeButton
label={item.label}
id={sanitizeLabel(item.label)}
data-tina-field={tinaField(item, 'label')}
id={id}
>
{item.label}
</CodeButton>
Expand Down Expand Up @@ -122,7 +122,7 @@ export const Actions = ({ items, align = 'left' }) => {
)
}

export const CodeButton = ({ children, label, ...props }) => {
export const CodeButton = ({ children, label, id, ...props }) => {
const [copied, setCopied] = React.useState(false)

const clickEvent = () => {
Expand All @@ -133,14 +133,16 @@ export const CodeButton = ({ children, label, ...props }) => {
}, 2000)
}


return (
<>
<button
className="button event-cmd-button"
onClick={clickEvent}
id={id}
{...props}
>
<span className={`success-message ${copied ? `visible` : ``}`}>
<span id={id} className={`success-message ${copied ? `visible` : ``}`}>
Copied to clipboard!
</span>
<span className="text">
Expand Down

0 comments on commit f859e18

Please sign in to comment.