Skip to content

Commit

Permalink
Enable Twomba (#2840)
Browse files Browse the repository at this point in the history
* Enable twomba

* Lower fraud threshold for approvely

* Undo threshold

* Undo threshold

* Spice off

* Add twomba banner

---------

Co-authored-by: Sinclair Chen <abc.sinclair@gmail.com>
  • Loading branch information
IanPhilips and sipec authored Sep 17, 2024
1 parent 1ff1242 commit 5e8b46d
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 6 deletions.
4 changes: 2 additions & 2 deletions common/src/envs/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ export const CONFIGS: { [env: string]: EnvConfig } = {
DEV: DEV_CONFIG,
}

export const TWOMBA_ENABLED = false
export const TWOMBA_ENABLED = true
export const PRODUCT_MARKET_FIT_ENABLED = false
export const SPICE_PRODUCTION_ENABLED = true
export const SPICE_PRODUCTION_ENABLED = false
export const SPICE_TO_MANA_CONVERSION_RATE = 1
export const CASH_TO_MANA_CONVERSION_RATE = 100
export const MIN_CASH_DONATION = 25
Expand Down
4 changes: 3 additions & 1 deletion web/components/layout/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import { Col } from './col'
import { GoogleOneTapLogin } from 'web/lib/firebase/google-onetap-login'
import { ConfettiOnDemand } from '../confetti-on-demand'
import { useTracking } from 'web/hooks/use-tracking'
import { DowntimeBanner } from '../nav/banner'
import { DowntimeBanner, TwombaBanner } from '../nav/banner'
import { useUser } from 'web/hooks/use-user'

import { UpdatedTermsModal } from '../updated-terms-modal'
import { TWOMBA_ENABLED } from 'common/envs/constants'

export function Page(props: {
trackPageView: string | false
Expand Down Expand Up @@ -67,6 +68,7 @@ export function Page(props: {
className
)}
>
{TWOMBA_ENABLED && <TwombaBanner />}
{maintainanceBannerEnabled && user && (
<DowntimeBanner>
{/*🛠️ Site is undergoing maintenance, sorry for the inconvenience.*/}
Expand Down
37 changes: 34 additions & 3 deletions web/components/nav/banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { IconButton } from '../buttons/button'
import { Row } from '../layout/row'
import { LogoIcon } from '../icons/logo-icon'
import { usePersistentLocalState } from 'web/hooks/use-persistent-local-state'
import Link from 'next/link'

export function Banner(props: {
setShowBanner?: (show: boolean) => void
Expand All @@ -20,9 +21,16 @@ export function Banner(props: {
'text-ink-900 bg-primary-100 z-10 justify-between gap-4'
)}
>
<a href={link} className="pl-4" rel="noopener noreferrer">
{children}
</a>
{link && (
<Link
target="_blank"
href={link}
className="pl-4"
rel="noopener noreferrer"
>
{children}
</Link>
)}

{setShowBanner && (
<IconButton
Expand Down Expand Up @@ -117,3 +125,26 @@ export const useBanner = (name: string) => {

return [!bannerSeen, () => setBannerSeen(1)] as const
}

export const TwombaBanner = () => {
const [showBanner, hideBanner] = useBanner('twomba')
if (!showBanner) return null
return (
<Banner
className="border-primary-300 from-primary-100 to-primary-200 border bg-gradient-to-b"
link="https://manifoldmarkets.notion.site/Sweepstakes-Beta-Announcement-10454492ea7a80c1abd8ee0eb67102b9?pvs=4"
setShowBanner={hideBanner}
>
<Row className="gap-2">
<LogoIcon
className="h-6 w-6 flex-shrink-0 text-black dark:text-white"
height={24}
width={24}
aria-hidden
strokeWidth={1}
/>
<div>Sweepstakes cash prizes are here! Read more</div>
</Row>
</Banner>
)
}

0 comments on commit 5e8b46d

Please sign in to comment.