share dialog styling
This commit is contained in:
parent
e7ed893b78
commit
37cff04e39
|
@ -9,7 +9,6 @@ import { Row } from '../layout/row'
|
||||||
import { ShareEmbedButton } from '../share-embed-button'
|
import { ShareEmbedButton } from '../share-embed-button'
|
||||||
import { Title } from '../title'
|
import { Title } from '../title'
|
||||||
import { TweetButton } from '../tweet-button'
|
import { TweetButton } from '../tweet-button'
|
||||||
import { DuplicateContractButton } from '../copy-contract-button'
|
|
||||||
import { Button } from '../button'
|
import { Button } from '../button'
|
||||||
import { copyToClipboard } from 'web/lib/util/copy'
|
import { copyToClipboard } from 'web/lib/util/copy'
|
||||||
import { track, withTracking } from 'web/lib/service/analytics'
|
import { track, withTracking } from 'web/lib/service/analytics'
|
||||||
|
@ -21,6 +20,7 @@ import { REFERRAL_AMOUNT } from 'common/economy'
|
||||||
import { CreateChallengeModal } from 'web/components/challenges/create-challenge-modal'
|
import { CreateChallengeModal } from 'web/components/challenges/create-challenge-modal'
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { CHALLENGES_ENABLED } from 'common/challenge'
|
import { CHALLENGES_ENABLED } from 'common/challenge'
|
||||||
|
import ChallengeIcon from 'web/lib/icons/challenge-icon'
|
||||||
|
|
||||||
export function ShareModal(props: {
|
export function ShareModal(props: {
|
||||||
contract: Contract
|
contract: Contract
|
||||||
|
@ -56,8 +56,8 @@ export function ShareModal(props: {
|
||||||
</p>
|
</p>
|
||||||
<Button
|
<Button
|
||||||
size="2xl"
|
size="2xl"
|
||||||
color="gradient"
|
color="indigo"
|
||||||
className={'flex max-w-xs self-center'}
|
className={'mb-2 flex max-w-xs self-center'}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
copyToClipboard(shareUrl)
|
copyToClipboard(shareUrl)
|
||||||
toast.success('Link copied!', {
|
toast.success('Link copied!', {
|
||||||
|
@ -68,38 +68,39 @@ export function ShareModal(props: {
|
||||||
>
|
>
|
||||||
{linkIcon} Copy link
|
{linkIcon} Copy link
|
||||||
</Button>
|
</Button>
|
||||||
<Row className={'justify-center'}>or</Row>
|
|
||||||
{showChallenge && (
|
|
||||||
<Button
|
|
||||||
size="2xl"
|
|
||||||
color="gradient"
|
|
||||||
className={'mb-2 flex max-w-xs self-center'}
|
|
||||||
onClick={withTracking(
|
|
||||||
() => setOpenCreateChallengeModal(true),
|
|
||||||
'click challenge button'
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<span>⚔️ Challenge</span>
|
|
||||||
<CreateChallengeModal
|
|
||||||
isOpen={openCreateChallengeModal}
|
|
||||||
setOpen={(open) => {
|
|
||||||
if (!open) {
|
|
||||||
setOpenCreateChallengeModal(false)
|
|
||||||
setOpen(false)
|
|
||||||
} else setOpenCreateChallengeModal(open)
|
|
||||||
}}
|
|
||||||
user={user}
|
|
||||||
contract={contract}
|
|
||||||
/>
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
<Row className="z-0 flex-wrap justify-center gap-4 self-center">
|
<Row className="z-0 flex-wrap justify-center gap-4 self-center">
|
||||||
<TweetButton
|
<TweetButton
|
||||||
className="self-start"
|
className="self-start"
|
||||||
tweetText={getTweetText(contract, shareUrl)}
|
tweetText={getTweetText(contract, shareUrl)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ShareEmbedButton contract={contract} />
|
<ShareEmbedButton contract={contract} />
|
||||||
<DuplicateContractButton contract={contract} />
|
|
||||||
|
{showChallenge && (
|
||||||
|
<button
|
||||||
|
className={
|
||||||
|
'btn btn-xs flex-nowrap border-2 !border-indigo-500 !bg-white normal-case text-indigo-500'
|
||||||
|
}
|
||||||
|
onClick={withTracking(
|
||||||
|
() => setOpenCreateChallengeModal(true),
|
||||||
|
'click challenge button'
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
️<ChallengeIcon className="mr-1 h-4 w-4" /> Challenge
|
||||||
|
<CreateChallengeModal
|
||||||
|
isOpen={openCreateChallengeModal}
|
||||||
|
setOpen={(open) => {
|
||||||
|
if (!open) {
|
||||||
|
setOpenCreateChallengeModal(false)
|
||||||
|
setOpen(false)
|
||||||
|
} else setOpenCreateChallengeModal(open)
|
||||||
|
}}
|
||||||
|
user={user}
|
||||||
|
contract={contract}
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
</Row>
|
</Row>
|
||||||
</Col>
|
</Col>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
|
@ -40,14 +40,7 @@ export function ShareEmbedButton(props: { contract: Contract }) {
|
||||||
track('copy embed code')
|
track('copy embed code')
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Menu.Button
|
<Menu.Button className="btn btn-xs border-2 !border-gray-500 !bg-white normal-case text-gray-500">
|
||||||
className="btn btn-xs normal-case"
|
|
||||||
style={{
|
|
||||||
backgroundColor: 'white',
|
|
||||||
border: '2px solid #9ca3af',
|
|
||||||
color: '#9ca3af', // text-gray-400
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{codeIcon}
|
{codeIcon}
|
||||||
Embed
|
Embed
|
||||||
</Menu.Button>
|
</Menu.Button>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user