Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Commit

Permalink
Some Wave/WebAim recommended fixes. (#1635)
Browse files Browse the repository at this point in the history
  • Loading branch information
fairlighteth committed Nov 20, 2020
1 parent 81e7ef0 commit 43ca2ef
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
17 changes: 14 additions & 3 deletions src/components/common/Tabs/TabItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ interface WrapperProps {
isActive: boolean
}

const Wrapper = styled.li<WrapperProps>`
const Wrapper = styled.button<WrapperProps>`
background: ${({ isActive, activeColor }): string => `var(${isActive ? activeColor : '--color-primary'})`};
color: ${({ isActive }): string => `var(--color-text-${isActive ? 'primary' : 'secondary2'})`};
color: ${({ isActive }): string => `var(--color-${isActive ? 'primary' : 'secondary2'})`};
height: var(--height-button-default);
display: flex;
align-items: center;
Expand All @@ -25,8 +25,13 @@ const Wrapper = styled.li<WrapperProps>`
font-size: var(--font-size-large);
letter-spacing: 0.1rem;
text-align: center;
appearance: none;
border: 0;
justify-content: center;
cursor: pointer;
outline: 0;
/* TODO: Provide alternative :focus styling because of using outline: 0; */
&:first-of-type {
border-top-left-radius: var(--border-radius-default);
Expand All @@ -43,7 +48,13 @@ const TabItem: React.FC<TabProps> = (props) => {
const { onTabClick, id, title, isActive, activeColor } = props

return (
<Wrapper activeColor={activeColor} isActive={isActive} onClick={(): void => onTabClick(id)}>
<Wrapper
role="tab"
activeColor={activeColor}
aria-selected={isActive}
isActive={isActive}
onClick={(): void => onTabClick(id)}
>
{title}
</Wrapper>
)
Expand Down
6 changes: 3 additions & 3 deletions src/components/common/Tabs/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const Wrapper = styled.div`
flex-flow: column;
width: 100%;
> ul {
> div {
list-style: none;
display: flex;
flex-flow: row nowrap;
Expand All @@ -30,7 +30,7 @@ const Tabs: React.FC<Props> = (props) => {

return (
<Wrapper>
<ul>
<div role="tablist">
{props.tabItems.map(({ id, title, activeColor }) => (
<TabItem
key={id}
Expand All @@ -41,7 +41,7 @@ const Tabs: React.FC<Props> = (props) => {
activeColor={activeColor}
/>
))}
</ul>
</div>
<TabContent tabItems={props.tabItems} activeTab={activeTab} />
</Wrapper>
)
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/GenericLayout/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ interface Props {
export const Header: React.FC<Props> = ({ menu, tools }) => (
<HeaderStyled>
<Logo to="/v2" href="#">
<img src={LogoImage} />
<img src={LogoImage} alt="Trading interface homepage" />
</Logo>
{menu}
{tools}
Expand Down

0 comments on commit 43ca2ef

Please sign in to comment.