setHovered("explore")}
onMouseLeave={() => setHovered(null)}
+ aria-label="Scroll to explore section" // Added aria-label
>
Explore
setHovered("help")}
onMouseLeave={() => setHovered(null)}
+ aria-label="Open help menu" // Added aria-label
>
@@ -197,6 +207,7 @@ function Navbar({ scrollToExplore }: { scrollToExplore: any }) {
}}
onMouseEnter={() => setHovered("join")}
onMouseLeave={() => setHovered(null)}
+ aria-label="Navigate to learn section" // Added aria-label
>
Learn
@@ -231,6 +243,7 @@ function Navbar({ scrollToExplore }: { scrollToExplore: any }) {
}}
onMouseEnter={() => setHovered("github")}
onMouseLeave={() => setHovered(null)}
+ aria-label="Navigate to GitHub repository" // Added aria-label
>
{screens.md &&
Github}
diff --git a/src/components/SampleDropdown.tsx b/src/components/SampleDropdown.tsx
index 00deb7d..ca89f4f 100644
--- a/src/components/SampleDropdown.tsx
+++ b/src/components/SampleDropdown.tsx
@@ -33,9 +33,14 @@ function SampleDropdown({ setLoading }: { setLoading: any }) {
return (
-
+
-
diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx
index d139357..8ca188d 100644
--- a/src/components/Sidebar.tsx
+++ b/src/components/Sidebar.tsx
@@ -25,6 +25,7 @@ const Sidebar: React.FC<{ steps: { title: string; link: string }[] }> = ({
(isActive ? "active" : undefined)}
+ aria-label={`Navigate to step: ${step.title}`} // Added ARIA label for better navigation context
>
{step.title}
@@ -34,12 +35,17 @@ const Sidebar: React.FC<{ steps: { title: string; link: string }[] }> = ({
-
+ {/* Added ARIA label to describe the purpose of the icon */}
Welcome to the Learning Pathway! Use the sidebar to follow the guide.
Open the{" "}
-
+
Template Playground
{" "}
in another tab to experiment as you learn.
diff --git a/src/components/ToggleDarkMode.tsx b/src/components/ToggleDarkMode.tsx
index 16366fa..428391c 100644
--- a/src/components/ToggleDarkMode.tsx
+++ b/src/components/ToggleDarkMode.tsx
@@ -23,9 +23,10 @@ const ToggleDarkMode: React.FC = () => {
onChange={handleChange}
checked={isDarkMode}
size={80}
+ aria-label="Toggle dark mode" // Added aria-label for accessibility
/>
);
};
-export default ToggleDarkMode;
\ No newline at end of file
+export default ToggleDarkMode;
diff --git a/src/components/UseShare.tsx b/src/components/UseShare.tsx
index 4a81f1e..4886f81 100644
--- a/src/components/UseShare.tsx
+++ b/src/components/UseShare.tsx
@@ -22,7 +22,12 @@ const UseShare = () => {
return (
- } onClick={handleCopy}>
+ }
+ onClick={handleCopy}
+ // Added aria-label to describe the button's purpose
+ aria-label={copied ? "Link copied to clipboard" : "Share a link"}
+ >
{copied ? "Copied!" : "Share"}
diff --git a/src/utils/helpers/Errors.tsx b/src/utils/helpers/Errors.tsx
index 4c4a5e4..0114d7a 100644
--- a/src/utils/helpers/Errors.tsx
+++ b/src/utils/helpers/Errors.tsx
@@ -3,9 +3,16 @@ import { Alert, Space } from "antd";
function Errors() {
const error = useAppStore((state) => state.error);
+
return error ? (
-
-
+
+ {/* Added aria-live="assertive" to announce the error message immediately */}
+
) : (
<>>