-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #348 from Weaverse/paul
feat: add weaverse pixel
- Loading branch information
Showing
7 changed files
with
74 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@weaverse:registry=https://registry.npmjs.com | ||
progress=false | ||
node-linker=hoisted | ||
enable-pre-post-scripts=true | ||
enable-pre-post-scripts=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// create a pixel Component that will be used to track page views | ||
// /api/public/weaverse-pixel?projectId=xxx&pageId=xxx | ||
// The pixel will be removed from the DOM after it is loaded | ||
|
||
import type { FC } from 'react' | ||
import React from 'react' | ||
|
||
import type { WeaverseHydrogen } from './index' | ||
|
||
export interface PixelProps { | ||
baseUrl: string | ||
projectId: string | ||
pageId: string | ||
} | ||
|
||
export const Pixel: FC<PixelProps> = ({ baseUrl, projectId, pageId }) => { | ||
const url = `${baseUrl}/api/public/px?projectId=${projectId}&pageId=${pageId}` | ||
return <img src={url} alt="weaverse pixel" style={{ display: 'none' }} /> | ||
} | ||
|
||
export const WeaversePixel = ({ context }: { context: WeaverseHydrogen }) => { | ||
let { projectId, pageId, weaverseHost, isDesignMode } = context | ||
if (isDesignMode || !projectId || !pageId || !weaverseHost) return null | ||
return <Pixel baseUrl={weaverseHost} projectId={projectId} pageId={pageId} /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Submodule pilot
updated
9 files
+1 −5 | .eslintrc.js | |
+61 −22 | app/sections/header-image/header-image.tsx | |
+66 −0 | app/sections/shared/BackgroundImage.tsx | |
+0 −116 | app/sections/shared/Container.tsx | |
+43 −0 | app/sections/shared/Overlay.tsx | |
+159 −0 | app/sections/shared/Section.tsx | |
+32 −50 | app/sections/testimonials/index.tsx | |
+0 −0 | app/sections/testimonials/item.tsx | |
+2 −2 | app/weaverse/components.ts |