Skip to content

Commit 1a90473

Browse files
authored
Merge pull request #61 from Lemoncode/#35--app-should-work-using-keyboard
#35 app should work using keyboard
2 parents d677480 + 03f0351 commit 1a90473

2 files changed

Lines changed: 26 additions & 5 deletions

File tree

‎front/src/pods/trainer/components/header.component.tsx‎

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,14 @@ interface CopyFieldProps {
3939

4040
export const CopyFieldComponent: React.FC<CopyFieldProps> = props => {
4141
const { labelName, inputId, urlLink } = props;
42-
const { inputField, label, inputIconContainer, textArea, copyIcon } = classes;
42+
const {
43+
inputField,
44+
label,
45+
inputIconContainer,
46+
textArea,
47+
copyIcon,
48+
copyBtn,
49+
} = classes;
4350
return (
4451
<div className={inputField}>
4552
<label className={label} htmlFor={inputId}>
@@ -52,12 +59,16 @@ export const CopyFieldComponent: React.FC<CopyFieldProps> = props => {
5259
size="small"
5360
className={textArea}
5461
value={urlLink}
55-
disabled
62+
read-only
63+
aria-readonly
5664
/>
57-
<FileCopyOutlinedIcon
58-
className={copyIcon}
65+
<button
66+
aria-label={`copy ${labelName}`}
67+
className={copyBtn}
5968
onClick={() => navigator.clipboard.writeText(urlLink)}
60-
/>
69+
>
70+
<FileCopyOutlinedIcon className={copyIcon} />
71+
</button>
6172
</div>
6273
</div>
6374
);

‎front/src/pods/trainer/components/header.styles.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,13 @@ export const copyIcon = css`
3838
color: ${palette.secondary.main};
3939
}
4040
`;
41+
42+
export const copyBtn = css`
43+
background-color: ${palette.background.default};
44+
border: none;
45+
outline: none;
46+
&:focus {
47+
border: 1px solid ${palette.secondary.main};
48+
border-radius: 0.2rem;
49+
}
50+
`;

0 commit comments

Comments
 (0)