Skip to content

Commit 4a4e908

Browse files
authored
Chore/#257-S : 웹접근성을 위한 태그에 속성 추가 (#259)
* feat : button 태그에 아이콘만 있는 경우 aria-label 추가 * feat : 웹접근성에 필요한 속성들 추가 * chore : role 속성만 추가
1 parent 6300385 commit 4a4e908

File tree

10 files changed

+25
-11
lines changed

10 files changed

+25
-11
lines changed

client/src/components/ConfMediaBar/StreamButton/CamButton/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function CamButton({ isOn, setIsCamOn }: CamButtonProps) {
1414
};
1515

1616
return (
17-
<button onClick={onClick}>
17+
<button onClick={onClick} aria-label={'캠 ' + (isOn ? '끄기' : '켜기')}>
1818
{isOn ? (
1919
<MdVideocam color={color.green} size={20} />
2020
) : (

client/src/components/ConfMediaBar/StreamButton/MicButton/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function MicButton({ isOn, setIsMicOn }: MicButtonProps) {
1414
};
1515

1616
return (
17-
<button onClick={onClick}>
17+
<button onClick={onClick} aria-label={'마이크 ' + (isOn ? '끄기' : '켜기')}>
1818
{isOn ? (
1919
<MdMic color={color.green} size={20} />
2020
) : (

client/src/components/Sidebar/MemberList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function MemberList({ members }: MemberListProps) {
1212
<ul className={style['member-list']}>
1313
{members.map((item) => (
1414
<li key={item.id} className={style['member-item']}>
15-
<img src={item.avatarUrl} />
15+
<img src={item.avatarUrl} alt={item.name + '의 프로필 사진'} />
1616
<span>{item.name}</span>
1717
</li>
1818
))}

client/src/components/Sidebar/MomList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useState, memo } from 'react';
1+
import { memo, useEffect, useState } from 'react';
22
import SOCKET_MESSAGE from 'src/constants/socket-message';
33
import useSocketContext from 'src/hooks/useSocketContext';
44
import { TMom } from 'src/types/mom';
@@ -48,7 +48,7 @@ function MomList({ moms, setSelectedMom }: MomListProps) {
4848
<h2>회의록</h2>
4949
<ul className={style['mom-list']}>
5050
{momList.map(({ _id: id, title }) => (
51-
<li key={id} onClick={() => onSelect(id)}>
51+
<li key={id} onClick={() => onSelect(id)} role="button">
5252
{title}
5353
</li>
5454
))}

client/src/components/WorkspaceList/AddButton.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ interface AddButtonProps {
66
onClick: React.MouseEventHandler;
77
}
88
function AddButton({ onClick }: AddButtonProps) {
9-
return <MdAdd onClick={onClick} className={style.button} size={20} />;
9+
return (
10+
<button className={style.button} onClick={onClick} aria-label="추가">
11+
<MdAdd size={20} color="white" />
12+
</button>
13+
);
1014
}
1115

1216
export default AddButton;

client/src/components/WorkspaceModal/FormModal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ function FormModal({
6060
value={inputValue}
6161
onChange={onChange}
6262
disabled={isDisabled}
63+
autoFocus
6364
/>
6465
</div>
6566

client/src/components/WorkspaceSettingModal/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,15 @@ function WorkspaceSettingModal({ title, onClose }: WorkspaceSettingModalProps) {
3232
return (
3333
<Modal title={title} isDark={true} onClose={onClose}>
3434
<>
35-
<label className={style['input-label']}>
35+
<label className={style['input-label']} htmlFor="code">
3636
<BiCodeBlock className={style['code-block-icon']} />
3737
<span className={style['label-title']}>참여코드</span>
3838
</label>
3939
<div className={style['input-section']}>
4040
<CopyButton className={style['copy-icon']} target={code} />
4141
<input
4242
className={style.input}
43+
id="code"
4344
type="text"
4445
value={code}
4546
disabled={true}
@@ -49,7 +50,7 @@ function WorkspaceSettingModal({ title, onClose }: WorkspaceSettingModalProps) {
4950
className={style.button}
5051
text="워크스페이스 탈퇴"
5152
onClick={onClick}
52-
></Button>
53+
/>
5354
</>
5455
</Modal>
5556
);

client/src/components/WorkspaceThumbnailList/WorkspaceThumbnailItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function WorkspaceThumbnailItem({
1616
onClick,
1717
}: WorkspaceThumbnailItemProps) {
1818
return (
19-
<li className={style.thumbnail} onClick={onClick}>
19+
<li className={style.thumbnail} onClick={onClick} role="button">
2020
<div className={style.thumbnail__content}>
2121
{/* <img src={imageUrl} /> */}
2222
{name[0]}

client/src/components/common/CopyButton/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ function CopyButton({ target, className }: CopyButtonProps) {
1515
}
1616
};
1717

18-
return <BiCopy className={className} onClick={onCopy} />;
18+
return (
19+
<button className={className} onClick={onCopy} aria-label="참여코드 복사">
20+
<BiCopy />
21+
</button>
22+
);
1923
}
2024

2125
export default CopyButton;

client/src/components/common/Modal/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ function Modal({ title, isDark = false, children, onClose }: ModalProps) {
2727
<div className={style['out-container']}>
2828
<div className={style.header} id="modal-heading">
2929
<h2 className={style.title}>{title}</h2>
30-
<button className={style['close-modal']} onClick={onClose}>
30+
<button
31+
className={style['close-modal']}
32+
onClick={onClose}
33+
aria-label="모달 창 닫기"
34+
>
3135
<MdClose size={20} color={'white'} />
3236
</button>
3337
</div>

0 commit comments

Comments
 (0)