Skip to content

Commit

Permalink
Merge pull request #2410 from zeitgeistpm/tr-caseid-fix
Browse files Browse the repository at this point in the history
Court fixes
  • Loading branch information
Robiquet authored May 28, 2024
2 parents b6c4bd8 + d512ff3 commit d2b7a18
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
27 changes: 17 additions & 10 deletions components/markets/MarketHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import { MdModeEdit, MdOutlineHistory } from "react-icons/md";
import { AddressDetails } from "./MarketAddresses";
import { MarketTimer, MarketTimerSkeleton } from "./MarketTimer";
import { MarketPromotionCallout } from "./PromotionCallout";
import Link from "next/link";

export const QuillViewer = dynamic(
() => import("../../components/ui/QuillViewer"),
Expand Down Expand Up @@ -140,7 +141,9 @@ const MarketOutcome: FC<
<div className="flex flex-1 gap-2 rounded-lg bg-gray-200 px-5 py-3">
<span className="text-gray-400">By: </span>
<div className="flex items-center">
<UserIdentity user={by} />
<Link href={`/portfolio/${by}`}>
<UserIdentity user={by} />
</Link>
</div>
</div>
)}
Expand Down Expand Up @@ -236,10 +239,12 @@ const MarketHistory: FC<
<span className="inline font-medium">
<span className="font-bold">
{marketHistory?.reported?.by ? (
<UserIdentity
user={marketHistory.reported.by}
className="items-baseline"
/>
<Link href={`/portfolio/${marketHistory.reported.by}`}>
<UserIdentity
user={marketHistory.reported.by}
className="items-baseline"
/>
</Link>
) : (
"Unknown"
)}
Expand Down Expand Up @@ -270,10 +275,12 @@ const MarketHistory: FC<
<span className="inline font-medium">
<span className="font-bold">
{dispute?.by ? (
<UserIdentity
user={dispute?.by}
className="items-baseline"
/>
<Link href={`/portfolio/${dispute.by}`}>
<UserIdentity
user={dispute?.by}
className="items-baseline"
/>
</Link>
) : (
"Unknown"
)}
Expand Down Expand Up @@ -631,7 +638,7 @@ const MarketHeader: FC<{
{marketStage?.type === "Court" ? (
<div className="w-full">
<h3 className="mb-2 text-sm text-gray-700">Market is in court</h3>
{caseId ? (
{caseId != null ? (
<CourtStageTimer caseId={caseId} />
) : (
<Skeleton height={22} className="w-full rounded-md" />
Expand Down
2 changes: 1 addition & 1 deletion lib/hooks/queries/court/useCourtVoteDraws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const useCourtVoteDrawsForCase = (caseId?: number) => {
const [sdk, id] = useSdkv2();
const queryClient = useQueryClient();

const enabled = !!sdk && isRpcSdk(sdk) && caseId;
const enabled = !!sdk && isRpcSdk(sdk) && caseId != null;

const query = useQuery<ZrmlCourtDraw[]>(
[id, voteDrawsRootKey, caseId],
Expand Down
6 changes: 3 additions & 3 deletions pages/court/[caseid].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,8 @@ const CasePage: NextPage = ({
View Market
</Link>

<div className="flex items-start gap-4">
<div>
<div className="flex w-full items-start gap-4">
<div className="flex w-full flex-col">
<div className="relative mb-6 flex items-center gap-3">
<AddressDetails title="Creator" address={market.creator} />

Expand Down Expand Up @@ -428,7 +428,7 @@ const CasePage: NextPage = ({
</div>
</div>

<div className="mb-6 md:max-w-[900px]">
<div className="mb-6 w-full">
<CourtStageTimer caseId={caseId} market={market} />
</div>
</div>
Expand Down

0 comments on commit d2b7a18

Please sign in to comment.