Skip to content

Commit

Permalink
fix(app): update verifyButton logic and drawerclosebutton (passportxy…
Browse files Browse the repository at this point in the history
…z#1174)

Co-authored-by: Michael Green <[email protected]>
  • Loading branch information
michaelgreen06 and Michael Green authored Apr 21, 2023
1 parent d902602 commit 7b3aa0c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
6 changes: 5 additions & 1 deletion app/components/CardList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ export const CardList = ({ isLoading = false, cardClassName }: CardListProps): J
const platformProps = allPlatforms.get(currentPlatform.platform);
if (platformProps) {
return (
<GenericPlatform platform={platformProps.platform} platFormGroupSpec={platformProps.platFormGroupSpec} onClose={onClose} />
<GenericPlatform
platform={platformProps.platform}
platFormGroupSpec={platformProps.platFormGroupSpec}
onClose={onClose}
/>
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions app/components/GenericPlatform.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import { NoStampModal } from "./NoStampModal";
export type PlatformProps = {
platFormGroupSpec: PlatformGroupSpec[];
platform: PlatformClass;
onClose: ()=>void;
onClose: () => void;
};

enum VerificationStatuses {
Expand Down Expand Up @@ -90,7 +90,7 @@ export const GenericPlatform = ({ platFormGroupSpec, platform, onClose }: Platfo

// any time we change selection state...
useEffect(() => {
setCanSubmit(selectedProviders.length !== verifiedProviders.length);
setCanSubmit(selectedProviders.length !== verifiedProviders.length);
}, [selectedProviders, verifiedProviders]);

const waitForRedirect = (timeout?: number): Promise<ProviderPayload> => {
Expand Down Expand Up @@ -405,7 +405,7 @@ export const GenericPlatform = ({ platFormGroupSpec, platform, onClose }: Platfo
data-testid={`button-verify-${platform.platformId}`}
className="sidebar-verify-btn"
>
{submitted && !canSubmit ? "Close" : (verifiedProviders.length > 0 ? "Save" : "Verify")}
{submitted && !canSubmit ? "Close" : verifiedProviders.length > 0 ? "Save" : "Verify"}
</button>
</>
}
Expand Down
6 changes: 5 additions & 1 deletion app/components/SideBarContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ export const SideBarContent = ({
borderRadius: "6px",
}}
>
<DrawerCloseButton disabled={isLoading} className={`z-10 bg-muted`} _hover={{backgroundColor:"var(--color-accent)"}} />
<DrawerCloseButton
disabled={isLoading}
className={`z-10 bg-muted`}
_hover={{ backgroundColor: "var(--color-accent)" }}
/>
{currentPlatform && currentProviders ? (
<div className="overflow-auto">
<DrawerHeader style={{ fontWeight: "inherit" }}>
Expand Down

0 comments on commit 7b3aa0c

Please sign in to comment.