Skip to content

Commit

Permalink
feat: modify share content
Browse files Browse the repository at this point in the history
Signed-off-by: Arpit Srivastava <[email protected]>
  • Loading branch information
arpitsrivastava-cb committed Aug 11, 2023
1 parent ecb3dc7 commit bf270fa
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/components/Share/Share.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
import { FC } from 'react'
import { FC, useMemo } from 'react'
import Link from 'next/link'
import { Address } from 'wagmi'

import { TwitterIcon } from '@/components/icons/Twitter'
import { useMintDialogContext } from '@/components/MintDialog/Context/useMintDialogContext'
import { website } from '@/config/website'
import { WarpCast } from '@/components/icons/Warpcast'
import { Lens } from '@/components/icons/Lens'
import { useEns } from '@/utils/useEns'
import { schedule } from "@/config/schedule";

const twitterURL: string = 'https://twitter.com/intent/tweet'
const warpCastURL: string = 'https://warpcast.com'
const lensURL: string = 'https://lenster.xyz'

type ShareComponentProps = {}
export const Share: FC<ShareComponentProps> = () => {
const { dropName } = useMintDialogContext()
const {
location: { href },
} = window
const { dropName, partnerName, creatorAddress } = useMintDialogContext()
const { name } = useEns(creatorAddress as Address)
const partnerSlug = useMemo(() => {
return Object.values(schedule).find((partner) => partner.name === partnerName)?.slug
}, [partnerName])

const href = `${website.url}/${partnerSlug ?? ''}`
const shareText = {
twitter: `I just minted ${dropName}, celebrating the start of @BuildOnBase bringing billions of people onchain.%0a%0aIt’s Onchain Summer.`,
lens: `I just minted ${dropName}, celebrating the start of @BuildOnBase bringing billions of people onchain.%0a%0aIt’s Onchain Summer.`,
warpCast: `I just minted ${dropName}, celebrating the start of @base bringing billions of people onchain.%0a%0aIt’s Onchain Summer.`,
twitter: `I just minted ${dropName} by ${name}, celebrating Onchain Summer with ${partnerName} on @BuildOnBase.`,
lens: `I just minted ${dropName} by ${name}, celebrating Onchain Summer with ${partnerName} on @base.`,
warpCast: `I just minted ${dropName} by ${name}, celebrating Onchain Summer with ${partnerName} on @base.`,
}

const tweetUrl = `${twitterURL}?url=${href}&text=${shareText['twitter']}`
Expand Down

0 comments on commit bf270fa

Please sign in to comment.