-
Notifications
You must be signed in to change notification settings - Fork 5
[FIL-760] Add button to reopen decline application #194
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
[FIL-760] Add button to reopen decline application #194
Conversation
src/components/cards/AppInfoCard.tsx
Outdated
session?.data?.user?.name !== undefined && | ||
application?.Lifecycle?.['On Chain Address'] && | ||
application?.['Client Contract Address'] && | ||
['ChangingSP'].includes(application?.Lifecycle?.State) && ( |
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.
Simple equality check would suffice
['ChangingSP'].includes(application?.Lifecycle?.State) && ( | ||
<div className="flex gap-2"> | ||
<Button | ||
onClick={() => { |
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.
onClick={handleApproveAllowedSPs}
{ userName: string }, | ||
unknown | ||
>( | ||
async ({ userName }) => { |
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.
[Minor] No need to use async
just to await
straight away. Simply returning a promise would be ok.
}, | ||
{ | ||
onSuccess: (data) => { | ||
setApiCalling(false) |
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.
useMutation
already returns property isPending
to track if the mutation is running, no need to track the state separately.
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.
This component could really use a refactor to break it down into multiple components. It's getting pretty unreadable with all the conditional rendering. At the very least moving the conditions to a const eg.
const shouldRenderThisAndThat = // all the checks here
instead of inlining them everywhere would improve readability considerably.
No description provided.