From e4c95083400a852c055468c10e271cab81d72c27 Mon Sep 17 00:00:00 2001 From: Austin Chen Date: Wed, 16 Mar 2022 21:42:24 -0700 Subject: [PATCH] Show "Buy" and % directly in FR feed --- web/components/answers/answer-bet-panel.tsx | 18 +++++-- web/components/feed/feed-items.tsx | 60 ++++++++++++++++++--- web/components/yes-no-selector.tsx | 14 +++-- 3 files changed, 78 insertions(+), 14 deletions(-) diff --git a/web/components/answers/answer-bet-panel.tsx b/web/components/answers/answer-bet-panel.tsx index e426c370..fa508937 100644 --- a/web/components/answers/answer-bet-panel.tsx +++ b/web/components/answers/answer-bet-panel.tsx @@ -31,8 +31,9 @@ export function AnswerBetPanel(props: { contract: FullContract closePanel: () => void className?: string + isModal?: boolean }) { - const { answer, contract, closePanel, className } = props + const { answer, contract, closePanel, className, isModal } = props const { id: answerId } = answer const user = useUser() @@ -99,11 +100,18 @@ export function AnswerBetPanel(props: { return ( -
Buy this answer
+
+ Buy {isModal ? `"${answer.text}"` : 'this answer'} +
- + {!isModal && ( + + )}
Amount
+ + setOpen(false)} + className="sm:max-w-84 !rounded-md bg-white !px-8 !py-6" + isModal={true} + /> + +
@@ -674,9 +693,29 @@ function FeedAnswerGroup(props: {
answered
- - - + + + + + + + + + {probPercent} + + { + setOpen(true) + }} + /> + + @@ -699,6 +738,15 @@ function FeedAnswerGroup(props: {
))} + +
+ { + setOpen(true) + }} + /> +
) } diff --git a/web/components/yes-no-selector.tsx b/web/components/yes-no-selector.tsx index cb7ecee4..3c4fbfef 100644 --- a/web/components/yes-no-selector.tsx +++ b/web/components/yes-no-selector.tsx @@ -158,10 +158,18 @@ export function FundsSelector(props: { export function BuyButton(props: { className?: string; onClick?: () => void }) { const { className, onClick } = props + // Note: styles coppied from YesNoSelector return ( - + ) }