Skip to content

Commit

Permalink
add buy link
Browse files Browse the repository at this point in the history
  • Loading branch information
MeatDeveloper committed Dec 8, 2023
1 parent 17cd407 commit 863aa69
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
16 changes: 14 additions & 2 deletions app/(general)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Link from "next/link"
import { FaDiscord, FaGithub } from "react-icons/fa"
import { LuBook } from "react-icons/lu"

import { siteConfig } from "@/config/site"
import { meatAddress, siteConfig } from "@/config/site"
import { cn } from "@/lib/utils"
import { buttonVariants } from "@/components/ui/button"
import {
Expand All @@ -12,7 +12,6 @@ import {
PageHeaderDescription,
PageHeaderHeading,
} from "@/components/layout/page-header"
import { CopyButton } from "@/components/shared/copy-button"

export default function HomePage() {
return (
Expand All @@ -28,6 +27,19 @@ export default function HomePage() {
<PageHeaderHeading>MEAT</PageHeaderHeading>
<PageHeaderDescription>{siteConfig.description}</PageHeaderDescription>
<PageHeaderCTA>

<Link
href={`https://traderjoexyz.com/${meatAddress}`}
target="_blank"
rel="noreferrer noopener"
className={cn(
buttonVariants(),
"bg-[#F24430] text-white hover:bg-[#F24430]/80"
)}
>
<Image src="/joe.png" alt="Joe Logo" width={20} height={20} className="mr-2 h-4 w-4" />
Buy
</Link>
<Link
href={siteConfig.links.docs}
target="_blank"
Expand Down
5 changes: 3 additions & 2 deletions components/blockchain/wallet-meat-balance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useAccount, useContractRead, useNetwork } from "wagmi"

import { trimFormattedBalance } from "@/lib/utils"
import { erc20ABI } from "@/lib/generated/blockchain"
import { meatAddress } from "@/config/site"

interface WalletBalanceProps
extends Omit<HTMLAttributes<HTMLSpanElement>, "children"> {
Expand All @@ -16,13 +17,13 @@ export const WalletMeatBalance = ({
}: WalletBalanceProps) => {
const { address } = useAccount()
const { data: balance } = useContractRead({
address: "0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7",
address: meatAddress,
abi: erc20ABI,
functionName: "balanceOf",
args: [address ?? "" as `0x${string}`],
})

// if (!address || !balance) return null
if (!address || !balance) return null

return (
<span className={className} {...props}>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@turbo-eth/template-web3-app",
"name": "meat-page",
"version": "0.0.0",
"license": "MIT",
"contributors": [
Expand Down
Binary file added public/joe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 863aa69

Please sign in to comment.