Skip to content

Commit

Permalink
Edit
Browse files Browse the repository at this point in the history
-YMClick
-layout (YM conf)
  • Loading branch information
seelentov committed Jul 14, 2024
1 parent 47265b8 commit e51062d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function RootLayout({
return (
<html lang="ru">
<body className={inter.className}>
<YMCore metrik_id={96723379} />
<YMCore metrik_id={97828066} />
<Header />
<main className="wrapper">
{children}
Expand Down
8 changes: 6 additions & 2 deletions src/components/YM/YMClick.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ export interface IYMClickProps extends HTMLAttributes<HTMLDivElement> {

export const YMClick: FC<IYMClickProps> = ({ metrik_id, name, child = "", type = 'link', link = "/", target = "", styleNest= "", ...rest }) => {

const enabled = false

const onclickString = `ym(${metrik_id},'reachGoal','${name}')`;

if(type === 'button'){
return (
<div {...rest} dangerouslySetInnerHTML={{
__html: /*html */`<button
style="width: 100%; height: 100%"
onclick="ym(${metrik_id},'reachGoal','${name}')">
onclick="${enabled ? onclickString : ""}">
${child}
</button>`}}>
</div>
Expand All @@ -30,7 +34,7 @@ export const YMClick: FC<IYMClickProps> = ({ metrik_id, name, child = "", type =
__html: /*html */`<a
href="${link}"
style="${styleNest}"
onclick="ym(${metrik_id},'reachGoal','${name}')" ${target ? 'target="' + target + '"' : ''}>
onclick="${enabled ? onclickString : ""}" ${target ? 'target="' + target + '"' : ''}>
${child}
</a>`}}>
</div>
Expand Down

0 comments on commit e51062d

Please sign in to comment.