Skip to content

Commit

Permalink
Merge branch 'ubiquity:development' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng authored Mar 28, 2024
2 parents dac1eab + ecb2187 commit 9c26568
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/home/authentication.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { trackDevRelReferral } from "./devrel-tracker";
import { getGitHubAccessToken } from "./getters/get-github-access-token";
import { getGitHubUser } from "./getters/get-github-user";
import { GitHubUser } from "./github-types";
Expand All @@ -12,6 +13,7 @@ export async function authentication() {

const gitHubUser: null | GitHubUser = await getGitHubUser();
if (gitHubUser) {
trackDevRelReferral(gitHubUser.login + "|" + gitHubUser.id);
displayGitHubUserInformation(gitHubUser);
}
}
22 changes: 22 additions & 0 deletions src/home/devrel-tracker.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export function initiateDevRelTracking() {
const oldDevRelCode = localStorage.getItem("devRel");
if (!oldDevRelCode) {
const urlParams = new URLSearchParams(window.location.search);
const devRelCode = urlParams.get("devRel");
if (devRelCode) {
localStorage.setItem("devRel", devRelCode);
}
}
}

export function trackDevRelReferral(devGithub: string) {
const devRelCode = localStorage.getItem("devRel");
if (devRelCode && devRelCode != "done") {
// @ts-expect-error : using global gtag
gtag("event", "ethSeoul_registration", {
devRel: devRelCode,
devGithub: devGithub,
});
localStorage.setItem("devRel", "done");
}
}
2 changes: 2 additions & 0 deletions src/home/home.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { grid } from "../the-grid";
import { authentication } from "./authentication";
import { initiateDevRelTracking } from "./devrel-tracker";
import { fetchAndDisplayPreviewsFromCache } from "./fetch-github/fetch-and-display-previews";
import { fetchIssuesFull } from "./fetch-github/fetch-issues-full";
import { readyToolbar } from "./ready-toolbar";
import { generateSortingToolbar } from "./sorting/generate-sorting-buttons";
import { TaskManager } from "./task-manager";

initiateDevRelTracking();
generateSortingToolbar();
renderServiceMessage();
grid(document.getElementById("grid") as HTMLElement, () => document.body.classList.add("grid-loaded")); // @DEV: display grid background
Expand Down
12 changes: 12 additions & 0 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@
<meta charset="UTF-8" />
<title>DevPool Directory | Ubiquity DAO</title>

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-VZLJ61H1YM"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());

gtag("config", "G-VZLJ61H1YM");
</script>

<link rel="stylesheet" href="style/style.css" />
<link rel="stylesheet" href="style/inverted-style.css" />
<link rel="stylesheet" href="style/special.css" />
Expand Down

0 comments on commit 9c26568

Please sign in to comment.