Skip to content

Commit

Permalink
Merge pull request #676 from Financial-Times/CI-1368-DAC_Missing_Visu…
Browse files Browse the repository at this point in the history
…al_Label_01

[CI-1368] fix accessibility errors
  • Loading branch information
juanSanchezAlcala authored Oct 31, 2022
2 parents e35bdf8 + 0ccb549 commit 1833837
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 2 additions & 0 deletions components/x-gift-article/src/Buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
text-align: left;
white-space: nowrap;
margin-top: 12px;
display: flex;
align-items: end;
}

.x-gift-article-button--gap {
Expand Down
5 changes: 4 additions & 1 deletion components/x-gift-article/src/ReferAFriend.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ export default ({ rafTitle, rafDescription, urls, actions }) => {
data-trackable={UrlType.raf + 'Link'}
>
<span className="o-forms-input o-forms-input--text">
<label className="x-gift-article__label-link" htmlFor="refer-friend-link">
Gift 2 month free access link
</label>
<input
id="refer-friend-link"
type="text"
name={UrlType.raf}
value={urls.raf}
className="x-gift-article__url-input"
readOnly
aria-label={rafTitle}
/>
</span>
<div className="x-gift-article__buttons">
Expand Down
7 changes: 5 additions & 2 deletions components/x-gift-article/src/Url.jsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import { h } from '@financial-times/x-engine'
import { ShareType } from './lib/constants'

export default ({ shareType, isGiftUrlCreated, url, urlType, ariaLabel }) => {
export default ({ shareType, isGiftUrlCreated, url, urlType }) => {
return (
<span className="o-forms-input o-forms-input--text">
<label className="x-gift-article__label-link" htmlFor="share-link">
Gift article shareable link
</label>
<input
id="share-link"
type="text"
name={urlType}
value={url}
className="x-gift-article__url-input"
disabled={(shareType === ShareType.gift || shareType === ShareType.enterprise) && !isGiftUrlCreated}
readOnly
aria-label={ariaLabel}
/>
</span>
)
Expand Down
6 changes: 2 additions & 4 deletions components/x-gift-article/src/UrlSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ export default ({
enterpriseLimit,
enterpriseHasCredits,
enterpriseRequestAccess,
enterpriseFirstTimeUser,
title
enterpriseFirstTimeUser
}) => {
const hideUrlShareElements =
(giftCredits === 0 && shareType === ShareType.gift) ||
Expand All @@ -43,8 +42,7 @@ export default ({
shareType,
isGiftUrlCreated,
url,
urlType,
ariaLabel: title
urlType
}}
/>
)}
Expand Down

0 comments on commit 1833837

Please sign in to comment.