Skip to content

Commit

Permalink
feat(sdk-analytics) comment lines in nextjs example
Browse files Browse the repository at this point in the history
  • Loading branch information
oidacra committed Dec 17, 2024
1 parent 3917d31 commit 516501d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 25 deletions.
4 changes: 3 additions & 1 deletion examples/nextjs/src/components/content-types/activity.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import Image from "next/image";
import Link from "next/link";

function Activity({ title, description, image, urlTitle }) {
// const { track } = useContentAnalytics(); // TODO: Uncomment this line to use Content Analytics

return (
<article className="p-4 overflow-hidden bg-white rounded shadow-lg">
{image && (
Expand All @@ -19,6 +20,7 @@ function Activity({ title, description, image, urlTitle }) {
</div>
<div className="px-6 pt-4 pb-2">
<Link
// onClick={() => track("btn-click", { title, urlTitle })} // TODO: Uncomment this line to use Content Analytics
href={`/activities/${urlTitle || "#"}`}
className="inline-block px-4 py-2 font-bold text-white bg-purple-500 rounded-full hover:bg-purple-700"
>
Expand Down
48 changes: 24 additions & 24 deletions examples/nextjs/src/components/my-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Navigation from "./layout/navigation";
import NotFound from "@/app/not-found";
import { usePageAsset } from "../hooks/usePageAsset";

import { DotContentAnalyticsProvider } from "@dotcms/analytics";
// import { DotContentAnalyticsProvider } from "@dotcms/analytics/react";

/**
* Configure experiment settings below. If you are not using experiments,
Expand Down Expand Up @@ -76,31 +76,31 @@ export function MyPage({ pageAsset, nav }) {
}

return (
<DotContentAnalyticsProvider config={analyticsConfig}>
<div className="flex flex-col gap-6 min-h-screen bg-lime-50">
{pageAsset?.layout.header && (
<Header>{!!nav && <Navigation items={nav} />}</Header>
)}
// <DotContentAnalyticsProvider config={analyticsConfig}>
<div className="flex flex-col gap-6 min-h-screen bg-lime-50">
{pageAsset?.layout.header && (
<Header>{!!nav && <Navigation items={nav} />}</Header>
)}

<main className="flex flex-col gap-8 m-auto">
<DotLayoutComponent
pageContext={{
pageAsset,
components: componentsMap,
}}
config={{
pathname,
editor: {
params: {
depth: 3,
},
<main className="flex flex-col gap-8 m-auto">
<DotLayoutComponent
pageContext={{
pageAsset,
components: componentsMap,
}}
config={{
pathname,
editor: {
params: {
depth: 3,
},
}}
/>
</main>
},
}}
/>
</main>

{pageAsset?.layout.footer && <Footer />}
</div>
</DotContentAnalyticsProvider>
{pageAsset?.layout.footer && <Footer />}
</div>
// </DotContentAnalyticsProvider>
);
}

0 comments on commit 516501d

Please sign in to comment.