diff --git a/functions/package.json b/functions/package.json index b0d8e458..b6c1bb5c 100644 --- a/functions/package.json +++ b/functions/package.json @@ -25,14 +25,15 @@ "main": "functions/src/index.js", "dependencies": { "@amplitude/node": "1.10.0", + "@floating-ui/react-dom": "1.0.0", "@google-cloud/functions-framework": "3.1.2", "@tiptap/core": "2.0.0-beta.181", "@tiptap/extension-image": "2.0.0-beta.30", "@tiptap/extension-link": "2.0.0-beta.43", "@tiptap/extension-mention": "2.0.0-beta.102", "@tiptap/starter-kit": "2.0.0-beta.190", - "dayjs": "1.11.4", "cors": "2.8.5", + "dayjs": "1.11.4", "express": "4.18.1", "firebase-admin": "10.0.0", "firebase-functions": "3.21.2", diff --git a/web/components/contract/contract-card.tsx b/web/components/contract/contract-card.tsx index 248c3863..ac1a2fa2 100644 --- a/web/components/contract/contract-card.tsx +++ b/web/components/contract/contract-card.tsx @@ -31,6 +31,7 @@ import { useUser } from 'web/hooks/use-user' import { track } from '@amplitude/analytics-browser' import { trackCallback } from 'web/lib/service/analytics' import { getMappedValue } from 'common/pseudo-numeric' +import { Tooltip } from '../tooltip' export function ContractCard(props: { contract: Contract @@ -333,22 +334,19 @@ export function PseudoNumericResolutionOrExpectation(props: { {resolution === 'CANCEL' ? ( ) : ( -
+ {formatLargeNumber(value)} -
+ )} ) : ( <> -
{formatLargeNumber(value)} -
+
expected
)} diff --git a/web/components/datetime-tooltip.tsx b/web/components/datetime-tooltip.tsx index 7f7a9b45..7aaf61aa 100644 --- a/web/components/datetime-tooltip.tsx +++ b/web/components/datetime-tooltip.tsx @@ -1,9 +1,8 @@ -import React from 'react' import dayjs from 'dayjs' import utc from 'dayjs/plugin/utc' import timezone from 'dayjs/plugin/timezone' import advanced from 'dayjs/plugin/advancedFormat' -import { ClientRender } from './client-render' +import { Tooltip } from './tooltip' dayjs.extend(utc) dayjs.extend(timezone) @@ -13,23 +12,16 @@ export function DateTimeTooltip(props: { time: number text?: string children?: React.ReactNode + noTap?: boolean }) { - const { time, text } = props + const { time, text, noTap } = props const formattedTime = dayjs(time).format('MMM DD, YYYY hh:mm a z') const toolTip = text ? `${text} ${formattedTime}` : formattedTime return ( - <> - - - {props.children} - - - {props.children} - + + {props.children} + ) } diff --git a/web/components/editor.tsx b/web/components/editor.tsx index 74f608aa..f4166f27 100644 --- a/web/components/editor.tsx +++ b/web/components/editor.tsx @@ -30,6 +30,7 @@ import { } from '@heroicons/react/solid' import { MarketModal } from './editor/market-modal' import { insertContent } from './editor/utils' +import { Tooltip } from './tooltip' const DisplayImage = Image.configure({ HTMLAttributes: { @@ -146,15 +147,15 @@ export function TextEditor(props: { {/* Toolbar, with buttons for images and embeds */}
-
+ -
-
+ + -
-
+ + -
+ {/* Spacer that also focuses editor on click */}
- + copyLinkToComment(event)} diff --git a/web/components/info-tooltip.tsx b/web/components/info-tooltip.tsx index 0eabffed..1c12d8e2 100644 --- a/web/components/info-tooltip.tsx +++ b/web/components/info-tooltip.tsx @@ -1,10 +1,11 @@ import { InformationCircleIcon } from '@heroicons/react/outline' +import { Tooltip } from './tooltip' export function InfoTooltip(props: { text: string }) { const { text } = props return ( -
+ -
+ ) } diff --git a/web/components/outcome-label.tsx b/web/components/outcome-label.tsx index a6c3a563..85e171d8 100644 --- a/web/components/outcome-label.tsx +++ b/web/components/outcome-label.tsx @@ -1,5 +1,4 @@ import clsx from 'clsx' -import { ReactNode } from 'react' import { Answer } from 'common/answer' import { getProbability } from 'common/calculate' import { getValueFromBucket } from 'common/calculate-dpm' @@ -11,7 +10,7 @@ import { resolution, } from 'common/contract' import { formatLargeNumber, formatPercent } from 'common/util/format' -import { ClientRender } from './client-render' +import { Tooltip } from './tooltip' export function OutcomeLabel(props: { contract: Contract @@ -91,13 +90,13 @@ export function FreeResponseOutcomeLabel(props: { const chosen = contract.answers?.find((answer) => answer.id === resolution) if (!chosen) return return ( - + - + ) } @@ -174,23 +173,3 @@ export function AnswerLabel(props: { ) } - -function FreeResponseAnswerToolTip(props: { - text: string - children?: ReactNode -}) { - const { text } = props - return ( - <> - - - {props.children} - - - {props.children} - - ) -} diff --git a/web/components/tipper.tsx b/web/components/tipper.tsx index 1c76c3e7..dbacbee9 100644 --- a/web/components/tipper.tsx +++ b/web/components/tipper.tsx @@ -103,8 +103,10 @@ function DownTip(props: { onClick?: () => void }) { const { onClick } = props return (