Skip to content

Commit 528e7a3

Browse files
committed
feat(SocialButton): refactor component for improved accessibility
1 parent ff11e79 commit 528e7a3

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

packages/orbit-components/src/SocialButton/helpers/getSocialButtonIcon.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import Email from "../../icons/Email";
99
import type { Type } from "../types";
1010

1111
const getSocialButtonIcon = (type: Type): React.ReactNode | null => {
12-
if (type === TYPE_OPTIONS.APPLE) return <Apple />;
13-
if (type === TYPE_OPTIONS.FACEBOOK) return <Facebook />;
14-
if (type === TYPE_OPTIONS.GOOGLE) return <Google />;
15-
if (type === TYPE_OPTIONS.X) return <X />;
16-
if (type === TYPE_OPTIONS.EMAIL) return <Email />;
12+
if (type === TYPE_OPTIONS.APPLE) return <Apple ariaHidden />;
13+
if (type === TYPE_OPTIONS.FACEBOOK) return <Facebook ariaHidden />;
14+
if (type === TYPE_OPTIONS.GOOGLE) return <Google ariaHidden />;
15+
if (type === TYPE_OPTIONS.X) return <X ariaHidden />;
16+
if (type === TYPE_OPTIONS.EMAIL) return <Email ariaHidden />;
1717

1818
return null;
1919
};

packages/orbit-components/src/SocialButton/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const SocialButton = React.forwardRef<HTMLButtonElement, Props>(
3737
<ChevronForwardIcon
3838
customColor={type === TYPE_OPTIONS.APPLE ? "#FFF" : ""}
3939
color="primary"
40+
ariaHidden
4041
/>
4142
}
4243
circled={false}

0 commit comments

Comments
 (0)