Skip to content

Commit

Permalink
fix: make close button focusable (#1092)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanaffi authored Jun 1, 2022
1 parent db31829 commit d3a6132
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
2 changes: 2 additions & 0 deletions src/less/components/settings.less
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@
cursor: pointer;
border-radius: 15px;
color: var(--text-color-3);
padding: 0 0;
border: 0;

&:hover {
color: @text-color-1;
Expand Down
7 changes: 5 additions & 2 deletions src/renderer/components/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,12 @@ export const Settings = observer(
<ul>{this.renderOptions()}</ul>
</div>
<div className="settings-content">
<div className="settings-close" onClick={appState.toggleSettings}>
<button
className="settings-close"
onClick={appState.toggleSettings}
>
<Icon icon="cross" iconSize={25} />
</div>
</button>
{this.renderContent()}
</div>
</div>
Expand Down
24 changes: 12 additions & 12 deletions tests/renderer/components/__snapshots__/settings-spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ exports[`Settings component renders only the menu if page unknown 1`] = `
<div
className="settings-content"
>
<div
<button
className="settings-close"
>
<Blueprint3.Icon
icon="cross"
iconSize={25}
/>
</div>
</button>
</div>
</div>
`;
Expand Down Expand Up @@ -134,14 +134,14 @@ exports[`Settings component renders the Credits page after a click 1`] = `
<div
className="settings-content"
>
<div
<button
className="settings-close"
>
<Blueprint3.Icon
icon="cross"
iconSize={25}
/>
</div>
</button>
<settings-credits
appState={
Object {
Expand Down Expand Up @@ -214,14 +214,14 @@ exports[`Settings component renders the Electron page after a click 1`] = `
<div
className="settings-content"
>
<div
<button
className="settings-close"
>
<Blueprint3.Icon
icon="cross"
iconSize={25}
/>
</div>
</button>
<settings-electron
appState={
Object {
Expand Down Expand Up @@ -294,14 +294,14 @@ exports[`Settings component renders the Electron page by default 1`] = `
<div
className="settings-content"
>
<div
<button
className="settings-close"
>
<Blueprint3.Icon
icon="cross"
iconSize={25}
/>
</div>
</button>
<settings-general
appState={
Object {
Expand Down Expand Up @@ -375,14 +375,14 @@ exports[`Settings component renders the Execution page after a click 1`] = `
<div
className="settings-content"
>
<div
<button
className="settings-close"
>
<Blueprint3.Icon
icon="cross"
iconSize={25}
/>
</div>
</button>
<ExecutionSettings
appState={
Object {
Expand Down Expand Up @@ -455,14 +455,14 @@ exports[`Settings component renders the General page after a click 1`] = `
<div
className="settings-content"
>
<div
<button
className="settings-close"
>
<Blueprint3.Icon
icon="cross"
iconSize={25}
/>
</div>
</button>
<settings-general
appState={
Object {
Expand Down

0 comments on commit d3a6132

Please sign in to comment.