predikt/oracle/web/components/buttons/mobile-apps-qr-code-button.tsx
caelum0x 2b68bde5d5 Predikt: full Polymarket-style prediction market — web + mobile + on-chain + bots
Working tree is now the canonical repo. Off-chain play-money + trustless on-chain
(FPMM AMM + CLOB via UMA settlement), AI market factory, creator/social/distribution,
mobile shell + push, one-command demo + deploy-kit. Secrets excluded (see ENV-AND-KEYS.md).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 23:29:50 +03:00

67 lines
1.9 KiB
TypeScript

import { Button } from 'web/components/buttons/button'
import { useState } from 'react'
import { Modal } from 'web/components/layout/modal'
import { Col } from 'web/components/layout/col'
import { QRCode } from 'web/components/widgets/qr-code'
import { APPLE_APP_URL, GOOGLE_PLAY_APP_URL } from 'common/envs/constants'
import { Tabs } from 'web/components/layout/tabs'
import { track } from 'web/lib/service/analytics'
export const MobileAppsQRCodeButton = () => {
const [isModalOpen, setIsModalOpen] = useState(false)
return (
<>
<Button
color="indigo-outline"
onClick={() => {
setIsModalOpen(true)
track('banner click get app')
}}
>
Get the app
</Button>
<MobileAppsQRCodeDialog
isModalOpen={isModalOpen}
setIsModalOpen={setIsModalOpen}
/>
</>
)
}
export const MobileAppsQRCodeDialog = (props: {
isModalOpen: boolean
setIsModalOpen: (isOpen: boolean) => void
}) => {
const { isModalOpen, setIsModalOpen } = props
return (
<Modal open={isModalOpen} setOpen={setIsModalOpen} size="sm">
<Col className={'bg-canvas-0 rounded-2xl p-4'}>
<span className={'text-primary-700 py-2 text-2xl'}>
Get the Predikt app
</span>
<span className={'py-2 '}>Scan this QR code to download the app.</span>
<Tabs
tabs={[
{
title: 'Apple',
content: (
<Col className={'w-full items-center justify-center p-4'}>
<QRCode url={APPLE_APP_URL} />
</Col>
),
},
{
title: 'Android',
content: (
<Col className={'w-full items-center justify-center p-4'}>
<QRCode url={GOOGLE_PLAY_APP_URL} />
</Col>
),
},
]}
/>
</Col>
</Modal>
)
}