Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { usePersistedConfigFile } from "./common/hook/usePersistedConfigFile";
import { NavigationBar } from "./components/NavigationBar";
import { FooterBar } from "./components/FooterBar";
import { SessionTimeout } from "./components/SessionTimeout";
import { Disclaimer } from "./components/Disclaimer";
import { routes, Routes } from "./routes";
import { history } from "./history";

Expand All @@ -26,6 +27,7 @@ export const App: React.FunctionComponent = () => {

return (
<>
<Disclaimer />
<NetworkBar network={configFile?.network}>
You are currently on <span className="capitalize">{configFile?.network}</span> network. To change it, please
upload a new config file.
Expand Down
31 changes: 31 additions & 0 deletions src/components/Disclaimer/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React, { useEffect, useState } from "react";
import { X } from "react-feather";

export const Disclaimer: React.FunctionComponent = () => {
const [show, setShow] = useState(false);

useEffect(() => {
setShow(true);
}, []);

if (!show) return null;

return (
<div className="bg-cerulean-800 text-white py-2 px-0 mb-2" data-testid="old-verifier-banner">
<div className="container">
<div className="flex items-start justify-between">
<div className="flex-1 flex justify-center">
<p className="mb-0 text-center">
<strong>Disclaimer:</strong> The Creator tool and Config file are for testing and demonstration purposes
only. They are not recommended for production or live issuance of documents. Use the TrustVC library for
production use.
</p>
</div>
<div className="cursor-pointer hover:text-gray-500">
<X data-testid="disclaimer-close" onClick={() => setShow(false)} />
</div>
Comment on lines +24 to +26
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix accessibility violations in the close button.

The close control has several accessibility issues:

  • It's a div instead of a semantic button element, preventing keyboard navigation
  • Missing aria-label for screen readers to announce its purpose
  • No keyboard event handlers (Enter/Space keys) for keyboard-only users

These issues prevent keyboard users and screen reader users from dismissing the banner.

🔎 Proposed fix for accessibility
-          <div className="cursor-pointer hover:text-gray-500">
-            <X data-testid="disclaimer-close" onClick={() => setShow(false)} />
-          </div>
+          <button
+            className="bg-transparent border-0 cursor-pointer hover:text-gray-500 p-0 flex items-center"
+            onClick={() => setShow(false)}
+            aria-label="Close disclaimer"
+            data-testid="disclaimer-close"
+          >
+            <X />
+          </button>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div className="cursor-pointer hover:text-gray-500">
<X data-testid="disclaimer-close" onClick={() => setShow(false)} />
</div>
<button
className="bg-transparent border-0 cursor-pointer hover:text-gray-500 p-0 flex items-center"
onClick={() => setShow(false)}
aria-label="Close disclaimer"
data-testid="disclaimer-close"
>
<X />
</button>
🤖 Prompt for AI Agents
In src/components/Disclaimer/index.tsx around lines 24-26, the close control is
a non-semantic div without keyboard support or an accessible name; replace the
div with a semantic <button type="button">, move the onClick handler to that
button, add an aria-label (e.g., "Close disclaimer") and keep the X icon inside
(preserve data-testid on the icon or button), ensure the button retains the same
className styling and includes visible focus styles so keyboard users can tab to
and activate it with Enter/Space.

</div>
</div>
</div>
);
};
Loading