Add aria props

This commit is contained in:
Chi Vinh Le
2018-07-10 16:29:07 -03:00
parent 15cbb94756
commit 5e5b0a3888
3 changed files with 40 additions and 34 deletions
@@ -21,7 +21,7 @@ const Comment: StatelessComponent<CommentProps> = props => {
[styles.gutterBottom]: props.gutterBottom,
});
return (
<div className={rootClassName}>
<div className={rootClassName} role="article">
<div className={styles.topBar}>
{props.author && <Username>{props.author.username}</Username>}
</div>
+18 -15
View File
@@ -17,21 +17,24 @@ export interface ReplyListProps {
const ReplyList: StatelessComponent<ReplyListProps> = props => {
return (
<Indent>
{props.comments.map(comment => (
<CommentContainer key={comment.id} data={comment} gutterBottom />
))}
{props.hasMore && (
<Button
id={`talk-reply-list--show-all--${props.commentID}`}
onClick={props.onShowAll}
disabled={props.disableShowAll}
secondary
invert
fullWidth
>
Show All Replies
</Button>
)}
<div id={`talk-reply-list--log--${props.commentID}`} role="log">
{props.comments.map(comment => (
<CommentContainer key={comment.id} data={comment} gutterBottom />
))}
{props.hasMore && (
<Button
id={`talk-reply-list--show-all--${props.commentID}`}
onClick={props.onShowAll}
disabled={props.disableShowAll}
secondary
invert
fullWidth
aria-controls={`talk-reply-list--log--${props.commentID}`}
>
Show All Replies
</Button>
)}
</div>
</Indent>
);
};
+21 -18
View File
@@ -26,24 +26,27 @@ const Stream: StatelessComponent<StreamProps> = props => {
<div>
<Logo gutterBottom />
<PostCommentFormContainer assetID={props.assetID} />
{props.comments.map(comment => (
<div key={comment.id}>
<CommentContainer data={comment} gutterBottom />
<ReplyListContainer comment={comment} />
</div>
))}
{props.hasMore && (
<Button
id={"talk-stream--load-more"}
onClick={props.onLoadMore}
secondary
invert
fullWidth
disabled={props.disableLoadMore}
>
Load More
</Button>
)}
<div id="talk-stream--log" role="log" aria-live="polite">
{props.comments.map(comment => (
<div key={comment.id}>
<CommentContainer data={comment} gutterBottom />
<ReplyListContainer comment={comment} />
</div>
))}
{props.hasMore && (
<Button
id={"talk-stream--load-more"}
onClick={props.onLoadMore}
secondary
invert
fullWidth
disabled={props.disableLoadMore}
aria-controls="talk-stream--log"
>
Load More
</Button>
)}
</div>
</div>
);
};