Skip to content

Commit aeb8e4a

Browse files
committed
replace torchbearers external data call with static local data
1 parent 44e747c commit aeb8e4a

17 files changed

+92
-87
lines changed

.env.example

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,3 @@ ANALYZE=false
4848
# Use mock data for development. Set to "false" to use live data but you must have the
4949
# environment variables set to make api requests
5050
USE_MOCK_DATA=true
51-
52-
# Google Sheet ID for torch holders
53-
GOOGLE_SHEET_ID_TORCH_HOLDERS=

app/[locale]/10years/_components/TorchHistoryCard.tsx

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react"
22

3-
import { Avatar } from "@/components/ui/avatar"
3+
import { AvatarBase, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
44
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
55
import { BaseLink } from "@/components/ui/Link"
66
import { Tag } from "@/components/ui/tag"
@@ -50,12 +50,24 @@ const TorchHistoryCard: React.FC<TorchHistoryCardProps> = ({
5050
>
5151
<CardHeader className="flex flex-col p-0">
5252
<div className="mb-4 flex flex-col items-center">
53-
<Avatar
54-
className="h-32 w-32 border-2 border-gray-100/50 !shadow-none"
55-
src={avatar}
56-
href={`https://x.com/${extractTwitterHandle(twitter)}`}
57-
name={name}
58-
/>
53+
<AvatarBase
54+
className={cn(
55+
"h-32 w-32 border-2 border-gray-100/50 !shadow-none",
56+
!twitter && "pointer-events-none"
57+
)}
58+
>
59+
{twitter ? (
60+
<BaseLink href={`https://x.com/${extractTwitterHandle(twitter)}`}>
61+
<AvatarImage src={avatar} alt={name} />
62+
<AvatarFallback>{name[0]}</AvatarFallback>
63+
</BaseLink>
64+
) : (
65+
<>
66+
<AvatarImage src={avatar} alt={name} />
67+
<AvatarFallback>{name[0]}</AvatarFallback>
68+
</>
69+
)}
70+
</AvatarBase>
5971
</div>
6072

6173
{isCurrentHolder && (

app/[locale]/10years/page.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ import { dataLoader } from "@/lib/utils/data/dataLoader"
2222
import { getMetadata } from "@/lib/utils/metadata"
2323
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
2424

25+
// Import static torch holders data
26+
import torchHoldersData from "@/data/torchHolders.json"
27+
2528
import { BASE_TIME_UNIT } from "@/lib/constants"
2629

2730
import Curved10YearsText from "./_components/10y.svg"
@@ -45,13 +48,13 @@ import { shouldShowNFTMintCard } from "./_components/utils/nftMintDate"
4548
import { routing } from "@/i18n/routing"
4649
import { fetch10YearEvents } from "@/lib/api/fetch10YearEvents"
4750
import { fetch10YearStories } from "@/lib/api/fetch10YearStories"
48-
import { fetchTorchHolders } from "@/lib/api/fetchTorchHolders"
4951
import {
5052
getCurrentHolder,
5153
getHolderEvents,
5254
getTransferEvents,
5355
isAddressFiltered,
5456
isTorchBurned,
57+
type TorchHolder,
5558
} from "@/lib/torch"
5659
import TenYearLogo from "@/public/images/10-year-anniversary/10-year-logo.png"
5760

@@ -62,7 +65,6 @@ const loadData = dataLoader(
6265
[
6366
["fetched10YearEvents", fetch10YearEvents],
6467
["fetched10YearStories", fetch10YearStories],
65-
["fetchedTorchHolders", fetchTorchHolders],
6668
],
6769
REVALIDATE_TIME * 1000
6870
)
@@ -74,8 +76,9 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
7476

7577
setRequestLocale(locale)
7678

77-
const [fetched10YearEvents, fetched10YearStories, allTorchHolders] =
78-
await loadData()
79+
const [fetched10YearEvents, fetched10YearStories] = await loadData()
80+
81+
const allTorchHolders: TorchHolder[] = torchHoldersData as TorchHolder[]
7982

8083
const stories = parseStoryDates(fetched10YearStories, locale)
8184

next.config.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,6 @@ module.exports = (phase, { defaultConfig }) => {
9393
protocol: "https",
9494
hostname: "coin-images.coingecko.com",
9595
},
96-
{
97-
protocol: "https",
98-
hostname: "unavatar.io",
99-
},
10096
],
10197
},
10298
async headers() {
24.1 KB
Loading
29.9 KB
Loading
29.7 KB
Loading
44.4 KB
Loading
24.8 KB
Loading
25.2 KB
Loading

0 commit comments

Comments
 (0)