Skip to content

Commit

Permalink
chore: add aria label attribute to links & buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Anmol-Baranwal committed Aug 3, 2023
1 parent 27fb80a commit 0b35d68
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 13 deletions.
1 change: 1 addition & 0 deletions components/BackToTop/BackToTopButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const BackToTopButton = () => {
className={buttonClasses}
onClick={handleClick}
title="Back to top"
aria-label="Back to top button"
>
<FaArrowUp className="group-hover:text-theme-secondary" />
</button>
Expand Down
8 changes: 7 additions & 1 deletion components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,17 @@ export const Footer: FC = () => {
href="https://linkfree.io/rupali-codes"
target="_blank"
rel="noopener noreferrer"
aria-label="GitHub Profile of Rupali Haldiya"
>
<span className={nameStyles}>Rupali Haldiya</span>
</Link>{' '}
and{' '}
<Link href="/contributors" rel="noopener noreferrer" target="_blank">
<Link
href="/contributors"
rel="noopener noreferrer"
target="_blank"
aria-label="List of Contributors in LinksHub"
>
<span className={nameStyles}>Open Source Community</span>
</Link>
</p>
Expand Down
3 changes: 2 additions & 1 deletion components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const Header: FC = () => {
return (
<header className="fixed top-0 left-0 z-30 row-start-1 row-end-2 flex h-[76px] w-screen items-center justify-between bg-light-primary dark:bg-dark">
<div className="bg-[rgba(255,255,255,0.3)] h-full w-fit flex-none px-6 py-4 dark:bg-dark lg:w-[290px]">
<Link href="/">
<Link href="/" aria-label="LinksHub Logo">
<Logo className="text-3xl" />
</Link>
</div>
Expand All @@ -25,6 +25,7 @@ export const Header: FC = () => {
<button
className="dark:text-text-primary lg:hidden"
onClick={toggleNav}
aria-label="toggle button"
>
<AiOutlineMenu size={24} />
</button>
Expand Down
15 changes: 8 additions & 7 deletions components/NewIssue/NewIssue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ const NewIssue: FC = () => {
return (
<div className="pt-6 md:p-0 text-xl w-fit m-auto">
<span>Be the first to add by creating a GitHub issue </span>
<Link
className="dark:text-theme-primary text-theme-secondary underline"
href="https://github.com/rupali-codes/LinksHub/issues/new?assignees=&labels=add+link&template=add_link.yml&title=%5BAdd%5D+%3Cname%3E"
target="_blank"
>
here
</Link>
<Link
className="dark:text-theme-primary text-theme-secondary underline"
href="https://github.com/rupali-codes/LinksHub/issues/new?assignees=&labels=add+link&template=add_link.yml&title=%5BAdd%5D+%3Cname%3E"
target="_blank"
aria-label="Page to create new Issue"
>
here
</Link>
</div>
)
}
Expand Down
1 change: 1 addition & 0 deletions components/Searchbar/Searchbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export const Searchbar: React.FC<SearchbarProps> = ({ setSearch }) => {
<button
type="submit"
className="ml-2 px-4 py-2.5 bg-theme-secondary text-light-primary rounded-md border border-dashed border-transparent hover:border-theme-primary hover:bg-transparent hover:text-theme-primary dark:hover:text-theme-primary transition-colors transition duration-300 ease-in-out"
aria-label="submit query button"
>
<SearchIcon className="w-5 h-5" />
</button>
Expand Down
1 change: 1 addition & 0 deletions components/SideNavbar/SideNavbarCategory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const SideNavbarCategory: FC<{
<button
className="flex w-full cursor-pointer justify-between py-2"
onClick={handleToggle}
aria-label="toggle category"
>
<h1 className="font-bold uppercase">{item.category}</h1>
<FaAngleDown
Expand Down
1 change: 1 addition & 0 deletions components/SideNavbar/SideNavbarElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const SideNavbarElement = ({ name, url }: SubCategories) => {
return (
<Link
href={url}
aria-label="Side Navbar Elements"
onClick={closeNav}
className={`${
router.asPath === url
Expand Down
3 changes: 2 additions & 1 deletion components/SideNavbar/SideNavbarHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ export const SideNavbarHeader: FC = () => {
return (
<header>
<div className="flex items-center justify-between bg-gray-100 p-4 dark:bg-gray-900">
<Link href={'/'}>
<Link href={'/'} aria-label="Side Navbar Header Linking with Logo">
<Logo className="text-3xl" />
</Link>
<button
className="h-[24px] w-[24px] dark:text-gray-300 lg:hidden"
onClick={toggleNav}
aria-label="Toggle sidebar navigation"
>
<AiOutlineClose size={24} id="hamburger" />
</button>
Expand Down
11 changes: 9 additions & 2 deletions components/ThemeToggler/themeToggler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,18 @@ export function ThemeToggler() {
<button
onClick={handleThemeToggle}
title={`Toggle dark mode (current state: ${resolvedTheme})`}
aria-label="Toggle dark mode"
>
{resolvedTheme === 'dark' ? (
<HiSun {...iconProps} className='text-light-primary hover:text-theme-primary transition duration-300 ease-in-out' />
<HiSun
{...iconProps}
className="text-light-primary hover:text-theme-primary transition duration-300 ease-in-out"
/>
) : (
<HiMoon {...iconProps} className='text-text-secondary hover:text-theme-primary transition duration-300 ease-in-out' />
<HiMoon
{...iconProps}
className="text-text-secondary hover:text-theme-primary transition duration-300 ease-in-out"
/>
)}
</button>
)
Expand Down
2 changes: 2 additions & 0 deletions pages/contributors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,14 @@ const ContributorsPage: FC<{ contributors: Contributor[] }> = ({
<Link
href={`https://github.com/${contributor.login}`}
{...linkProps}
aria-label={`GitHub Profile of ${contributor.login}`}
>
GitHub
</Link>
<Link
href={`https://github.com/rupali-codes/LinksHub/commits?author=${contributor.login}`}
{...linkProps}
aria-label={`Commit History of ${contributor.login} in LinksHub`}
>
Contributions
</Link>
Expand Down
5 changes: 4 additions & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ export default function Home() {
/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#202c46" />
<meta name="keywords" content="LinksHub, developers, free resources, tools, software, libraries, frameworks, applications, websites" />
<meta
name="keywords"
content="LinksHub, developers, free resources, tools, software, libraries, frameworks, applications, websites"
/>
<meta name="author" content="Rupali Haldiya" />
<meta name="robots" content="index, follow" />
<meta name="revisit-after" content="7 days" />
Expand Down

0 comments on commit 0b35d68

Please sign in to comment.