Skip to content

Commit

Permalink
adds aria-labels to relevant elements so that it passes the lighthous…
Browse files Browse the repository at this point in the history
…e test
  • Loading branch information
bordalix authored and fiatjaf committed Nov 18, 2023
1 parent 04207bf commit 15e0919
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/Editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,18 @@ export function Editor({
value={comment}
readOnly={!editable}
onChange={e => setComment(e.target.value)}
aria-label="comment text area"
/>
<InputSectionRow2>
<Notices>
{notices.map(notice => (
<Notice key={notice.text}>{notice.text}</Notice>
))}
</Notices>
<InfoButton onClick={() => setIsInfoOpen(!isInfoOpen)}>
<InfoButton
onClick={() => setIsInfoOpen(!isInfoOpen)}
aria-label="info button"
>
<SvgInfo
xmlns="http://www.w3.org/2000/svg"
x="0px"
Expand All @@ -67,6 +71,9 @@ export function Editor({
<PostButton
onClick={publicKey ? publishEvent : establishNostrKey}
disabled={!editable}
aria-label={
publicKey ? (editable ? 'Post comment' : 'Submitting') : 'Comment'
}
>
{publicKey ? (editable ? 'Post comment' : 'Submitting') : 'Comment'}
</PostButton>
Expand Down
2 changes: 1 addition & 1 deletion src/ReplyButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const ChatBubbleIcon = () => (

const ReplyButton = ({onClick}) => {
return (
<GhostButton type="button" onClick={onClick}>
<GhostButton type="button" onClick={onClick} aria-label="reply button">
<ChatBubbleIcon />
</GhostButton>
)
Expand Down
5 changes: 4 additions & 1 deletion src/Thread.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ export default function Thread({
href={'nostr:' + nip19.npubEncode(thread.pubkey)}
>
{getImage(metadata, thread.pubkey) && (
<CommentAuthorImage src={getImage(metadata, thread.pubkey)} />
<CommentAuthorImage
src={getImage(metadata, thread.pubkey)}
aria-label="comment author image"
/>
)}
{getName(metadata, thread.pubkey)}
</CommentAuthor>{' '}
Expand Down

0 comments on commit 15e0919

Please sign in to comment.