Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/plain-camels-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@relayprotocol/relay-kit-ui': patch
---

Fix no routes error handling
28 changes: 27 additions & 1 deletion packages/ui/src/components/widgets/WidgetErrorWell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { useMediaQuery } from 'usehooks-ts'
import type { Styles } from '@relayprotocol/relay-design-system/css'
import type { QuoteResponse } from '@relayprotocol/relay-kit-hooks'
import type { LinkedWallet } from '../../types/index.js'
import { faRoute } from '@fortawesome/free-solid-svg-icons'

type Props = {
error: any
Expand Down Expand Up @@ -67,7 +68,32 @@ export const WidgetErrorWell: FC<Props> = ({
error?.response?.data?.errorCode === 'UNSUPPORTED_ROUTE'

if (isInsufficientLiquidityError || isNoAvailableRoutesError) {
return null
return (
<Flex
align="center"
justify="between"
css={{
gap: '2',
p: '3',
width: '100%',
borderRadius: 'widget-card-border-radius',
backgroundColor: 'widget-background',
border: 'widget-card-border',
overflow: 'hidden',
mb: 'widget-card-section-gutter'
}}
>
<Text style="subtitle2">Route</Text>
<Flex align="center" css={{ gap: '1' }}>
<Text style="subtitle2" color="subtle">
No available routes
</Text>
<Box css={{ color: 'gray11', width: 14, flexShrink: 0 }}>
<FontAwesomeIcon icon={faRoute} width={14} />
</Box>
</Flex>
</Flex>
)
}

/*
Expand Down