-
Notifications
You must be signed in to change notification settings - Fork 117
feat: new status manager (old ui) #647
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
Changes from all commits
0a57dd2
7ebab70
4e81e7c
a4987ef
8e2d316
47a6df4
53230b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ build/ | |
| *.tmp | ||
|
|
||
| npm-debug.log* | ||
| /.pnpm-store/ | ||
|
|
||
| .next | ||
| .cache | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,7 +75,7 @@ export const widgetBaseConfig: WidgetConfig = { | |
| // }, | ||
| sdkConfig: { | ||
| apiUrl: 'https://li.quest/v1', | ||
| preloadChains: false, | ||
| preloadChains: true, | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Locally linked SDK does not preserve SDK client storage chains -> revert before merging. |
||
| rpcUrls: { | ||
| [ChainId.SOL]: [ | ||
| 'https://wild-winter-frog.solana-mainnet.quiknode.pro/2370a45ff891f6dc9e5b1753460290fe0f1ef103/', | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,9 +3,10 @@ import ErrorRounded from '@mui/icons-material/ErrorRounded' | |
| import InfoRounded from '@mui/icons-material/InfoRounded' | ||
| import { ListItemAvatar, ListItemText, Typography } from '@mui/material' | ||
| import { useNavigate } from '@tanstack/react-router' | ||
| import { useProcessMessage } from '../../hooks/useProcessMessage.js' | ||
| import { useExecutionMessage } from '../../hooks/useExecutionMessage.js' | ||
| import { useRouteExecution } from '../../hooks/useRouteExecution.js' | ||
| import { RouteExecutionStatus } from '../../stores/routes/types.js' | ||
| import { getExecutionStatus } from '../../utils/execution.js' | ||
| import { navigationRoutes } from '../../utils/navigationRoutes.js' | ||
| import { TokenAvatarGroup } from '../Avatar/Avatar.style.js' | ||
| import { TokenAvatar } from '../Avatar/TokenAvatar.js' | ||
|
|
@@ -23,9 +24,8 @@ export const ActiveTransactionItem: React.FC<{ | |
| }) | ||
|
|
||
| const lastActiveStep = route?.steps.findLast((step) => step.execution) | ||
| const lastActiveProcess = lastActiveStep?.execution?.process.at(-1) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Execution now stores the last active process type and status |
||
|
|
||
| const { title } = useProcessMessage(lastActiveStep, lastActiveProcess) | ||
| const { title } = useExecutionMessage(lastActiveStep) | ||
|
|
||
| if (!route || !lastActiveStep) { | ||
| return null | ||
|
|
@@ -38,8 +38,10 @@ export const ActiveTransactionItem: React.FC<{ | |
| }) | ||
| } | ||
|
|
||
| const executionStatus = getExecutionStatus(lastActiveStep) | ||
|
|
||
| const getStatusComponent = () => { | ||
| switch (lastActiveProcess?.status) { | ||
| switch (executionStatus) { | ||
| case 'ACTION_REQUIRED': | ||
| case 'MESSAGE_REQUIRED': | ||
| case 'RESET_REQUIRED': | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| import type { LiFiStepExtended } from '@lifi/sdk' | ||
| import { Box, Typography } from '@mui/material' | ||
| import { useExecutionMessage } from '../../hooks/useExecutionMessage.js' | ||
| import { CircularProgress } from './CircularProgress.js' | ||
|
|
||
| export const StepExecution: React.FC<{ | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to
|
||
| step: LiFiStepExtended | ||
| }> = ({ step }) => { | ||
| const { title, message } = useExecutionMessage(step) | ||
|
|
||
| if (!step.execution || step.execution.status === 'DONE') { | ||
| return null | ||
| } | ||
|
|
||
| return ( | ||
| <Box | ||
| sx={{ | ||
| px: 2, | ||
| py: 1, | ||
| }} | ||
| > | ||
| <Box | ||
| sx={{ | ||
| display: 'flex', | ||
| alignItems: 'center', | ||
| }} | ||
| > | ||
| <CircularProgress | ||
| status={step.execution.status} | ||
| substatus={step.execution.substatus} | ||
| /> | ||
| <Typography | ||
| sx={{ | ||
| marginLeft: 2, | ||
| marginRight: 0.5, | ||
| flex: 1, | ||
| fontSize: 14, | ||
| fontWeight: step.execution?.error ? 600 : 400, | ||
| }} | ||
| > | ||
| {title} | ||
| </Typography> | ||
| </Box> | ||
| {message ? ( | ||
| <Typography | ||
| sx={{ | ||
| ml: 7, | ||
| fontSize: 14, | ||
| fontWeight: 500, | ||
| color: 'text.secondary', | ||
| }} | ||
| > | ||
| {message} | ||
| </Typography> | ||
| ) : null} | ||
| </Box> | ||
| ) | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Remove before merging - needed for local linking.