Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
CONFIGCAT_API_KEY=
AMPLITUDE_API_KEY=
NEXT_PUBLIC_FATHOM_ID=
18 changes: 4 additions & 14 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2.3.1
with:
persist-credentials: false
uses: actions/checkout@v4

- name: Cache 📦
uses: actions/cache@v1
with:
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Setup Node Environment ⬢
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
cache: 'npm'

- name: Install 🔧
run: npm install
Expand Down
19 changes: 0 additions & 19 deletions app/api/events/route.ts

This file was deleted.

54 changes: 9 additions & 45 deletions app/components/EventLink.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
"use client"

import Link from "next/link"
import { type ReactNode, useEffect, useContext } from "react"
import { type Event } from "@/lib/types"
import { type ReactNode, useEffect } from "react"
import va from "@vercel/analytics"
import { VariantContext } from "../context/VariantProvider"

type Props = {
children: ReactNode
Expand All @@ -17,29 +15,11 @@ type Props = {
onClick?: () => void
}

async function logEvent(event: Event): Promise<void> {
// Log vercel
event.params = event.params || {}
if (event.variantIds) {
event.variantIds.forEach((id) => {
event.params![id.substring(0, id.length - 1)] = id.slice(-1)
})
}
va.track(
event.name,
Object.keys(event.params).length > 0 ? event.params : undefined
)

// Log amplitude
if (event.userId && event.variantIds) {
fetch("/api/events", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(event),
})
}
async function logEvent(
name: string,
params?: Record<string, string | number | boolean | null>
): Promise<void> {
va.track(name, params && Object.keys(params).length > 0 ? params : undefined)
}

export default function EventLink({
Expand All @@ -52,36 +32,20 @@ export default function EventLink({
className,
onClick,
}: Props) {
const variantCtx = useContext(VariantContext)

useEffect(() => {
async function log() {
await logEvent({
name: event + " Viewed",
params,
userId: variantCtx.userId,
variantIds: variantCtx.ids,
})
}
if (event && logView) {
// The timeout puts this in the back of the event queue, giving vercel analytics time to load.
setTimeout(() => {
log()
logEvent(event + " Viewed", params)
}, 0)
}
}, [variantCtx, event, params, logView])
}, [event, params, logView])

const handleClick = async () => {
if (onClick) {
onClick()
}
if (event) {
await logEvent({
name: event + " Clicked",
params,
userId: variantCtx.userId,
variantIds: variantCtx.ids,
})
await logEvent(event + " Clicked", params)
}
}

Expand Down
9 changes: 2 additions & 7 deletions app/components/Features.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import EventLink from "./EventLink"
import { getFeatures } from "@/lib/variants"
import { getUserId } from "@/lib/users"
import items from "@/lib/features"
import { Features } from "@/lib/types"

export default async function Features() {
const content = await getFeatures(getUserId())

export default function Features() {
return (
<section
id="features"
Expand All @@ -15,7 +10,7 @@ export default async function Features() {
<div className="w-full h-[18px] bg-white opacity-[0.15]"></div>
<div className="container mx-auto px-6 md:px-9 lg:px-16 xl:px-20 py-12 md:py-24 lg:py-36">
<h1 className="w-full text-xl lg:text-2xl mb-6 lg:mb-10">
{content.title}
Build on decentralized data without the headache.
</h1>
<div className="w-full grid gap-4 lg:gap-10 grid-cols-1 md:grid-cols-2 lg:grid-cols-4">
{items.map(function (f, i) {
Expand Down
30 changes: 8 additions & 22 deletions app/components/Hero.tsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,24 @@
import ButtonLink from "./ButtonLink"
import Terminal from "./Terminal"
import { getHero } from "@/lib/variants"
import { getUserId } from "@/lib/users"
import { type Hero } from "@/lib/types"

export default async function Hero() {
const content = await getHero(getUserId())

export default function Hero() {
return (
<div className="bg-lightpurple">
<section className="w-full bg-top bg-cover bg-no-repeat bg-lightpurple md:bg-[url('/img/home/hero.jpg')]">
<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">
<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">
<h3 className="text-grey uppercase font-normal !mb-0">
<span
dangerouslySetInnerHTML={{
__html: content.tag,
}}
/>
Read+write from <span className="font-bold">anywhere</span>
</h3>
<h1 className="font-normal">
<span
dangerouslySetInnerHTML={{
__html: content.title,
}}
/>
The <span className="font-bold">decentralized</span> cloud
database.
</h1>
<Terminal />
<p className="lead">
<span
dangerouslySetInnerHTML={{
__html: content.lead,
}}
/>
Tableland is an open source, permissionless cloud database built
on SQLite. Read and write tamperproof data from apps, data
pipelines, or EVM smart contracts.
</p>
<p>
<ButtonLink
Expand All @@ -43,7 +29,7 @@ export default async function Hero() {
logView={true}
className="bg-darkgreen"
>
{content.cta}
Enter Studio
</ButtonLink>
</p>
</article>
Expand Down
17 changes: 0 additions & 17 deletions app/context/VariantProvider.tsx

This file was deleted.

18 changes: 4 additions & 14 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import FooterNav from "./components/FooterNav"
import Fathom from "./components/Fathom"
import { Analytics } from "@vercel/analytics/react"
import { SpeedInsights } from "@vercel/speed-insights/next"
import VariantProvider from "./context/VariantProvider"
import { getContext } from "@/lib/variants"

const title = "Tableland: The decentralized cloud database"
const description =
Expand Down Expand Up @@ -49,23 +47,15 @@ const orbitron = Orbitron({
variable: "--font-orbitron",
})

export default async function RootLayout({
children,
}: {
children: ReactNode
}) {
const variantCtx = await getContext()

export default function RootLayout({ children }: { children: ReactNode }) {
return (
<html lang="en">
<body
className={`min-h-screen ${poppins.variable} ${orbitron.variable} font-sans`}
>
<VariantProvider ctx={variantCtx}>
<HeaderNav />
{children}
<FooterNav />
</VariantProvider>
<HeaderNav />
{children}
<FooterNav />
<Fathom />
<Analytics />
<SpeedInsights />
Expand Down
36 changes: 0 additions & 36 deletions lib/configcat.ts

This file was deleted.

40 changes: 0 additions & 40 deletions lib/content.tsx

This file was deleted.

41 changes: 0 additions & 41 deletions lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,46 +1,5 @@
import { type IconType } from "react-icons"

export type VariantCtx = {
userId?: string
ids?: string[]
}

export type Event = {
name: string
params?: Record<string, string | number | boolean | null>
userId?: string
variantIds?: string[]
}

export type Flags = {
main: string
sections: string[]
}

export type AB<T> = {
flags: Flags
a: T
b: T
}

export type ABC<T> = {
flags: Flags
a: T
b: T
c: T
}

export type Hero = {
tag: string
title: string
lead: string
cta: string
}

export type Features = {
title: string
}

export type Feature = {
title: string
icon: IconType
Expand Down
Loading