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 da spinna #3324

Merged
Merged
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
15 changes: 13 additions & 2 deletions wormhole-connect/src/views/TxSearch.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useCallback, useContext, useEffect, useState } from 'react';
import { makeStyles } from 'tss-react/mui';
import { useDispatch } from 'react-redux';
import { Select, MenuItem, CircularProgress } from '@mui/material';
import { Select, MenuItem, CircularProgress, useTheme } from '@mui/material';

import config, { getWormholeContextV2 } from 'config';
import { isValidTxId } from 'utils';
Expand Down Expand Up @@ -72,6 +72,8 @@
const [error, setError] = useState('');
const [loading, setLoading] = useState(false);

const theme = useTheme();

const routeContext = useContext(RouteContext);

function setChain(e: any) {
Expand Down Expand Up @@ -153,7 +155,7 @@
}
}, [hasExternalSearch, txHash, chainName, clear]);

const doSearch = useCallback(() => search(), [state]);

Check warning on line 158 in wormhole-connect/src/views/TxSearch.tsx

View workflow job for this annotation

GitHub Actions / lint

React Hook useCallback has a missing dependency: 'search'. Either include it or remove the dependency array

// search on load if txHash and chainName are set
useEffect(() => {
Expand Down Expand Up @@ -210,7 +212,16 @@
<AlertBanner show={!!error} content={error} error margin="0 0 16px 0" />

<Button disabled={!state.chain || !state.tx} elevated onClick={search}>
{loading ? <CircularProgress size={24} /> : 'Search'}
{loading ? (
<CircularProgress
size={24}
sx={{
color: theme.palette.primary.contrastText,
}}
/>
) : (
'Search'
)}
</Button>
<div className={classes.footerNavBar}>
<FooterNavBar />
Expand Down
Loading