Skip to content

[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

Merged
merged 3 commits into from
May 9, 2025

Conversation

Filip-L
Copy link
Collaborator

@Filip-L Filip-L commented May 5, 2025

No description provided.

@Filip-L Filip-L changed the title Add button to reopen decline application [FIL-760] Add button to reopen decline application May 5, 2025
@Filip-L Filip-L temporarily deployed to staging-fidl May 5, 2025 13:57 — with GitHub Actions Inactive
session?.data?.user?.name !== undefined &&
application?.Lifecycle?.['On Chain Address'] &&
application?.['Client Contract Address'] &&
['ChangingSP'].includes(application?.Lifecycle?.State) && (
Copy link
Collaborator

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={() => {
Copy link
Collaborator

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 }) => {
Copy link
Collaborator

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)
Copy link
Collaborator

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.

Copy link
Collaborator

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.

@Filip-L Filip-L temporarily deployed to staging-fidl May 7, 2025 10:09 — with GitHub Actions Inactive
@Filip-L Filip-L temporarily deployed to staging-fidl May 8, 2025 21:25 — with GitHub Actions Inactive
@Filip-L Filip-L merged commit 4ad4e9d into main May 9, 2025
6 checks passed
@Filip-L Filip-L deleted the FIL-760-add-a-button-to-reopen-decline-application branch May 9, 2025 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants