diff --git a/common/envs/constants.ts b/common/envs/constants.ts index 7092d711..463f3293 100644 --- a/common/envs/constants.ts +++ b/common/envs/constants.ts @@ -2,6 +2,7 @@ import { escapeRegExp } from 'lodash' import { DEV_CONFIG } from './dev' import { EnvConfig, PROD_CONFIG } from './prod' import { THEOREMONE_CONFIG } from './theoremone' +import { SALEM_CENTER_CONFIG } from './salemcenter' export const ENV = process.env.NEXT_PUBLIC_FIREBASE_ENV ?? 'PROD' @@ -9,6 +10,7 @@ const CONFIGS: { [env: string]: EnvConfig } = { PROD: PROD_CONFIG, DEV: DEV_CONFIG, THEOREMONE: THEOREMONE_CONFIG, + SALEM_CENTER: SALEM_CENTER_CONFIG, } export const ENV_CONFIG = CONFIGS[ENV] diff --git a/common/envs/prod.ts b/common/envs/prod.ts index 5bd12095..2cad4203 100644 --- a/common/envs/prod.ts +++ b/common/envs/prod.ts @@ -18,6 +18,7 @@ export type EnvConfig = { faviconPath?: string // Should be a file in /public navbarLogoPath?: string newQuestionPlaceholders: string[] + whitelistCreators?: string[] // Currency controls fixedAnte?: number diff --git a/common/envs/salemcenter.ts b/common/envs/salemcenter.ts new file mode 100644 index 00000000..b520f6c0 --- /dev/null +++ b/common/envs/salemcenter.ts @@ -0,0 +1,24 @@ +import { EnvConfig, PROD_CONFIG } from './prod' + +export const SALEM_CENTER_CONFIG: EnvConfig = { + domain: 'salemcenter.manifold.markets', + firebaseConfig: { + apiKey: 'AIzaSyBxisXMHPJDtM7ZseaOOlLAM_T7QHP_QvA', + authDomain: 'salem-center-manifold.firebaseapp.com', + projectId: 'salem-center-manifold', + region: 'us-central1', + storageBucket: 'salem-center-manifold.appspot.com', + messagingSenderId: '522400938664', + appId: '1:522400938664:web:300eaedb8446818d61a09d', + measurementId: 'G-Y3EZ1WNT6E', + }, + cloudRunId: 'fm35sk365q', // TODO: fill in real ID for T1 + cloudRunRegion: 'uc', + adminEmails: [...PROD_CONFIG.adminEmails, 'richardh0828@gmail.com'], + moneyMoniker: 'S$', + visibility: 'PRIVATE', + faviconPath: '/salem-center/logo.ico', + navbarLogoPath: '/salem-center/salem-center-logo.svg', + newQuestionPlaceholders: [], + whitelistCreators: ['RichardHanania', 'SalemCenter'], +} diff --git a/firestore.indexes.json b/firestore.indexes.json index 12e88033..1d09265c 100644 --- a/firestore.indexes.json +++ b/firestore.indexes.json @@ -22,6 +22,20 @@ } ] }, + { + "collectionGroup": "bets", + "queryScope": "COLLECTION_GROUP", + "fields": [ + { + "fieldPath": "isFilled", + "order": "ASCENDING" + }, + { + "fieldPath": "userId", + "order": "ASCENDING" + } + ] + }, { "collectionGroup": "bets", "queryScope": "COLLECTION_GROUP", diff --git a/functions/.env b/functions/.env index 0c4303df..ef65897f 100644 --- a/functions/.env +++ b/functions/.env @@ -1,3 +1,3 @@ # This sets which EnvConfig is deployed to Firebase Cloud Functions -NEXT_PUBLIC_FIREBASE_ENV=PROD +NEXT_PUBLIC_FIREBASE_ENV=SALEM_CENTER diff --git a/web/components/amount-input.tsx b/web/components/amount-input.tsx index 426a9371..7a1b81d5 100644 --- a/web/components/amount-input.tsx +++ b/web/components/amount-input.tsx @@ -4,7 +4,6 @@ import { useUser } from 'web/hooks/use-user' import { formatMoney } from 'common/util/format' import { Col } from './layout/col' import { Spacer } from './layout/spacer' -import { SiteLink } from './site-link' import { ENV_CONFIG } from 'common/envs/constants' export function AmountInput(props: { @@ -61,16 +60,7 @@ export function AmountInput(props: { {error && (
- {error === 'Insufficient balance' ? ( - <> - Not enough funds. - - Buy more? - - - ) : ( - error - )} + {error === 'Insufficient balance' ? <>Not enough funds. : error}
)} diff --git a/web/components/feed/feed-comments.tsx b/web/components/feed/feed-comments.tsx index f4c6eb74..a0b5b9e4 100644 --- a/web/components/feed/feed-comments.tsx +++ b/web/components/feed/feed-comments.tsx @@ -29,7 +29,6 @@ import { LoadingIndicator } from 'web/components/loading-indicator' import { PaperAirplaneIcon } from '@heroicons/react/outline' import { track } from 'web/lib/service/analytics' import { useEvent } from 'web/hooks/use-event' -import { Tipper } from '../tipper' import { CommentTipMap, CommentTips } from 'web/hooks/use-tip-txns' import { useWindowSize } from 'web/hooks/use-window-size' @@ -189,7 +188,6 @@ export function FeedComment(props: { const { contract, comment, - tips, betsBySameUser, probAtCreatedTime, truncate, @@ -282,7 +280,6 @@ export function FeedComment(props: { shouldTruncate={truncate} /> - {onReplyClick && ( )} diff --git a/web/pages/group/[...slugs]/index.tsx b/web/pages/group/[...slugs]/index.tsx index b96d6436..bd2e6fba 100644 --- a/web/pages/group/[...slugs]/index.tsx +++ b/web/pages/group/[...slugs]/index.tsx @@ -160,7 +160,7 @@ export default function GroupPage(props: { const privateUser = usePrivateUser(user?.id) useSaveReferral(user, { - defaultReferrerUsername: creator.username, + defaultReferrerUsername: creator?.username, groupId: group?.id, }) diff --git a/web/pages/home.tsx b/web/pages/home.tsx index ab915ae3..541eccb1 100644 --- a/web/pages/home.tsx +++ b/web/pages/home.tsx @@ -1,6 +1,4 @@ import React, { useEffect, useState } from 'react' -import { useRouter } from 'next/router' -import { PlusSmIcon } from '@heroicons/react/solid' import { Page } from 'web/components/page' import { Col } from 'web/components/layout/col' @@ -10,7 +8,6 @@ import { Contract } from 'common/contract' import { ContractPageContent } from './[username]/[contractSlug]' import { getContractFromSlug } from 'web/lib/firebase/contracts' import { useTracking } from 'web/hooks/use-tracking' -import { track } from 'web/lib/service/analytics' import { redirectIfLoggedOut } from 'web/lib/firebase/server-auth' import { useSaveReferral } from 'web/hooks/use-save-referral' @@ -19,7 +16,6 @@ export const getServerSideProps = redirectIfLoggedOut('/') const Home = () => { const [contract, setContract] = useContractPage() - const router = useRouter() useTracking('view home') useSaveReferral() @@ -41,16 +37,6 @@ const Home = () => { }} /> - {contract && ( diff --git a/web/pages/leaderboards.tsx b/web/pages/leaderboards.tsx index 45c484c4..d0453ea9 100644 --- a/web/pages/leaderboards.tsx +++ b/web/pages/leaderboards.tsx @@ -70,10 +70,9 @@ export default function Leaderboards(_props: { fetchProps().then((props) => setProps(props)) }, []) - const { topFollowed } = props - const LeaderboardWithPeriod = (period: Period) => { - const { topTraders, topCreators } = props[period] + const { topTraders } = props[period] + return ( <> @@ -88,35 +87,7 @@ export default function Leaderboards(_props: { }, ]} /> - - - formatMoney(user.creatorVolumeCached[period]), - }, - ]} - /> - {period === 'allTime' ? ( - - user.followerCountCached, - }, - ]} - /> - - ) : ( - <> - )} ) } diff --git a/web/pages/profile.tsx b/web/pages/profile.tsx index 541f5de9..a41fa40f 100644 --- a/web/pages/profile.tsx +++ b/web/pages/profile.tsx @@ -1,7 +1,6 @@ import React, { useEffect, useState } from 'react' import { RefreshIcon } from '@heroicons/react/outline' -import { AddFundsButton } from 'web/components/add-funds-button' import { Page } from 'web/components/page' import { SEO } from 'web/components/SEO' import { Title } from 'web/components/title' @@ -240,7 +239,6 @@ export default function ProfilePage() { {formatMoney(user?.balance || 0)} - diff --git a/web/public/salem-center/logo.ico b/web/public/salem-center/logo.ico new file mode 100644 index 00000000..c50e6d5d Binary files /dev/null and b/web/public/salem-center/logo.ico differ diff --git a/web/public/salem-center/salem-center-logo.svg b/web/public/salem-center/salem-center-logo.svg new file mode 100644 index 00000000..c59a0478 --- /dev/null +++ b/web/public/salem-center/salem-center-logo.svg @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +