File tree 3 files changed +10
-4
lines changed
app/api/og/[chain]/[contract]
3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1
1
/* eslint-disable @next/next/no-img-element */
2
2
/* eslint-disable @typescript-eslint/no-explicit-any */
3
+ import { formatTokenScriptTitle } from '@/lib/format-tokenscript-title'
3
4
import { fetchTsData } from '@repo/tlinks/utils'
4
- import startCase from 'lodash.startcase'
5
5
import { ImageResponse } from 'next/og'
6
6
import { NextRequest } from 'next/server'
7
7
@@ -34,7 +34,8 @@ export async function GET(
34
34
} )
35
35
36
36
const imgUrl = tokenMetadata ?. image || tsMetadata ?. meta . iconUrl || ''
37
- const title = startCase ( tsMetadata ?. name || '' ) || tokenMetadata ?. name
37
+ const title =
38
+ formatTokenScriptTitle ( tsMetadata ?. name || '' ) || tokenMetadata ?. name
38
39
const actionName = tsMetadata . actions [ 0 ] . label
39
40
40
41
let imgSrc : any
Original file line number Diff line number Diff line change 2
2
import { TlinkCard } from '@/components/tlink-card'
3
3
import { Button } from '@/components/ui/button'
4
4
import { Card , CardContent } from '@/components/ui/card'
5
+ import { formatTokenScriptTitle } from '@/lib/format-tokenscript-title'
5
6
import { handleGetTokenScriptAction } from '@/lib/handle-get-ts-action'
6
7
import { useQuery } from '@tanstack/react-query'
7
- import startCase from 'lodash.startcase'
8
8
import { Chrome , ExternalLink , Globe } from 'lucide-react'
9
9
import Link from 'next/link'
10
10
import { useSearchParams } from 'next/navigation'
@@ -34,7 +34,7 @@ export function TappDetail() {
34
34
'viewer.tokenscript.org/' ,
35
35
)
36
36
37
- const displayName = startCase ( data ?. tsMetadata . name || '' )
37
+ const displayName = formatTokenScriptTitle ( data ?. tsMetadata . name || '' )
38
38
39
39
return (
40
40
< main className = "container mx-auto px-4 py-8 relative z-10" >
Original file line number Diff line number Diff line change
1
+ import startCase from 'lodash.startcase'
2
+
3
+ export const formatTokenScriptTitle = ( title : string ) => {
4
+ return startCase ( title ) . replace ( / W e b 3 / g, 'Web3' )
5
+ }
You can’t perform that action at this time.
0 commit comments