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

Addressing some nits in wording #881

Merged
merged 2 commits into from
Jul 14, 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
8 changes: 4 additions & 4 deletions earn/src/components/advanced/BorrowGraph.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { LABEL_TEXT_COLOR } from 'shared/lib/components/common/Modal';
import { Text } from 'shared/lib/components/common/Typography';
import useMediaQuery from 'shared/lib/hooks/UseMediaQuery';
import styled from 'styled-components';

import BorrowGraphTooltip from './BorrowGraphTooltip';
import {
RESPONSIVE_BREAKPOINT_MD,
RESPONSIVE_BREAKPOINT_SM,
RESPONSIVE_BREAKPOINTS,
} from 'shared/lib/data/constants/Breakpoints';
import useMediaQuery from 'shared/lib/hooks/UseMediaQuery';
import styled from 'styled-components';

import BorrowGraphTooltip from './BorrowGraphTooltip';
import Graph from '../graph/Graph';

const TEXT_COLOR = '#82a0b6';
Expand Down
8 changes: 5 additions & 3 deletions earn/src/components/markets/borrow/BorrowingWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -423,14 +423,16 @@ export default function BorrowingWidget(props: BorrowingWidgetProps) {
<li className='flex items-center gap-2 mb-1'>
{selectedCollateral == null ? <Circle /> : <CheckIcon height={20} width={20} />}
<Text size='M' weight='medium' color={SECONDARY_COLOR}>
1. Select an asset to use as collateral. Note that collateral is <strong>not</strong> lent out, and LLTVs
can change up to 1% per day.
1. Select an asset to use as <strong>collateral</strong>.{' '}
<em>
Note that collateral is <strong>not</strong> lent out, and LLTVs can change up to 1% per day.
</em>
</Text>
</li>
<li className='flex items-center gap-2 mb-1'>
{selectedBorrows == null ? <Circle /> : <CheckIcon height={20} width={20} />}
<Text size='M' weight='medium' color={SECONDARY_COLOR}>
2. Select an asset to borrow. APRs are variable based on utilization.
2. Select an asset to <strong>borrow</strong>. <em>APR is variable and based on utilization.</em>
</Text>
</li>
<li className='flex items-center gap-2'>
Expand Down
9 changes: 2 additions & 7 deletions earn/src/hooks/UseRedeem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@ import { lenderLensAbi } from 'shared/lib/abis/LenderLens';
import { ALOE_II_LENDER_LENS_ADDRESS } from 'shared/lib/data/constants/ChainSpecific';
import { GN } from 'shared/lib/data/GoodNumber';
import { Address, erc4626Abi, maxUint256, zeroAddress } from 'viem';
import {
useReadContract,
useReadContracts,
useSimulateContract,
useWriteContract,
} from 'wagmi';
import { useReadContract, useReadContracts, useSimulateContract, useWriteContract } from 'wagmi';

export enum RedeemState {
WAITING_FOR_INPUT,
Expand Down Expand Up @@ -65,7 +60,7 @@ export function useRedeem(
});
const shares = sharesData ?? 0n;

const threshold = maxShares * 999n / 1000n;
const threshold = (maxShares * 999n) / 1000n;
const shouldRedeemMax = shares >= threshold && maxSharesIsChanging;

/*//////////////////////////////////////////////////////////////
Expand Down
6 changes: 1 addition & 5 deletions earn/src/pages/AdvancedPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,7 @@ export default function AdvancedPage() {
/>
</GridAreaForNFTList>
<GridAreaForData>
<BorrowMetrics
market={market}
borrowerNft={selection}
userHasNoMarginAccounts={!userHasBorrowers}
/>
<BorrowMetrics market={market} borrowerNft={selection} userHasNoMarginAccounts={!userHasBorrowers} />
<UniswapPositionList
borrower={selection}
importableUniswapNFTPositions={filteredNonZeroUniswapNFTPositions}
Expand Down
11 changes: 6 additions & 5 deletions earn/src/pages/MarketsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,12 @@ export default function MarketsPage() {
}),
[activeChain.id]
);
const {
borrowerNfts,
refetchBorrowerNftRefs,
refetchBorrowers,
} = useBorrowerNfts(uniswapPools, userAddress, activeChain.id, borrowerNftFilterParams);
const { borrowerNfts, refetchBorrowerNftRefs, refetchBorrowers } = useBorrowerNfts(
uniswapPools,
userAddress,
activeChain.id,
borrowerNftFilterParams
);
const borrowers = useDeprecatedMarginAccountShim(lendingPairs, borrowerNfts);

// Poll for `blockNumber` when app is in the foreground. Not much different than a `useInterval` that stops
Expand Down
7 changes: 1 addition & 6 deletions earn/src/pages/PortfolioPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,7 @@ export default function PortfolioPage() {
if (isConnected) setIsWithdrawModalOpen(true);
}}
/>
<PortfolioActionButton
label={'Bridge'}
disabled={true}
Icon={<TruckIcon />}
onClick={() => {}}
/>
<PortfolioActionButton label={'Bridge'} disabled={true} Icon={<TruckIcon />} onClick={() => {}} />
</PortfolioActionButtonsContainer>
<div className='mt-10'>
<PortfolioPageWidgetWrapper tooltip={PORTFOLIO_GRID_TOOLTIP_TEXT} tooltipId='portfolioGrid'>
Expand Down
11 changes: 7 additions & 4 deletions shared/src/hooks/UseBorrowerNft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,13 @@ export function useBorrowerNfts(
const { borrowers, refetchBorrowers } = useBorrowers(uniswapPools, borrowerNftRefs, chainId, staleTime);

const borrowerNfts = useMemo(() => {
return borrowerNftRefs.map((borrowerNftRef, i) => ({
...borrowerNftRef,
borrower: borrowers.at(i),
} as BorrowerNft));
return borrowerNftRefs.map(
(borrowerNftRef, i) =>
({
...borrowerNftRef,
borrower: borrowers.at(i),
} as BorrowerNft)
);
}, [borrowerNftRefs, borrowers]);

return { borrowerNfts, refetchBorrowerNftRefs, refetchBorrowers };
Expand Down