Skip to content

Commit

Permalink
Revert visual exp display
Browse files Browse the repository at this point in the history
  • Loading branch information
bttf committed Apr 4, 2023
1 parent 3fec8a6 commit ff7432c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 107 deletions.
104 changes: 0 additions & 104 deletions next-js/components/VisualExperimentsDisplay.tsx

This file was deleted.

19 changes: 18 additions & 1 deletion next-js/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,25 @@ import type { AppProps } from "next/app";
import { useRouter } from "next/router";
import { useEffect } from "react";
import { GrowthBook, GrowthBookProvider } from "@growthbook/growthbook-react";
import { Experiment, isURLTargeted, Result } from "@growthbook/growthbook";
import Head from "next/head";
import { onExperimentViewed } from "@/components/VisualExperimentsDisplay";

const onExperimentViewed = (
experiment: Experiment<any>,
result: Result<any>
) => {
const experimentId = experiment.key;
const variationId = result.key;

console.log("Viewed Experiment", {
experimentId,
variationId,
isURLTargeted: isURLTargeted(
window.location.href,
experiment.urlPatterns ?? []
),
});
};

// Create a client-side GrowthBook instance
const gb = new GrowthBook({
Expand Down
2 changes: 0 additions & 2 deletions next-js/pages/client.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import ComponentWithFeatures from "@/components/ComponentWithFeatures";
import VisualExperimentsDisplay from "@/components/VisualExperimentsDisplay";

export default function ClientPage() {
return (
Expand All @@ -11,7 +10,6 @@ export default function ClientPage() {
will get swapped in.
</p>
<ComponentWithFeatures />
<VisualExperimentsDisplay />
</div>
);
}

0 comments on commit ff7432c

Please sign in to comment.