Skip to content

Commit

Permalink
fix: disable credential creation button temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
HunnySajid committed Jan 10, 2024
1 parent 3601816 commit 83e0e3c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 21 deletions.
4 changes: 2 additions & 2 deletions example-web/my-app/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ function App() {
<Button variant="contained" onClick={handleRequestIdentifier}>
Authenticate with AID
</Button>
<Button variant="contained" onClick={handleRequestCredential}>
{/* <Button variant="contained" onClick={handleRequestCredential}>
Authenticate with Credential
</Button>
</Button> */}
</div>
{storageToken ? null : (
<Button
Expand Down
38 changes: 23 additions & 15 deletions src/pages/dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ export default function Dialog({
});
};

const handleClick = () => {
setAppState();
setShowPopupPrompt(true);
};
useEffect(() => {
if (!signins?.length) {
setAppState();
Expand All @@ -39,19 +35,30 @@ export default function Dialog({
}, []);

return (
<div className="absolute top-10 right-10 min-w-[300px] max-h-[540px] overflow-auto rounded text-center p-3 bg-white">
<div className="absolute top-10 right-10 w-[320px] max-h-[540px] overflow-auto rounded text-center p-3 bg-white">
<header className="items-center justify-center">
<div className="flex flex-row gap-x-2 mb-2">
<img src={logo} className="h-8" alt="logo" />
<p className="text-2xl font-bold text-green">Sign in with KERI</p>
</div>

{showPopupPrompt ? (
<PopupPrompt message="Select the KERI icon in your browser to proceed" />
<PopupPrompt
message={
<p className="text-sm text-white">
Open{" "}
<span className="inline-block">
<img src={logo} className="h-4" alt="logo" />
</span>{" "}
to proceed
</p>
}
/>
) : null}
{!signins?.length && isConnected ? (
<p className=" text-sm text-green font-bold">
{tab?.url} is requesting an ID
<p className="mt-2 text-sm text-green max-w-[280px] font-bold">
<span className="">{tab?.url}</span> is requesting an{" "}
{eventType === "init-req-identifier" ? "ID" : "credential"}
</p>
) : null}

Expand All @@ -60,15 +67,16 @@ export default function Dialog({
{signins?.map((signin) => (
<SigninItem signin={signin} />
))}
<button
onClick={handleClick}
className="text-green font-bold text-sm cursor-pointer"
>
Select another{" "}
<div className="text-green font-bold text-sm cursor-pointer">
Open{" "}
<span className="inline-block">
<img src={logo} className="h-4" alt="logo" />
</span>{" "}
to select other{" "}
{eventType === "init-req-identifier"
? "identifier"
: "credential"}
</button>
: "credential"}{" "}
</div>
</>
) : null}
</header>
Expand Down
8 changes: 4 additions & 4 deletions src/pages/dialog/popupPrompt.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
interface IPopupPrompt {
message: string;
message: JSX.Element;
}

export const PopupPrompt = ({ message }: IPopupPrompt): JSX.Element => {
return (
<div className="flex max-w-[280px] flex-row border p-2 bg-gray-dark rounded">
<p className="text-sm text-white">{message}</p>
<div className="flex justify-center max-w-[280px] flex-row border p-2 bg-gray-dark rounded">
{message}
<svg
className="ml-2 h-6 w-6 rounded border-green animate-bounce"
className="ml-2 h-4 w-4 rounded border-green animate-bounce"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 197.091 197.091"
>
Expand Down

0 comments on commit 83e0e3c

Please sign in to comment.