This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { GetStaticPaths, GetStaticProps, NextPage } from "next"; | |
import { ParsedUrlQuery } from "querystring"; | |
interface Data { | |
title: string; | |
} | |
interface HomePageProps { | |
data: Data; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { GetStaticProps, NextPage } from "next"; | |
interface Data { | |
title: string; | |
} | |
interface HomePageProps { | |
data: Data; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const truncateEthAddress = (address: string) => { | |
const truncateRegex = /^(0x[a-zA-Z0-9]{4})[a-zA-Z0-9]+([a-zA-Z0-9]{4})$/; | |
const match = address.match(truncateRegex); | |
if (!match) return address; | |
return `${match[1]}…${match[2]}`; | |
}; |
NewerOlder