From 25d3fbcc5ff7de44f4e1083efb9a4d1af769f470 Mon Sep 17 00:00:00 2001 From: Austin Chen Date: Thu, 12 May 2022 13:47:07 -0400 Subject: [PATCH 01/32] Add a hover to the category selector --- web/components/feed/category-selector.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/components/feed/category-selector.tsx b/web/components/feed/category-selector.tsx index fc51ddc6..6896f98b 100644 --- a/web/components/feed/category-selector.tsx +++ b/web/components/feed/category-selector.tsx @@ -63,7 +63,7 @@ function CategoryButton(props: { return (
Date: Thu, 12 May 2022 14:04:51 -0400 Subject: [PATCH 02/32] Show prob of FR answer as a bar chart (#200) --- web/components/feed/feed-items.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/web/components/feed/feed-items.tsx b/web/components/feed/feed-items.tsx index baa33559..21d4b568 100644 --- a/web/components/feed/feed-items.tsx +++ b/web/components/feed/feed-items.tsx @@ -948,6 +948,12 @@ function FeedAnswerGroup(props: { /> + {type == 'answer' && ( +
+ )}
@@ -980,9 +986,7 @@ function FeedAnswerGroup(props: { {probPercent} From 06cdf2a84adb658dc868f3286b150fb5c574cf7e Mon Sep 17 00:00:00 2001 From: James Grugett Date: Thu, 12 May 2022 18:28:21 -0500 Subject: [PATCH 03/32] Show category on market card (#197) * Show category on market card * Show multiple categories in contract description * Tweak layout of contract card and show multiple categories --- web/components/contract/contract-card.tsx | 58 +++++++++++-------- .../contract/contract-description.tsx | 8 ++- 2 files changed, 39 insertions(+), 27 deletions(-) diff --git a/web/components/contract/contract-card.tsx b/web/components/contract/contract-card.tsx index d1c7dd31..8f287bdf 100644 --- a/web/components/contract/contract-card.tsx +++ b/web/components/contract/contract-card.tsx @@ -9,7 +9,6 @@ import { getBinaryProbPercent, } from 'web/lib/firebase/contracts' import { Col } from '../layout/col' -import { Spacer } from '../layout/spacer' import { Binary, CPMM, @@ -25,6 +24,8 @@ import { } from '../outcome-label' import { getOutcomeProbability, getTopAnswer } from 'common/calculate' import { AbbrContractDetails } from './contract-details' +import { TagsList } from '../tags-list' +import { CATEGORY_LIST } from 'common/categories' export function ContractCard(props: { contract: Contract @@ -35,11 +36,16 @@ export function ContractCard(props: { const { contract, showHotVolume, showCloseTime, className } = props const { question, outcomeType, resolution } = contract + const { tags } = contract + const categories = tags.filter((tag) => + CATEGORY_LIST.includes(tag.toLowerCase()) + ) + return (
-
@@ -52,35 +58,39 @@ export function ContractCard(props: { showHotVolume={showHotVolume} showCloseTime={showCloseTime} /> - - -

- {question} -

+ + +

+ {question} +

+ {outcomeType !== 'FREE_RESPONSE' && categories.length > 0 && ( + + )} + {outcomeType === 'BINARY' && ( )} - {outcomeType === 'FREE_RESPONSE' && ( - } - truncate="long" - /> - )}
-
+ + {outcomeType === 'FREE_RESPONSE' && ( + } + truncate="long" + /> + )} + + {outcomeType === 'FREE_RESPONSE' && categories.length > 0 && ( + + )} +
) } diff --git a/web/components/contract/contract-description.tsx b/web/components/contract/contract-description.tsx index dd748f50..d1ffdaae 100644 --- a/web/components/contract/contract-description.tsx +++ b/web/components/contract/contract-description.tsx @@ -39,7 +39,9 @@ export function ContractDescription(props: { if (!isCreator && !contract.description.trim()) return null const { tags } = contract - const category = tags.find((tag) => CATEGORY_LIST.includes(tag.toLowerCase())) + const categories = tags.filter((tag) => + CATEGORY_LIST.includes(tag.toLowerCase()) + ) return (
- {category && ( + {categories.length > 0 && (
- +
)} From a373f08b4ff7c90b4e046af4a04059299b1d217e Mon Sep 17 00:00:00 2001 From: Jonas Wagner Date: Fri, 13 May 2022 13:07:51 +0200 Subject: [PATCH 04/32] Update mantic.markets -> manifold.markets (#212) The other references to "mantic" that I could find look legit, but the referrer in stripe.ts should probably be updated. --- functions/src/stripe.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/src/stripe.ts b/functions/src/stripe.ts index c428ca88..a52b0fae 100644 --- a/functions/src/stripe.ts +++ b/functions/src/stripe.ts @@ -54,7 +54,7 @@ export const createCheckoutSession = functions } const referrer = - req.query.referer || req.headers.referer || 'https://mantic.markets' + req.query.referer || req.headers.referer || 'https://manifold.markets' const session = await stripe.checkout.sessions.create({ metadata: { From c2320a07bed4c420e52e6d14d609d16a48ba4ba4 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Fri, 13 May 2022 09:43:12 -0400 Subject: [PATCH 05/32] Free response markets initialize with 0 volume, instead of 100 --- common/new-contract.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/common/new-contract.ts b/common/new-contract.ts index 764d32d3..f6b6829c 100644 --- a/common/new-contract.ts +++ b/common/new-contract.ts @@ -35,8 +35,6 @@ export function getNewContract( ? getBinaryCpmmProps(initialProb, ante) // getBinaryDpmProps(initialProb, ante) : getFreeAnswerProps(ante) - const volume = outcomeType === 'BINARY' ? 0 : ante - const contract: Contract = removeUndefinedProps({ id, slug, @@ -56,7 +54,7 @@ export function getNewContract( createdTime: Date.now(), closeTime, - volume, + volume: 0, volume24Hours: 0, volume7Days: 0, From c99cf7579b779e943e14c715fd06285e64b0e954 Mon Sep 17 00:00:00 2001 From: Austin Chen Date: Fri, 13 May 2022 10:11:57 -0400 Subject: [PATCH 06/32] Try out Hotjar --- web/pages/_app.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/web/pages/_app.tsx b/web/pages/_app.tsx index 11bedb83..91cd0816 100644 --- a/web/pages/_app.tsx +++ b/web/pages/_app.tsx @@ -39,6 +39,19 @@ function MyApp({ Component, pageProps }: AppProps) { gtag('config', 'G-SSFK1Q138D'); `} + {/* Hotjar Tracking Code for https://manifold.markets */} + Manifold Markets — A market for every question From bf07b45467db71c83b92406fee0a3d5029c035e7 Mon Sep 17 00:00:00 2001 From: Austin Chen Date: Fri, 13 May 2022 10:49:01 -0400 Subject: [PATCH 07/32] Add id to hotjar script Apparently needed by NextJS --- web/pages/_app.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/pages/_app.tsx b/web/pages/_app.tsx index 91cd0816..820bc63e 100644 --- a/web/pages/_app.tsx +++ b/web/pages/_app.tsx @@ -40,7 +40,7 @@ function MyApp({ Component, pageProps }: AppProps) { `} {/* Hotjar Tracking Code for https://manifold.markets */} - {/* Hotjar Tracking Code for https://manifold.markets */} - + */} Manifold Markets — A market for every question From b195dcdfd25cbc2b0c1fe575a8b78ecc0dacae0c Mon Sep 17 00:00:00 2001 From: James Grugett Date: Fri, 13 May 2022 14:33:02 -0400 Subject: [PATCH 11/32] Print build info only once --- web/pages/_app.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/pages/_app.tsx b/web/pages/_app.tsx index 0320b8cf..7fbfad16 100644 --- a/web/pages/_app.tsx +++ b/web/pages/_app.tsx @@ -26,7 +26,7 @@ function printBuildInfo() { function MyApp({ Component, pageProps }: AppProps) { usePreserveScroll() - useEffect(printBuildInfo) + useEffect(printBuildInfo, []) return ( <> From 67717bbde74e2e6cfffe1f0bc725c55620de1aee Mon Sep 17 00:00:00 2001 From: James Grugett Date: Fri, 13 May 2022 15:01:38 -0400 Subject: [PATCH 12/32] Prevent having to go back twice from profile / tag search page --- web/components/contract-search.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/components/contract-search.tsx b/web/components/contract-search.tsx index c4308fc0..d6127286 100644 --- a/web/components/contract-search.tsx +++ b/web/components/contract-search.tsx @@ -17,7 +17,7 @@ import { } from '../hooks/use-sort-and-query-params' import { ContractsGrid } from './contract/contracts-list' import { Row } from './layout/row' -import { useEffect, useState } from 'react' +import { useEffect, useRef, useState } from 'react' import { Spacer } from './layout/spacer' import { useRouter } from 'next/router' import { ENV } from 'common/envs/constants' @@ -143,7 +143,13 @@ export function ContractSearchInner(props: { setQuery(query) }, [query]) + const isFirstRender = useRef(true) useEffect(() => { + if (isFirstRender.current) { + isFirstRender.current = false + return + } + const sort = index.split('contracts-')[1] as Sort if (sort) { setSort(sort) From e660acab56947f86646c5698d39fdae5dabcf5ac Mon Sep 17 00:00:00 2001 From: James Grugett Date: Fri, 13 May 2022 15:07:32 -0400 Subject: [PATCH 13/32] Put back hotjar code, but deactivate from hotjar site --- web/pages/_app.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/pages/_app.tsx b/web/pages/_app.tsx index 7fbfad16..55618e4c 100644 --- a/web/pages/_app.tsx +++ b/web/pages/_app.tsx @@ -40,7 +40,7 @@ function MyApp({ Component, pageProps }: AppProps) { `} {/* Hotjar Tracking Code for https://manifold.markets */} - {/* */} + Manifold Markets — A market for every question From 8ce3a0947164b22d6d04e74ddf75cca7684c4409 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Fri, 13 May 2022 16:16:46 -0400 Subject: [PATCH 14/32] Shrink vertical padding on feed answer group --- web/components/feed/feed-items.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/components/feed/feed-items.tsx b/web/components/feed/feed-items.tsx index 21d4b568..c14cbb54 100644 --- a/web/components/feed/feed-items.tsx +++ b/web/components/feed/feed-items.tsx @@ -934,7 +934,7 @@ function FeedAnswerGroup(props: { @@ -950,7 +950,7 @@ function FeedAnswerGroup(props: { {type == 'answer' && (
)} From 8be6b79732700d542c914eb7b93da102e60f450d Mon Sep 17 00:00:00 2001 From: James Grugett Date: Fri, 13 May 2022 16:19:15 -0400 Subject: [PATCH 15/32] Remove 'Category' label --- web/components/contract/contract-description.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/components/contract/contract-description.tsx b/web/components/contract/contract-description.tsx index d1ffdaae..d8b657cb 100644 --- a/web/components/contract/contract-description.tsx +++ b/web/components/contract/contract-description.tsx @@ -54,7 +54,7 @@ export function ContractDescription(props: { {categories.length > 0 && (
- +
)} From 0e64e0f9f99962ec2526d6d640ca63ea8300be57 Mon Sep 17 00:00:00 2001 From: Daniel Reeves Date: Fri, 13 May 2022 15:22:10 -0700 Subject: [PATCH 16/32] Typo fix; fixes #216 (#218) --- functions/src/email-templates/thank-you.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/src/email-templates/thank-you.html b/functions/src/email-templates/thank-you.html index e6217334..ec426fb9 100644 --- a/functions/src/email-templates/thank-you.html +++ b/functions/src/email-templates/thank-you.html @@ -302,7 +302,7 @@ font-family: Arial, sans-serif; font-size: 18px; " - >Best of luck with you forecasting!Best of luck with your forecasting!

Date: Fri, 13 May 2022 16:42:48 -0700 Subject: [PATCH 17/32] Fix random errors (#205) * Fix warning in ShareMarket component * Fix NewContract component to use keys on category list * Refactor NewContract component to assign `value` to `select` --- web/components/share-market.tsx | 1 + web/pages/create.tsx | 16 +++++++--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/web/components/share-market.tsx b/web/components/share-market.tsx index 28c0e5ad..01977fbd 100644 --- a/web/components/share-market.tsx +++ b/web/components/share-market.tsx @@ -13,6 +13,7 @@ export function ShareMarket(props: { contract: Contract; className?: string }) { diff --git a/web/pages/create.tsx b/web/pages/create.tsx index 7205f9c3..d54648b9 100644 --- a/web/pages/create.tsx +++ b/web/pages/create.tsx @@ -20,7 +20,7 @@ import { MAX_DESCRIPTION_LENGTH, outcomeType } from 'common/contract' import { formatMoney } from 'common/util/format' import { useHasCreatedContractToday } from 'web/hooks/use-has-created-contract-today' import { removeUndefinedProps } from '../../common/util/object' -import { CATEGORIES, CATEGORY_LIST, TO_CATEGORY } from 'common/categories' +import { CATEGORIES } from 'common/categories' export default function Create() { const [question, setQuestion] = useState('') @@ -214,15 +214,13 @@ export function NewContract(props: { question: string; tag?: string }) { From 33c0471c293f42a0bc44582c0337aa8d8d55f4f8 Mon Sep 17 00:00:00 2001 From: Marshall Polaris Date: Fri, 13 May 2022 16:47:50 -0700 Subject: [PATCH 18/32] Clean up some markup around the top of the page (#189) * Remove unnecessary wrapper div around sidebar * Remove extra column used for alignment on homepage * Remove extra wrapper div around whole page --- web/components/nav/nav-bar.tsx | 2 +- web/components/nav/sidebar.tsx | 5 +++-- web/components/page.tsx | 8 +++----- web/pages/home.tsx | 35 ++++++++++++++-------------------- 4 files changed, 21 insertions(+), 29 deletions(-) diff --git a/web/components/nav/nav-bar.tsx b/web/components/nav/nav-bar.tsx index f92f6630..cab369fb 100644 --- a/web/components/nav/nav-bar.tsx +++ b/web/components/nav/nav-bar.tsx @@ -137,7 +137,7 @@ export function MobileSidebar(props: {

- +
diff --git a/web/components/nav/sidebar.tsx b/web/components/nav/sidebar.tsx index 80376b6c..f08403df 100644 --- a/web/components/nav/sidebar.tsx +++ b/web/components/nav/sidebar.tsx @@ -110,7 +110,8 @@ function MoreButton() { ) } -export default function Sidebar() { +export default function Sidebar(props: { className?: string }) { + const { className } = props const router = useRouter() const currentPage = router.pathname @@ -124,7 +125,7 @@ export default function Sidebar() { user === null ? signedOutMobileNavigation : mobileNavigation return ( -