Skip to content

Commit 0992550

Browse files
committed
fix: 🐛 remove space between web 3
1 parent eb5dfbd commit 0992550

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

apps/tlink-web/app/api/og/[chain]/[contract]/route.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable @next/next/no-img-element */
22
/* eslint-disable @typescript-eslint/no-explicit-any */
3+
import { formatTokenScriptTitle } from '@/lib/format-tokenscript-title'
34
import { fetchTsData } from '@repo/tlinks/utils'
4-
import startCase from 'lodash.startcase'
55
import { ImageResponse } from 'next/og'
66
import { NextRequest } from 'next/server'
77

@@ -34,7 +34,8 @@ export async function GET(
3434
})
3535

3636
const imgUrl = tokenMetadata?.image || tsMetadata?.meta.iconUrl || ''
37-
const title = startCase(tsMetadata?.name || '') || tokenMetadata?.name
37+
const title =
38+
formatTokenScriptTitle(tsMetadata?.name || '') || tokenMetadata?.name
3839
const actionName = tsMetadata.actions[0].label
3940

4041
let imgSrc: any

apps/tlink-web/components/features/tapp/tapp-detail.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
import { TlinkCard } from '@/components/tlink-card'
33
import { Button } from '@/components/ui/button'
44
import { Card, CardContent } from '@/components/ui/card'
5+
import { formatTokenScriptTitle } from '@/lib/format-tokenscript-title'
56
import { handleGetTokenScriptAction } from '@/lib/handle-get-ts-action'
67
import { useQuery } from '@tanstack/react-query'
7-
import startCase from 'lodash.startcase'
88
import { Chrome, ExternalLink, Globe } from 'lucide-react'
99
import Link from 'next/link'
1010
import { useSearchParams } from 'next/navigation'
@@ -34,7 +34,7 @@ export function TappDetail() {
3434
'viewer.tokenscript.org/',
3535
)
3636

37-
const displayName = startCase(data?.tsMetadata.name || '')
37+
const displayName = formatTokenScriptTitle(data?.tsMetadata.name || '')
3838

3939
return (
4040
<main className="container mx-auto px-4 py-8 relative z-10">
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import startCase from 'lodash.startcase'
2+
3+
export const formatTokenScriptTitle = (title: string) => {
4+
return startCase(title).replace(/Web 3/g, 'Web3')
5+
}

0 commit comments

Comments
 (0)