diff --git a/web/components/button.tsx b/web/components/button.tsx index cb39cba8..b27f43a4 100644 --- a/web/components/button.tsx +++ b/web/components/button.tsx @@ -11,6 +11,7 @@ export type ColorType = | 'gray' | 'gradient' | 'gray-white' + | 'highlight-blue' export function Button(props: { className?: string @@ -56,8 +57,9 @@ export function Button(props: { color === 'gradient' && 'border-none bg-gradient-to-r from-indigo-500 to-blue-500 text-white hover:from-indigo-700 hover:to-blue-700', color === 'gray-white' && - 'border-none bg-white text-gray-500 shadow-none hover:bg-gray-200', - className + 'text-greyscale-6 hover:bg-greyscale-2 border-none shadow-none', + color === 'highlight-blue' && + 'text-highlight-blue border-none shadow-none' )} disabled={disabled} onClick={onClick} diff --git a/web/components/contract/contract-card.tsx b/web/components/contract/contract-card.tsx index dab92a7a..24658342 100644 --- a/web/components/contract/contract-card.tsx +++ b/web/components/contract/contract-card.tsx @@ -106,7 +106,7 @@ export function ContractCard(props: { <> {outcomeType === 'BINARY' && ( )} diff --git a/web/components/contract/contract-details.tsx b/web/components/contract/contract-details.tsx index c383d349..f0f24eae 100644 --- a/web/components/contract/contract-details.tsx +++ b/web/components/contract/contract-details.tsx @@ -18,7 +18,7 @@ import { Avatar } from '../avatar' import { useState } from 'react' import { ContractInfoDialog } from './contract-info-dialog' import NewContractBadge from '../new-contract-badge' -import { UserFollowButton } from '../follow-button' +import { MiniUserFollowButton, UserFollowButton } from '../follow-button' import { DAY_MS } from 'common/util/time' import { useUser } from 'web/hooks/use-user' import { exhibitExts } from 'common/util/parse' @@ -34,6 +34,8 @@ import { UserLink } from 'web/components/user-link' import { FeaturedContractBadge } from 'web/components/contract/featured-contract-badge' import { Tooltip } from 'web/components/tooltip' import { useWindowSize } from 'web/hooks/use-window-size' +import { ExtraContractActionsRow } from './extra-contract-actions-row' +import { PlusCircleIcon } from '@heroicons/react/solid' export type ShowTime = 'resolve-date' | 'close-date' @@ -133,8 +135,10 @@ export function ContractDetails(props: { isMobile ? 'max-w-[140px]' : 'max-w-[250px]' )} > - - {groupToDisplay.name} + {/* */} +
+ {groupToDisplay.name} +
) : ( @@ -145,100 +149,111 @@ export function ContractDetails(props: { onClick={() => !groupToDisplay && setOpen(true)} > - - No Group + {/* */} +
+ No Group +
) return ( - - - - {disabled ? ( - creatorName - ) : ( - - )} - {!disabled && } - - - {disabled ? ( - groupInfo - ) : !groupToDisplay && !user ? ( -
- ) : ( - - {groupInfo} - {user && groupToDisplay && ( - - )} - - )} - - - - - - - - {(!!closeTime || !!resolvedDate) && ( - - {resolvedDate && resolutionTime ? ( - <> - - - {resolvedDate} - - - ) : null} - - {!resolvedDate && closeTime && user && ( - <> - - - - )} - + + + {!disabled && ( +
+ +
)} - {user && ( - <> - - -
{volumeLabel}
-
- {!disabled && ( - + + {disabled ? ( + creatorName + ) : ( + )} - - )} + + + {(!!closeTime || !!resolvedDate) && ( + + {resolvedDate && resolutionTime ? ( + <> + + +
resolved 
+ {resolvedDate} +
+
+ + ) : null} + + {!resolvedDate && closeTime && user && ( + +
Closes 
+ +
+ )} +
+ )} + {/* + {disabled ? ( + groupInfo + ) : !groupToDisplay && !user ? ( +
+ ) : ( + + {groupInfo} + {user && groupToDisplay && ( + + )} + + )} + + + + + + */} + {/* {user && ( + <> + + +
{volumeLabel}
+
+ + )} */} + + +
+ +
) } @@ -280,12 +295,12 @@ export function ExtraMobileContractDetails(props: { !resolvedDate && closeTime && ( + Closes  - Ends ) )} diff --git a/web/components/contract/contract-info-dialog.tsx b/web/components/contract/contract-info-dialog.tsx index ae586725..f5f5cfd0 100644 --- a/web/components/contract/contract-info-dialog.tsx +++ b/web/components/contract/contract-info-dialog.tsx @@ -18,6 +18,7 @@ import { deleteField } from 'firebase/firestore' import ShortToggle from '../widgets/short-toggle' import { DuplicateContractButton } from '../copy-contract-button' import { Row } from '../layout/row' +import { Button } from '../button' export const contractDetailsButtonClassName = 'group flex items-center rounded-md px-3 py-2 text-sm font-medium cursor-pointer hover:bg-gray-100 text-gray-400 hover:text-gray-500' @@ -67,15 +68,17 @@ export function ContractInfoDialog(props: { return ( <> - + diff --git a/web/components/contract/contract-overview.tsx b/web/components/contract/contract-overview.tsx index 1bfe84de..1852a77c 100644 --- a/web/components/contract/contract-overview.tsx +++ b/web/components/contract/contract-overview.tsx @@ -29,7 +29,7 @@ import { ContractDetails, ExtraMobileContractDetails } from './contract-details' import { NumericGraph } from './numeric-graph' const OverviewQuestion = (props: { text: string }) => ( - + ) const BetWidget = (props: { contract: CPMMContract }) => { @@ -75,17 +75,15 @@ const BinaryOverview = (props: { contract: BinaryContract; bets: Bet[] }) => { - - - - + + - + {/* */} {tradingAllowed(contract) && ( )} @@ -113,10 +111,10 @@ const ChoiceOverview = (props: { - + /> */} ) @@ -140,7 +138,7 @@ const PseudoNumericOverview = (props: { - + {/* */} {tradingAllowed(contract) && } diff --git a/web/components/contract/extra-contract-actions-row.tsx b/web/components/contract/extra-contract-actions-row.tsx index 5d5ee4d8..5b592aa2 100644 --- a/web/components/contract/extra-contract-actions-row.tsx +++ b/web/components/contract/extra-contract-actions-row.tsx @@ -23,26 +23,27 @@ export function ExtraContractActionsRow(props: { contract: Contract }) { const [isShareOpen, setShareOpen] = useState(false) const [openCreateChallengeModal, setOpenCreateChallengeModal] = useState(false) - const showChallenge = - user && outcomeType === 'BINARY' && !resolution && CHALLENGES_ENABLED + // const showChallenge = + // user && outcomeType === 'BINARY' && !resolution && CHALLENGES_ENABLED return ( - + + {/* + {user?.id !== contract.creatorId && ( + + )} */} - {showChallenge && ( + {/* {showChallenge && ( - )} - - - {user?.id !== contract.creatorId && ( - - )} - + )} */} + diff --git a/web/components/contract/like-market-button.tsx b/web/components/contract/like-market-button.tsx index e35e3e7e..c5e596d8 100644 --- a/web/components/contract/like-market-button.tsx +++ b/web/components/contract/like-market-button.tsx @@ -38,15 +38,16 @@ export function LikeMarketButton(props: { return ( ) diff --git a/web/components/follow-button.tsx b/web/components/follow-button.tsx index 09495169..693017a8 100644 --- a/web/components/follow-button.tsx +++ b/web/components/follow-button.tsx @@ -1,8 +1,11 @@ +import { PlusCircleIcon } from '@heroicons/react/solid' import clsx from 'clsx' import { useFollows } from 'web/hooks/use-follows' import { useUser } from 'web/hooks/use-user' import { follow, unfollow } from 'web/lib/firebase/users' import { withTracking } from 'web/lib/service/analytics' +import { Button } from './button' +import { Col } from './layout/col' export function FollowButton(props: { isFollowing: boolean | undefined @@ -69,3 +72,64 @@ export function UserFollowButton(props: { userId: string; small?: boolean }) { /> ) } + +// export function MiniFollowButton(props: { +// isFollowing: boolean | undefined +// onFollow: () => void +// onUnfollow: () => void +// className?: string +// }) { +// const { isFollowing, onFollow, className } = props + +// const user = useUser() + +// if (isFollowing || !user || isFollowing === undefined) { +// return <> +// } + +// return ( +// +// ) +// } + +export function MiniUserFollowButton(props: { userId: string }) { + const { userId } = props + const currentUser = useUser() + const following = useFollows(currentUser?.id) + const isFollowing = following?.includes(userId) + const user = useUser() + + if ( + !currentUser || + currentUser.id === userId || + isFollowing || + !user || + isFollowing === undefined + ) + return null + + return ( + <> + + + ) +} diff --git a/web/components/follow-market-button.tsx b/web/components/follow-market-button.tsx index 1dd261cb..0e65165b 100644 --- a/web/components/follow-market-button.tsx +++ b/web/components/follow-market-button.tsx @@ -25,7 +25,7 @@ export const FollowMarketButton = (props: { return (