Skip to content

Commit 59d29ca

Browse files
authored
Merge pull request #195 from tablelandnetwork/remove-configcat
Remove ConfigCat and Amplitude integrations
2 parents 4d68bb1 + b2a9fa3 commit 59d29ca

16 files changed

Lines changed: 30 additions & 507 deletions

File tree

.env.example

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
CONFIGCAT_API_KEY=
2-
AMPLITUDE_API_KEY=
31
NEXT_PUBLIC_FATHOM_ID=

.github/workflows/review.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,13 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout 🛎️
17-
uses: actions/checkout@v2.3.1
18-
with:
19-
persist-credentials: false
17+
uses: actions/checkout@v4
2018

21-
- name: Cache 📦
22-
uses: actions/cache@v1
23-
with:
24-
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
25-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
26-
restore-keys: |
27-
${{ runner.os }}-build-${{ env.cache-name }}-
28-
${{ runner.os }}-build-
29-
${{ runner.os }}-
3019
- name: Setup Node Environment ⬢
31-
uses: actions/setup-node@v1
20+
uses: actions/setup-node@v4
3221
with:
33-
node-version: 16
22+
node-version: 20
23+
cache: 'npm'
3424

3525
- name: Install 🔧
3626
run: npm install

app/api/events/route.ts

Lines changed: 0 additions & 19 deletions
This file was deleted.

app/components/EventLink.tsx

Lines changed: 9 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
"use client"
22

33
import Link from "next/link"
4-
import { type ReactNode, useEffect, useContext } from "react"
5-
import { type Event } from "@/lib/types"
4+
import { type ReactNode, useEffect } from "react"
65
import va from "@vercel/analytics"
7-
import { VariantContext } from "../context/VariantProvider"
86

97
type Props = {
108
children: ReactNode
@@ -17,29 +15,11 @@ type Props = {
1715
onClick?: () => void
1816
}
1917

20-
async function logEvent(event: Event): Promise<void> {
21-
// Log vercel
22-
event.params = event.params || {}
23-
if (event.variantIds) {
24-
event.variantIds.forEach((id) => {
25-
event.params![id.substring(0, id.length - 1)] = id.slice(-1)
26-
})
27-
}
28-
va.track(
29-
event.name,
30-
Object.keys(event.params).length > 0 ? event.params : undefined
31-
)
32-
33-
// Log amplitude
34-
if (event.userId && event.variantIds) {
35-
fetch("/api/events", {
36-
method: "POST",
37-
headers: {
38-
"Content-Type": "application/json",
39-
},
40-
body: JSON.stringify(event),
41-
})
42-
}
18+
async function logEvent(
19+
name: string,
20+
params?: Record<string, string | number | boolean | null>
21+
): Promise<void> {
22+
va.track(name, params && Object.keys(params).length > 0 ? params : undefined)
4323
}
4424

4525
export default function EventLink({
@@ -52,36 +32,20 @@ export default function EventLink({
5232
className,
5333
onClick,
5434
}: Props) {
55-
const variantCtx = useContext(VariantContext)
56-
5735
useEffect(() => {
58-
async function log() {
59-
await logEvent({
60-
name: event + " Viewed",
61-
params,
62-
userId: variantCtx.userId,
63-
variantIds: variantCtx.ids,
64-
})
65-
}
6636
if (event && logView) {
67-
// The timeout puts this in the back of the event queue, giving vercel analytics time to load.
6837
setTimeout(() => {
69-
log()
38+
logEvent(event + " Viewed", params)
7039
}, 0)
7140
}
72-
}, [variantCtx, event, params, logView])
41+
}, [event, params, logView])
7342

7443
const handleClick = async () => {
7544
if (onClick) {
7645
onClick()
7746
}
7847
if (event) {
79-
await logEvent({
80-
name: event + " Clicked",
81-
params,
82-
userId: variantCtx.userId,
83-
variantIds: variantCtx.ids,
84-
})
48+
await logEvent(event + " Clicked", params)
8549
}
8650
}
8751

app/components/Features.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import EventLink from "./EventLink"
2-
import { getFeatures } from "@/lib/variants"
3-
import { getUserId } from "@/lib/users"
42
import items from "@/lib/features"
5-
import { Features } from "@/lib/types"
6-
7-
export default async function Features() {
8-
const content = await getFeatures(getUserId())
93

4+
export default function Features() {
105
return (
116
<section
127
id="features"
@@ -15,7 +10,7 @@ export default async function Features() {
1510
<div className="w-full h-[18px] bg-white opacity-[0.15]"></div>
1611
<div className="container mx-auto px-6 md:px-9 lg:px-16 xl:px-20 py-12 md:py-24 lg:py-36">
1712
<h1 className="w-full text-xl lg:text-2xl mb-6 lg:mb-10">
18-
{content.title}
13+
Build on decentralized data without the headache.
1914
</h1>
2015
<div className="w-full grid gap-4 lg:gap-10 grid-cols-1 md:grid-cols-2 lg:grid-cols-4">
2116
{items.map(function (f, i) {

app/components/Hero.tsx

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,24 @@
11
import ButtonLink from "./ButtonLink"
22
import Terminal from "./Terminal"
3-
import { getHero } from "@/lib/variants"
4-
import { getUserId } from "@/lib/users"
5-
import { type Hero } from "@/lib/types"
6-
7-
export default async function Hero() {
8-
const content = await getHero(getUserId())
93

4+
export default function Hero() {
105
return (
116
<div className="bg-lightpurple">
127
<section className="w-full bg-top bg-cover bg-no-repeat bg-lightpurple md:bg-[url('/img/home/hero.jpg')]">
138
<div className="relative container mx-auto px-6 md:px-9 lg:px-16 xl:px-20 pt-24 md:pt-32 lg:pt-48 pb-12 md:pb-24 lg:pb-36">
149
<article className="mx-auto md:mx-[initial] prose prose-normal prose-sm md:prose-md lg:prose-lg max-w-prose font-light text-center md:text-left">
1510
<h3 className="text-grey uppercase font-normal !mb-0">
16-
<span
17-
dangerouslySetInnerHTML={{
18-
__html: content.tag,
19-
}}
20-
/>
11+
Read+write from <span className="font-bold">anywhere</span>
2112
</h3>
2213
<h1 className="font-normal">
23-
<span
24-
dangerouslySetInnerHTML={{
25-
__html: content.title,
26-
}}
27-
/>
14+
The <span className="font-bold">decentralized</span> cloud
15+
database.
2816
</h1>
2917
<Terminal />
3018
<p className="lead">
31-
<span
32-
dangerouslySetInnerHTML={{
33-
__html: content.lead,
34-
}}
35-
/>
19+
Tableland is an open source, permissionless cloud database built
20+
on SQLite. Read and write tamperproof data from apps, data
21+
pipelines, or EVM smart contracts.
3622
</p>
3723
<p>
3824
<ButtonLink
@@ -43,7 +29,7 @@ export default async function Hero() {
4329
logView={true}
4430
className="bg-darkgreen"
4531
>
46-
{content.cta}
32+
Enter Studio
4733
</ButtonLink>
4834
</p>
4935
</article>

app/context/VariantProvider.tsx

Lines changed: 0 additions & 17 deletions
This file was deleted.

app/layout.tsx

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import FooterNav from "./components/FooterNav"
77
import Fathom from "./components/Fathom"
88
import { Analytics } from "@vercel/analytics/react"
99
import { SpeedInsights } from "@vercel/speed-insights/next"
10-
import VariantProvider from "./context/VariantProvider"
11-
import { getContext } from "@/lib/variants"
1210

1311
const title = "Tableland: The decentralized cloud database"
1412
const description =
@@ -49,23 +47,15 @@ const orbitron = Orbitron({
4947
variable: "--font-orbitron",
5048
})
5149

52-
export default async function RootLayout({
53-
children,
54-
}: {
55-
children: ReactNode
56-
}) {
57-
const variantCtx = await getContext()
58-
50+
export default function RootLayout({ children }: { children: ReactNode }) {
5951
return (
6052
<html lang="en">
6153
<body
6254
className={`min-h-screen ${poppins.variable} ${orbitron.variable} font-sans`}
6355
>
64-
<VariantProvider ctx={variantCtx}>
65-
<HeaderNav />
66-
{children}
67-
<FooterNav />
68-
</VariantProvider>
56+
<HeaderNav />
57+
{children}
58+
<FooterNav />
6959
<Fathom />
7060
<Analytics />
7161
<SpeedInsights />

lib/configcat.ts

Lines changed: 0 additions & 36 deletions
This file was deleted.

lib/content.tsx

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)