Skip to content

Commit

Permalink
fix: remove border if no routes found
Browse files Browse the repository at this point in the history
  • Loading branch information
chybisov committed Jul 22, 2022
1 parent 9ee7c3a commit 99d3355
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions packages/widget/src/pages/MainPage/SwapRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export const SwapRoutes: React.FC<BoxProps> = (props) => {
const handleCardClick = useCallback(() => {
navigate(navigationRoutes.swapRoutes);
}, [navigate]);

const currentRoute = routes?.[0];

if (!currentRoute && !isLoading && !isFetching && !isFetched) {
Expand All @@ -45,19 +44,17 @@ export const SwapRoutes: React.FC<BoxProps> = (props) => {
<>
<CardContainer {...props}>
<CardTitle>{t('swap.routes')}</CardTitle>
{!routeNotFound ? (
<ProgressToNextUpdate
updatedAt={dataUpdatedAt}
timeToUpdate={refetchTime}
isLoading={isFetching}
onClick={() => refetch()}
sx={{
position: 'absolute',
top: 8,
right: 8,
}}
/>
) : null}
<ProgressToNextUpdate
updatedAt={dataUpdatedAt}
timeToUpdate={refetchTime}
isLoading={isFetching}
onClick={() => refetch()}
sx={{
position: 'absolute',
top: 8,
right: 8,
}}
/>
<Box sx={{ display: 'flex' }}>
<Stack
direction="row"
Expand All @@ -66,7 +63,10 @@ export const SwapRoutes: React.FC<BoxProps> = (props) => {
ml={2}
mr={routeNotFound ? 2 : 1}
sx={{
borderWidth: isFetching || (routes && routes.length > 1) ? 1 : 0,
borderWidth:
!routeNotFound && (isFetching || (routes && routes.length > 1))
? 1
: 0,
}}
>
{routeNotFound ? (
Expand Down

0 comments on commit 99d3355

Please sign in to comment.