Skip to content

Commit

Permalink
Fix weird colors/edges on table column corners on info page (#850)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrohasf authored Feb 28, 2025
1 parent b0c7876 commit 0351672
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 35 deletions.
6 changes: 3 additions & 3 deletions src/app/info/components/ContractList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const ContractList = () => {
<TableRow>
<TableHead
colSpan={4}
className="font-semibold text-secondary bg-wash rounded-t-xl"
className="font-semibold text-secondary bg-wash rounded-t-lg"
>
Contracts
</TableHead>
Expand All @@ -43,7 +43,7 @@ const ContractList = () => {
<TableRow key={index}>
<TableCell
className={`pr-1 font-semibold text-secondary ${
index === list.length - 1 && "rounded-bl-xl"
index === list.length - 1 && "rounded-bl-lg"
}`}
>
{contract.title}
Expand All @@ -52,7 +52,7 @@ const ContractList = () => {
{contract.address}
</TableCell>
<TableCell
className={`px-1 ${index === list.length - 1 && "rounded-br-xl"}`}
className={`px-1 ${index === list.length - 1 && "rounded-br-lg"}`}
>
<Link
href={getBlockScanAddress(contract.address)}
Expand Down
4 changes: 2 additions & 2 deletions src/app/info/components/GovernorSettingsParams.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ const GovernorSettingsParams = () => {
<Table>
<TableHeader>
<TableRow>
<TableHead className="text-base font-semibold text-left text-secondary bg-wash rounded-tl-xl">
<TableHead className="text-base font-semibold text-left text-secondary bg-wash rounded-tl-lg">
Parameter
</TableHead>
<TableHead className="text-base font-semibold text-secondary text-right bg-wash rounded-tr-xl">
<TableHead className="text-base font-semibold text-secondary text-right bg-wash rounded-tr-lg">
Value
</TableHead>
</TableRow>
Expand Down
65 changes: 35 additions & 30 deletions src/app/info/components/GovernorSettingsProposalTypes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
TooltipTrigger,
} from "@/components/ui/tooltip";
import { QuestionMarkCircleIcon } from "@heroicons/react/20/solid";
import { formatNumber } from "@/lib/tokenUtils";
import { cn } from "@/lib/utils";

const GovernorSettingsProposalTypes = ({
proposalTypes,
Expand Down Expand Up @@ -54,11 +54,13 @@ const GovernorSettingsProposalTypes = ({
functionName: "proposalThreshold",
}) as { data: bigint | undefined; isFetched: boolean };

const showQuorum = isQuorumSupportedByGovernor || proposalTypes.length > 0;

return (
<Table>
<TableHeader>
<TableRow className="text-base font-semibold text-left text-secondary bg-wash">
<TableHead colSpan={3} className="rounded-tl-xl text-secondary">
<TableHead colSpan={3} className="text-secondary rounded-tl-lg">
<TooltipProvider>
<Tooltip>
<TooltipTrigger className="flex flex-row space-x-1 items-center">
Expand All @@ -72,7 +74,7 @@ const GovernorSettingsProposalTypes = ({
</Tooltip>
</TooltipProvider>
</TableHead>
<TableHead colSpan={3} className="rounded-tl-xl text-secondary">
<TableHead colSpan={3} className="text-secondary">
<TooltipProvider>
<Tooltip>
<TooltipTrigger className="flex flex-row space-x-1 items-center">
Expand All @@ -87,7 +89,7 @@ const GovernorSettingsProposalTypes = ({
</TableHead>
<TableHead
colSpan={4}
className={`text-secondary ${isQuorumSupportedByGovernor ? "rounded-none" : "rounded-tr-xl"}`}
className={cn("text-secondary", showQuorum ? "" : "rounded-tr-lg")}
>
<TooltipProvider>
<Tooltip>
Expand All @@ -102,8 +104,8 @@ const GovernorSettingsProposalTypes = ({
</Tooltip>
</TooltipProvider>
</TableHead>
{(isQuorumSupportedByGovernor || proposalTypes.length > 0) && (
<TableHead colSpan={4} className="text-secondary rounded-tr-xl">
{showQuorum && (
<TableHead colSpan={4} className="text-secondary rounded-tr-lg">
<TooltipProvider>
<Tooltip>
<TooltipTrigger className="flex flex-row space-x-1 items-center">
Expand All @@ -124,50 +126,50 @@ const GovernorSettingsProposalTypes = ({
<TableBody>
{isQuorumSupportedByGovernor && (
<TableRow className="text-base font-semibold text-secondary">
<TableCell colSpan={3} className="rounded-bl-xl">
<TableCell
className={cn(!proposalTypes?.length && "rounded-bl-lg")}
colSpan={3}
>
Default
</TableCell>
<TableCell colSpan={4}>
{isThresholdFetched && threshold !== undefined && (
<TokenAmountDecorated
amount={BigInt(threshold.toString())}
currency={token.symbol}
decimals={token.decimals}
/>
)}
</TableCell>
<TableCell
className={cn(!proposalTypes?.length && "rounded-br-lg")}
colSpan={4}
className={`${isQuorumSupportedByGovernor ? "rounded-none" : "rounded-br-xl"}`}
>
{isThresholdFetched && threshold !== undefined && (
{isQuorumFetched && quorum && (
<TokenAmountDecorated
amount={BigInt(threshold.toString())}
amount={BigInt(quorum.toString())}
currency={token.symbol}
decimals={token.decimals}
/>
)}
</TableCell>
{isQuorumSupportedByGovernor && (
<TableCell colSpan={4} className="rounded-br-xl">
{isQuorumFetched && quorum && (
<TokenAmountDecorated
amount={BigInt(quorum.toString())}
currency={token.symbol}
decimals={token.decimals}
/>
)}
</TableCell>
)}
</TableRow>
)}
{proposalTypes.map((proposalType) => (
{proposalTypes.map((proposalType, i) => (
<TableRow
key={`proposal-type-${proposalType.id}`}
className="text-base font-semibold text-secondary"
>
<TableCell colSpan={3} className="rounded-bl-xl">
{proposalType.name}
</TableCell>

<TableCell
colSpan={4}
className={`${isQuorumSupportedByGovernor ? "rounded-none" : "rounded-br-xl"}`}
className={cn(i === proposalTypes.length - 1 && "rounded-bl-lg")}
colSpan={3}
>
{proposalType.name}
</TableCell>
<TableCell colSpan={4}>
{Number(proposalType.approval_threshold) / 100} %
</TableCell>
<TableCell colSpan={3} className="rounded-bl-xl">
<TableCell colSpan={3}>
{isThresholdFetched && threshold !== undefined && (
<TokenAmountDecorated
amount={BigInt(threshold.toString())}
Expand All @@ -176,7 +178,10 @@ const GovernorSettingsProposalTypes = ({
/>
)}
</TableCell>
<TableCell colSpan={4} className="rounded-br-xl">
<TableCell
className={cn(i === proposalTypes.length - 1 && "rounded-br-lg")}
colSpan={4}
>
{Number(proposalType.quorum) / 100} %
</TableCell>
</TableRow>
Expand Down

0 comments on commit 0351672

Please sign in to comment.