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

fix(disable-second-deposit-input): disabled second deposit input field #425

Merged
merged 1 commit into from
Nov 9, 2023
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
4 changes: 2 additions & 2 deletions components/AssetInput/BalanceWithMax.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ const BalanceWithMaxNHalf = ({
maxwidth={'50'}
size={'xs'}
/>
</>) : (null)}
</>) : null}
</HStack>
{mobile ? (
<>
Expand All @@ -188,7 +188,7 @@ const BalanceWithMaxNHalf = ({
size={'md'}
/>
</HStack>
</>) : (null)}
</>) : null}
</>)

export default BalanceWithMaxNHalf
2 changes: 1 addition & 1 deletion components/Pages/Trade/Liquidity/DepositForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ const DepositForm = ({
name="token2"
control={control}
token={tokenB}
isDisabled={isInputDisabled || !tokenB?.tokenSymbol}
isDisabled={true}
mobile={mobile}
onChange={(value) => {
setReverse(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import TruncatedAddress from 'components/Wallet/ConnectedWalletWithDisconnect/Co
import { useRecoilValue } from 'recoil'
import { chainState } from 'state/chainState'

export const ConnectedWallet = ({ connected }) => {
export const ConnectedWallet = () => {
const toast = useToast()
const { walletChainName } = useRecoilValue(chainState)
const { address } = useChain(walletChainName)
Expand Down Expand Up @@ -37,7 +37,7 @@ export const ConnectedWallet = ({ connected }) => {
width="full"
>
<ConnectedWalletIcon />
<TruncatedAddress connected={connected} />
<TruncatedAddress/>
</HStack>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,19 @@ import { useRecoilValue } from 'recoil'
import { chainState } from 'state/chainState'
import { truncate } from 'util/truncate'

function TruncatedAddress({ connected }) {
export const TruncatedAddress = () => {
const { walletChainName } = useRecoilValue(chainState)

const { address } = useChain(walletChainName)

const truncatedWalletAddress = (addr: string) => {
const chainName = addr?.substring(0, addr.indexOf('1'))
return connected
? `${chainName}${truncate(address, [0, 4])}`
: `${chainName}${truncate(address, [0, 4])}`
return `${chainName}${truncate(address, [0, 4])}`
}

return (
<Text color="brand.500" fontSize={['14px', '16px']}>
{connected
? truncatedWalletAddress(address)
: truncatedWalletAddress(address)}
{truncatedWalletAddress(address)}
</Text>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { IconButton } from '@chakra-ui/react'
import LogoutIcon from 'components/Icons/LogoutIcon'
import { ConnectedWallet } from 'components/Wallet/ConnectedWalletWithDisconnect/ConnectedWallet/ConnectedWallet'

export const ConnectedWalletWithDisconnect = ({ connected, onDisconnect }) => (
export const ConnectedWalletWithDisconnect = ({ onDisconnect }) => (
<>
<ConnectedWallet connected={connected} />
<ConnectedWallet />
<IconButton
aria-label="Logout"
icon={<LogoutIcon />}
Expand Down
11 changes: 5 additions & 6 deletions components/Wallet/Wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ const Wallet = () => {
if (walletType === WalletType.leapSnap) {
const snapChainIds = chains.
filter((row) => row.coinType === 118).
map((row) => WALLET_CHAIN_NAMES_BY_CHAIN_ID[row.chainId]);
map((row) => WALLET_CHAIN_NAMES_BY_CHAIN_ID[row.chainId])

setWalletChains(snapChainIds);
setCurrentConnectedChainIds(snapChainIds);
setWalletChains(snapChainIds)
setCurrentConnectedChainIds(snapChainIds)
} else if (walletType === WalletType.terraExtension || walletType === WalletType.keplrExtension) {
const walletWindowConnection = walletType === WalletType.terraExtension ? (window.station?.keplr) : (window?.keplr)

Expand Down Expand Up @@ -115,11 +115,11 @@ const Wallet = () => {
}
}, [chains, currentChainState.network, chainName, window.localStorage.getItem(COSMOS_KIT_WALLET_KEY)])

const resetWallet = () => {
const resetWallet = async () => {
setCurrentConnectedChainIds([])
queryClient.clear()
setWalletChains([])
disconnect()
await disconnect()
}

useEffect(() => {
Expand Down Expand Up @@ -267,7 +267,6 @@ const Wallet = () => {
/>
</Box>
<ConnectedWalletWithDisconnect
connected={isWalletConnected}
onDisconnect={resetWallet}
/>
</Card>
Expand Down
Loading