Skip to content

Commit

Permalink
Remove fingerprint icon from authenticate page (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
JunichiSugiura authored May 28, 2024
1 parent 533322b commit f0e812b
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions packages/keychain/src/components/Auth/Authenticate.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
import React, { useEffect, useState, useCallback, useMemo } from "react";
import React, { useEffect, useState, useCallback } from "react";
import { Button } from "@chakra-ui/react";
import { Unsupported } from "./Unsupported";
import { doSignup } from "hooks/account";
import {
FaceIDDuoIcon,
FingerprintDuoIcon,
QRCodeDuoIcon,
} from "@cartridge/ui";
import { Container } from "../Container";
import { PortalBanner } from "components/PortalBanner";
import { PortalFooter } from "components/PortalFooter";
import { requestStorageDropCookie } from "./utils";

type UserAgent = "ios" | "android" | "other";
type AuthAction = "signup" | "login";
``;

export function Authenticate({
name,
action,
Expand All @@ -25,7 +19,6 @@ export function Authenticate({
onSuccess: () => void;
}) {
const [isLoading, setIsLoading] = useState(false);
const [userAgent, setUserAgent] = useState<UserAgent>("other");
const [unsupportedMessage, setUnsupportedMessage] = useState<string>();

const onAuth = useCallback(async () => {
Expand Down Expand Up @@ -61,23 +54,9 @@ export function Authenticate({
`iOS ${iosVersion[1]} does not support passkeys. Upgrade to iOS 16 to continue`,
);
}
setUserAgent("ios");
} else if (/android/i.test(userAgent)) {
setUserAgent("android");
}
}, []);

const Icon = useMemo(() => {
switch (userAgent) {
case "ios":
return FaceIDDuoIcon;
case "android":
return QRCodeDuoIcon;
case "other":
return FingerprintDuoIcon;
}
}, [userAgent]);

if (unsupportedMessage) {
return <Unsupported message={unsupportedMessage} />;
}
Expand All @@ -98,7 +77,6 @@ export function Authenticate({
<>
<Container hideAccount>
<PortalBanner
Icon={action === "signup" && Icon}
title={title}
description={description}
/>
Expand Down

0 comments on commit f0e812b

Please sign in to comment.