Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

heirarchy #2859

Merged
merged 2 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions web/components/contract/contract-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ export function AuthorInfo(props: {
contract: Contract
resolverId?: string // live updated
className?: string
userNameClass?: string
}) {
const { contract, resolverId, className } = props
const { contract, resolverId, className, userNameClass } = props
const { creatorId, creatorName, creatorUsername, creatorAvatarUrl } = contract
const resolver = useDisplayUserById(resolverId)
return (
Expand All @@ -38,7 +39,7 @@ export function AuthorInfo(props: {
size={'xs'}
/>
</UserHovercard>
<UserHovercard userId={creatorId}>
<UserHovercard userId={creatorId} className={userNameClass}>
<UserLink
user={{
id: creatorId,
Expand Down
59 changes: 23 additions & 36 deletions web/components/contract/twomba-contract-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,6 @@ export function TwombaContractPageContent(props: ContractParams) {
<Col className="w-full gap-3 lg:gap-4">
<Col>
<div ref={titleRef}>
<AuthorInfo
contract={props.contract}
resolverId={liveContract.resolverId}
className="text-ink-600 mb-0.5"
/>
<VisibilityIcon
contract={props.contract}
isLarge
Expand All @@ -342,17 +337,14 @@ export function TwombaContractPageContent(props: ContractParams) {
canEdit={isAdmin || isCreator || isMod}
/>
</div>
<Row className="items-center gap-2">
<MarketTopics
contract={props.contract}
dashboards={dashboards}
topics={topics}
isSpiceMarket={isSpiceMarket}
/>
</Row>
</Col>

<div className="text-ink-600 flex flex-wrap items-center justify-end gap-y-1 text-sm">
<Row className="text-ink-600 items-center justify-between gap-y-1 text-sm">
<AuthorInfo
contract={props.contract}
resolverId={liveContract.resolverId}
userNameClass={'hidden sm:block'}
/>
<TwombaContractSummaryStats
contractId={props.contract.id}
creatorId={props.contract.creatorId}
Expand All @@ -361,7 +353,7 @@ export function TwombaContractPageContent(props: ContractParams) {
editable={isCreator || isAdmin || isMod}
isCashContract={liveContract.token === 'CASH'}
/>
</div>
</Row>
<ContractOverview
contract={liveContract}
key={liveContract.id} // reset state when switching play vs cash
Expand Down Expand Up @@ -390,14 +382,6 @@ export function TwombaContractPageContent(props: ContractParams) {

<YourTrades contract={liveContract} yourNewBets={yourNewBets} />
</Col>
{showRelatedMarketsBelowBet && (
<RelatedContractsGrid
contracts={relatedMarkets}
loadMore={loadMore}
showOnlyAfterBet={true}
justBet={justBet}
/>
)}
{showReview && user && (
<div className="relative my-2">
<ReviewPanel
Expand Down Expand Up @@ -444,6 +428,15 @@ export function TwombaContractPageContent(props: ContractParams) {
hasReviewed={!!userHasReviewed}
/>
<ContractDescription contract={livePlayContract} />
<Row className="items-center gap-2">
<MarketTopics
contract={props.contract}
dashboards={dashboards}
topics={topics}
isSpiceMarket={isSpiceMarket}
/>
</Row>

<Row className="my-2 flex-wrap items-center justify-between gap-y-2"></Row>
{!user && <SidebarSignUpButton className="mb-4 flex md:hidden" />}
{!!user && (
Expand All @@ -455,19 +448,7 @@ export function TwombaContractPageContent(props: ContractParams) {
contract={props.contract}
/>
)}
{showExplainerPanel && (
<div className="bg-canvas-50 -mx-4 p-4 pb-0 md:-mx-8 xl:hidden">
<h2 className={clsx('text-ink-600 text-xl')}>What is this?</h2>
<ExplainerPanel />
</div>
)}
{comments.length > 3 && (
<RelatedContractsGrid
contracts={relatedMarkets}
loadMore={loadMore}
justBet={!showRelatedMarketsBelowBet && justBet}
/>
)}

{isResolved && resolution !== 'CANCEL' && (
<>
<ContractLeaderboard
Expand Down Expand Up @@ -507,6 +488,12 @@ export function TwombaContractPageContent(props: ContractParams) {
betReplies={betReplies}
/>
</div>
{showExplainerPanel && (
<div className="bg-canvas-50 -mx-4 p-4 pb-0 md:-mx-8 xl:hidden">
<h2 className={clsx('text-ink-600 text-xl')}>What is this?</h2>
<ExplainerPanel />
</div>
)}
<RelatedContractsGrid
contracts={relatedMarkets}
loadMore={loadMore}
Expand Down
Loading