Skip to content

Commit

Permalink
upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
alecananian committed Sep 27, 2024
1 parent f8ff893 commit 2e8ef07
Show file tree
Hide file tree
Showing 11 changed files with 1,017 additions and 1,216 deletions.
2 changes: 1 addition & 1 deletion app/components/ConnectButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const ConnectedButton = ({ address }: { address: AddressString }) => {
const name =
typeof domainType === "string"
? truncatedAddress
: domainType?.name ?? truncatedAddress;
: (domainType?.name ?? truncatedAddress);
const image =
(domainType &&
typeof domainType !== "string" &&
Expand Down
2 changes: 1 addition & 1 deletion app/components/SelectionPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export const SelectionPopup = ({ token, type, ...props }: Props) => {
enabled: token.isNFT,
});
const [selectedItems, setSelectedItems] = useState<TroveTokenWithQuantity[]>(
!props.viewOnly ? props.selectedTokens ?? [] : [],
!props.viewOnly ? (props.selectedTokens ?? []) : [],
);
const [isCompactMode, setIsCompactMode] = useState(false);

Expand Down
2 changes: 1 addition & 1 deletion app/hooks/useSwapRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const useSwapRoute = ({
}: Props) => {
const amountBI = parseUnits(
amount as NumberString,
isExactOut ? tokenOut?.decimals ?? 18 : tokenIn.decimals,
isExactOut ? (tokenOut?.decimals ?? 18) : tokenIn.decimals,
);
const isSampleRoute = amountBI <= 0;

Expand Down
2 changes: 1 addition & 1 deletion app/hooks/useTokenBalance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const useTokenBalance = ({
} = useBalance({ address: isETH ? address : undefined });

return {
data: isETH ? ethData?.value ?? 0n : data,
data: isETH ? (ethData?.value ?? 0n) : data,
isLoading: isETH ? isLoadingEthBalance : isLoading,
refetch: isETH ? refetchEthBalance : refetch,
};
Expand Down
12 changes: 4 additions & 8 deletions app/routes/pools._index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,10 @@ export default function PoolsListPage() {
</thead>
<tbody>
<Suspense
fallback={
<>
{Array.from({ length: 5 }).map((_, i) => (
// biome-ignore lint/suspicious/noArrayIndexKey: skeleton rows are identical
<RowSkeleton key={i} />
))}
</>
}
fallback={Array.from({ length: 5 }).map((_, i) => (
// biome-ignore lint/suspicious/noArrayIndexKey: skeleton rows are identical
<RowSkeleton key={i} />
))}
>
<Await resolve={pools}>
{(pools) =>
Expand Down
12 changes: 4 additions & 8 deletions app/routes/pools.my-positions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,10 @@ export default function UserPositionsListPage() {
</thead>
<tbody>
<Suspense
fallback={
<>
{Array.from({ length: 5 }).map((_, i) => (
// biome-ignore lint/suspicious/noArrayIndexKey: skeleton rows are identical
<RowSkeleton key={i} />
))}
</>
}
fallback={Array.from({ length: 5 }).map((_, i) => (
// biome-ignore lint/suspicious/noArrayIndexKey: skeleton rows are identical
<RowSkeleton key={i} />
))}
>
<Await resolve={userPositions}>
{({ positions }) =>
Expand Down
204 changes: 101 additions & 103 deletions app/routes/pools_.$id.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -624,109 +624,108 @@ const PoolActivityTable = ({
</tr>
</thead>
<tbody>
<>
{transactions.map((tx) => {
let tokenA: PoolToken;
let amountA: string;
let itemsA: PoolTransactionItem[];
let tokenB: PoolToken;
let amountB: string;
let itemsB: PoolTransactionItem[];
const isSwap = tx.type === "Swap";
if (isSwap) {
if (tx.isAmount1Out) {
tokenA = pool.token0;
amountA = tx.amount0;
itemsA = tx.items0 ?? [];
tokenB = pool.token1;
amountB = tx.amount1;
itemsB = tx.items1;
} else {
tokenA = pool.token1;
amountA = tx.amount1;
itemsA = tx.items1;
tokenB = pool.token0;
amountB = tx.amount0;
itemsB = tx.items0;
}
} else {
{transactions.map((tx) => {
let tokenA: PoolToken;
let amountA: string;
let itemsA: PoolTransactionItem[];
let tokenB: PoolToken;
let amountB: string;
let itemsB: PoolTransactionItem[];
const isSwap = tx.type === "Swap";
if (isSwap) {
if (tx.isAmount1Out) {
tokenA = pool.token0;
amountA = tx.amount0;
itemsA = tx.items0 ?? [];
tokenB = pool.token1;
if (tokenA.id === pool.token0.id) {
amountA = tx.amount0;
itemsA = tx.items0;
amountB = tx.amount1;
itemsB = tx.items1;
} else {
amountA = tx.amount1;
itemsA = tx.items1;
amountB = tx.amount0;
itemsB = tx.items0;
}
amountB = tx.amount1;
itemsB = tx.items1;
} else {
tokenA = pool.token1;
amountA = tx.amount1;
itemsA = tx.items1;
tokenB = pool.token0;
amountB = tx.amount0;
itemsB = tx.items0;
}
} else {
tokenA = pool.token0;
tokenB = pool.token1;
if (tokenA.id === pool.token0.id) {
amountA = tx.amount0;
itemsA = tx.items0;
amountB = tx.amount1;
itemsB = tx.items1;
} else {
amountA = tx.amount1;
itemsA = tx.items1;
amountB = tx.amount0;
itemsB = tx.items0;
}
}

return (
<Fragment key={tx.id}>
<tr className="border-b border-b-night-900 transition-colors">
<td className="px-4 py-3.5 text-left sm:px-5">
<div className="grid grid-cols-[1fr,max-content,1fr] items-center gap-3 text-night-400 text-sm">
<div className="flex items-center gap-2.5">
<PoolTransactionImage token={tokenA} items={itemsA} />
<span>
<span className="text-honey-25">
{formatAmount(amountA)}
</span>{" "}
{tokenA.symbol}
</span>
</div>
{isSwap ? (
<ArrowRightIcon className="h-6 w-6" />
) : (
<PlusIcon className="h-6 w-6" />
)}
<div className="flex items-center gap-2.5">
<PoolTransactionImage token={tokenB} items={itemsB} />
<span>
<span className="text-honey-25">
{formatAmount(amountB)}
</span>{" "}
{tokenB.symbol}
</span>
</div>
</div>
</td>
<td className="hidden px-4 py-3.5 text-center sm:table-cell sm:px-5">
{tx.type}
</td>
<td className="hidden px-4 py-3.5 text-center sm:table-cell sm:px-5">
{Number(tx.amountUSD) > 0 ? formatUSD(tx.amountUSD) : "-"}
</td>
<td className="hidden px-4 py-3.5 text-center text-night-400 text-sm sm:table-cell sm:px-5">
{tx.userDomain?.treasuretag ? (
<span className="flex items-center justify-center gap-1 font-medium text-honey-25">
<MagicLogo className="h-3 w-3" />
{tx.userDomain.treasuretag.name}
return (
<Fragment key={tx.id}>
<tr className="border-b border-b-night-900 transition-colors">
<td className="px-4 py-3.5 text-left sm:px-5">
<div className="grid grid-cols-[1fr,max-content,1fr] items-center gap-3 text-night-400 text-sm">
<div className="flex items-center gap-2.5">
<PoolTransactionImage token={tokenA} items={itemsA} />
<span>
<span className="text-honey-25">
{formatAmount(amountA)}
</span>{" "}
{tokenA.symbol}
</span>
</div>
{isSwap ? (
<ArrowRightIcon className="h-6 w-6" />
) : (
<span className="font-mono">
{tx.user ? truncateEthAddress(tx.user.id) : "-"}
</span>
<PlusIcon className="h-6 w-6" />
)}
</td>
<td className="hidden px-4 py-3.5 text-right text-night-400 text-sm sm:table-cell sm:px-5">
{new Date(Number(tx.timestamp) * 1000).toLocaleString()}
</td>
<td className="flex items-center justify-end gap-2 px-4 py-3.5 text-end sm:px-5">
<a
className="cursor-pointer rounded-md p-1.5 text-night-400 transition-colors hover:text-night-100"
href={`${blockExplorer.url}/tx/${tx.hash}`}
target="_blank"
rel="noopener noreferrer"
title={`View on ${blockExplorer.name}`}
>
<ExternalLinkIcon className="h-4 w-4" />
</a>
{/* <button
<div className="flex items-center gap-2.5">
<PoolTransactionImage token={tokenB} items={itemsB} />
<span>
<span className="text-honey-25">
{formatAmount(amountB)}
</span>{" "}
{tokenB.symbol}
</span>
</div>
</div>
</td>
<td className="hidden px-4 py-3.5 text-center sm:table-cell sm:px-5">
{tx.type}
</td>
<td className="hidden px-4 py-3.5 text-center sm:table-cell sm:px-5">
{Number(tx.amountUSD) > 0 ? formatUSD(tx.amountUSD) : "-"}
</td>
<td className="hidden px-4 py-3.5 text-center text-night-400 text-sm sm:table-cell sm:px-5">
{tx.userDomain?.treasuretag ? (
<span className="flex items-center justify-center gap-1 font-medium text-honey-25">
<MagicLogo className="h-3 w-3" />
{tx.userDomain.treasuretag.name}
</span>
) : (
<span className="font-mono">
{tx.user ? truncateEthAddress(tx.user.id) : "-"}
</span>
)}
</td>
<td className="hidden px-4 py-3.5 text-right text-night-400 text-sm sm:table-cell sm:px-5">
{new Date(Number(tx.timestamp) * 1000).toLocaleString()}
</td>
<td className="flex items-center justify-end gap-2 px-4 py-3.5 text-end sm:px-5">
<a
className="cursor-pointer rounded-md p-1.5 text-night-400 transition-colors hover:text-night-100"
href={`${blockExplorer.url}/tx/${tx.hash}`}
target="_blank"
rel="noopener noreferrer"
title={`View on ${blockExplorer.name}`}
>
<ExternalLinkIcon className="h-4 w-4" />
</a>
{/* <button
className="cursor-pointer rounded-md p-1.5 text-night-400 transition-colors hover:bg-night-900 hover:text-night-100"
onClick={() =>
setExpandedRow(expandedRow === 0 ? null : 0)
Expand All @@ -739,9 +738,9 @@ const PoolActivityTable = ({
)}
/>
</button> */}
</td>
</tr>
{/* {expandedRow === 0 && (
</td>
</tr>
{/* {expandedRow === 0 && (
<motion.div
initial={{ height: "0px", opacity: 0 }}
animate={{ height: "max", opacity: 1 }}
Expand All @@ -764,10 +763,9 @@ const PoolActivityTable = ({
)}
</motion.div>
)} */}
</Fragment>
);
})}
</>
</Fragment>
);
})}
</tbody>
</table>
<nav className="flex w-full items-center justify-between rounded-b-lg bg-night-1100 px-3 py-2">
Expand Down
4 changes: 1 addition & 3 deletions app/styles/nprogress.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
right: 0px;
width: 100px;
height: 100%;
box-shadow:
0 0 10px #b91c1c,
0 0 5px #b91c1c;
box-shadow: 0 0 10px #b91c1c, 0 0 5px #b91c1c;
opacity: 1;

-webkit-transform: rotate(3deg) translate(0px, -4px);
Expand Down
7 changes: 2 additions & 5 deletions app/styles/tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
}
body {
@apply bg-background text-foreground;
font-feature-settings:
"rlig" 1,
"calt" 1;
font-feature-settings: "rlig" 1, "calt" 1;
}
}

Expand All @@ -37,7 +35,6 @@
font-style: normal;
font-weight: 100 1000;
font-display: swap;
src:
url("/fonts/ABCWhyteVariable.woff2") format("woff2"),
src: url("/fonts/ABCWhyteVariable.woff2") format("woff2"),
url("/fonts/ABCWhyteVariable.woff") format("woff");
}
Loading

0 comments on commit 2e8ef07

Please sign in to comment.