Skip to content
Snippets Groups Projects
Commit ced101cb authored by Lukas's avatar Lukas
Browse files

Change border from top to bottom

parent d75a92e1
Branches
Tags
1 merge request!389Change border from top to bottom
Pipeline #101693 failed
import { ReactNode, Fragment } from "react";
import { Card, CardContent, CardHeader } from "../ui/card";
import { Table, TableBody, TableCell, TableRow } from "../ui/table";
import { cn, formatNumber } from "@/lib/utils";
import { formatNumber } from "@/lib/utils";
import { convertVestsToHP, convertHiveToUSD } from "@/utils/Calculations";
import useDynamicGlobal from "@/api/homePage/useDynamicGlobal";
import { useHiveChainContext } from "@/contexts/HiveChainContext";
......@@ -41,14 +41,7 @@ const buildTableBody = (
if (cardNameMap.has(param)) {
return (
<Fragment key={index}>
<TableRow
className={cn(
{
"border-t border-gray-700": !!index,
},
"hover:bg-inherit"
)}
>
<TableRow className="border-b border-gray-700 hover:bg-inherit">
<TableCell>{cardNameMap.get(param)}</TableCell>
<TableCell className="text-right">{render_key(param)}</TableCell>
<TableCell className="text-right">{convert_usd(param)}</TableCell>
......
......@@ -3,7 +3,6 @@ import { ReactNode, useState, Fragment } from "react";
import { ArrowDown, ArrowUp } from "lucide-react";
import { Card, CardContent, CardHeader } from "../ui/card";
import { Table, TableBody, TableCell, TableRow } from "../ui/table";
import { cn } from "@/lib/utils";
import CopyToKeyboard from "../CopyToKeyboard";
import { convertVestsToHP } from "@/utils/Calculations";
import useDynamicGlobal from "@/api/homePage/useDynamicGlobal";
......@@ -35,14 +34,7 @@ const buildTableBody = (
} else {
return (
<Fragment key={index}>
<TableRow
className={cn(
{
"border-t border-gray-700": !!index,
},
"hover:bg-inherit"
)}
>
<TableRow className={"border-b border-gray-700 hover:bg-inherit"}>
<TableCell>{key}</TableCell>
<TableCell>{render_key(key)}</TableCell>
</TableRow>
......
......@@ -3,7 +3,6 @@ import { ArrowDown, ArrowUp } from "lucide-react";
import Link from "next/link";
import { Card, CardContent, CardHeader } from "../ui/card";
import { Table, TableBody, TableRow, TableCell } from "../ui/table";
import { cn } from "@/lib/utils";
import useRcDelegations from "@/api/common/useRcDelegations";
import { formatNumber } from "@/lib/utils";
type RcDelegation = {
......@@ -21,22 +20,19 @@ const buildTableBody = (delegations: RcDelegation[]) => {
const isLast = index === delegations.length - 1;
return (
<Fragment key={index}>
<TableRow
className={cn(
{
"border-t border-gray-700": index !== 0,
"border-b border-gray-700": !isLast,
},
"hover:bg-inherit"
)}
>
<TableRow className={"border-b border-gray-700 hover:bg-inherit"}>
<TableCell>{index + 1}</TableCell>
<TableCell className="text-right">
<Link className="text-blue-400" href={`/@${delegation.to}`}>
<Link
className="text-blue-400"
href={`/@${delegation.to}`}
>
{delegation.to}
</Link>
</TableCell>
<TableCell className="text-right">{formatNumber(delegation.delegated_rc, false, true)}</TableCell>
<TableCell className="text-right">
{formatNumber(delegation.delegated_rc, false, true)}
</TableCell>
</TableRow>
</Fragment>
);
......@@ -48,11 +44,8 @@ const AccountRcDelegationsCard: React.FC<AccountRcDelegationsCardProps> = ({
limit,
}) => {
const [isPropertiesHidden, setIsPropertiesHidden] = useState(true);
const {
rcDelegationsData,
isRcDelegationsLoading,
isRcDelegationsError,
} = useRcDelegations(delegatorAccount, limit);
const { rcDelegationsData, isRcDelegationsLoading, isRcDelegationsError } =
useRcDelegations(delegatorAccount, limit);
if (isRcDelegationsLoading) {
return <div></div>;
......@@ -70,7 +63,10 @@ const AccountRcDelegationsCard: React.FC<AccountRcDelegationsCardProps> = ({
};
return (
<Card data-testid="rc-delegations-dropdown" className="overflow-hidden">
<Card
data-testid="rc-delegations-dropdown"
className="overflow-hidden"
>
<CardHeader className="p-0">
<div
onClick={handlePropertiesVisibility}
......@@ -89,4 +85,4 @@ const AccountRcDelegationsCard: React.FC<AccountRcDelegationsCardProps> = ({
);
};
export default AccountRcDelegationsCard;
\ No newline at end of file
export default AccountRcDelegationsCard;
......@@ -3,7 +3,6 @@ import { ArrowDown, ArrowUp } from "lucide-react";
import Link from "next/link";
import { Card, CardContent, CardHeader } from "../ui/card";
import { Table, TableBody, TableRow, TableCell } from "../ui/table";
import { cn } from "@/lib/utils";
import useVestingDelegations from "@/api/common/useVestingDelegations";
import { formatNumber } from "@/lib/utils";
......@@ -23,32 +22,27 @@ const buildTableBody = (delegations: VestingDelegation[]) => {
const isLast = index === delegations.length - 1;
return (
<Fragment key={index}>
<TableRow
className={cn(
{
"border-t border-gray-700": index !== 0,
"border-b border-gray-700": !isLast,
},
"hover:bg-inherit"
)}
>
<TableRow className={"border-b border-gray-700 hover:bg-inherit"}>
<TableCell>{index + 1}</TableCell>
<TableCell className="text-right">
<Link className="text-blue-400" href={`/@${delegation.delegatee}`}>
<Link
className="text-blue-400"
href={`/@${delegation.delegatee}`}
>
{delegation.delegatee}
</Link>
</TableCell>
<TableCell className="text-right">{formatNumber(parseFloat(delegation.vesting_shares),true, true)}</TableCell>
<TableCell className="text-right">
{formatNumber(parseFloat(delegation.vesting_shares), true, true)}
</TableCell>
</TableRow>
</Fragment>
);
});
};
const AccountVestingDelegationsCard: React.FC<AccountVestingDelegationsCardProps> = ({
delegatorAccount,
startAccount,
limit,
}) => {
const AccountVestingDelegationsCard: React.FC<
AccountVestingDelegationsCardProps
> = ({ delegatorAccount, startAccount, limit }) => {
const [isPropertiesHidden, setIsPropertiesHidden] = useState(true);
const {
vestingDelegationsData,
......@@ -72,7 +66,10 @@ const AccountVestingDelegationsCard: React.FC<AccountVestingDelegationsCardProps
};
return (
<Card data-testid="vesting-delegations-dropdown" className="overflow-hidden">
<Card
data-testid="vesting-delegations-dropdown"
className="overflow-hidden"
>
<CardHeader className="p-0">
<div
onClick={handlePropertiesVisibility}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment