Skip to content

Commit 2d38735

Browse files
committed
update volume icons
Signed-off-by: Adam Setch <[email protected]>
1 parent 8d5e5c9 commit 2d38735

File tree

4 files changed

+100
-78
lines changed

4 files changed

+100
-78
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import type { FC } from 'react';
2+
3+
export const VolumeDownIcon: FC = () => (
4+
<svg
5+
className="size-4"
6+
xmlns="http://www.w3.org/2000/svg"
7+
viewBox="0 0 24 24"
8+
width="24"
9+
height="24"
10+
role="img"
11+
aria-label="Volume Down Icon"
12+
>
13+
<g transform="translate(2, 0)">
14+
<path d="M11.553 3.064A.75.75 0 0 1 12 3.75v16.5a.75.75 0 0 1-1.255.555L5.46 16H2.75A1.75 1.75 0 0 1 1 14.25v-4.5C1 8.784 1.784 8 2.75 8h2.71l5.285-4.805a.752.752 0 0 1 .808-.13ZM10.5 5.445l-4.245 3.86a.748.748 0 0 1-.505.195h-3a.25.25 0 0 0-.25.25v4.5c0 .138.112.25.25.25h3c.187 0 .367.069.505.195l4.245 3.86z" />
15+
<path d="M16.243 7.757a.75.75 0 1 0-1.061 1.061 4.5 4.5 0 0 1 0 6.364.75.75 0 0 0 1.06 1.06 6 6 0 0 0 0-8.485Z" />
16+
</g>
17+
</svg>
18+
);
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import type { FC } from 'react';
2+
3+
export const VolumeUpIcon: FC = () => (
4+
<svg
5+
className="size-4"
6+
xmlns="http://www.w3.org/2000/svg"
7+
viewBox="0 0 24 24"
8+
width="24"
9+
height="24"
10+
role="img"
11+
aria-label="Volume Up Icon"
12+
>
13+
<path d="M11.553 3.064A.75.75 0 0 1 12 3.75v16.5a.75.75 0 0 1-1.255.555L5.46 16H2.75A1.75 1.75 0 0 1 1 14.25v-4.5C1 8.784 1.784 8 2.75 8h2.71l5.285-4.805a.752.752 0 0 1 .808-.13ZM10.5 5.445l-4.245 3.86a.748.748 0 0 1-.505.195h-3a.25.25 0 0 0-.25.25v4.5c0 .138.112.25.25.25h3c.187 0 .367.069.505.195l4.245 3.86Zm8.218-1.223a.75.75 0 0 1 1.06 0c4.296 4.296 4.296 11.26 0 15.556a.75.75 0 0 1-1.06-1.06 9.5 9.5 0 0 0 0-13.436.75.75 0 0 1 0-1.06Z" />
14+
<path d="M16.243 7.757a.75.75 0 1 0-1.061 1.061 4.5 4.5 0 0 1 0 6.364.75.75 0 0 0 1.06 1.06 6 6 0 0 0 0-8.485Z" />
15+
</svg>
16+
);

src/renderer/components/settings/SystemSettings.tsx

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
import { type FC, useContext } from 'react';
22

3-
import {
4-
DashIcon,
5-
DeviceDesktopIcon,
6-
PlusIcon,
7-
XCircleIcon,
8-
} from '@primer/octicons-react';
9-
3+
import { DeviceDesktopIcon, SyncIcon } from '@primer/octicons-react';
104
import {
115
Box,
126
Button,
@@ -22,8 +16,9 @@ import { AppContext, defaultSettings } from '../../context/App';
2216
import { OpenPreference } from '../../types';
2317
import { Constants } from '../../utils/constants';
2418
import { Checkbox } from '../fields/Checkbox';
25-
import { FieldLabel } from '../fields/FieldLabel';
2619
import { RadioGroup } from '../fields/RadioGroup';
20+
import { VolumeDownIcon } from '../icons/VolumeDownIcon';
21+
import { VolumeUpIcon } from '../icons/VolumeUpIcon';
2722
import { Title } from '../primitives/Title';
2823

2924
export const SystemSettings: FC = () => {
@@ -84,30 +79,25 @@ export const SystemSettings: FC = () => {
8479
}
8580
/>
8681

87-
<Checkbox
88-
name="playSound"
89-
label="Play sound"
90-
checked={settings.playSound}
91-
onChange={(evt) => updateSetting('playSound', evt.target.checked)}
92-
/>
93-
94-
<Box className="pl-6" hidden={!settings.playSound}>
82+
<Box>
9583
<Stack
9684
direction="horizontal"
9785
gap="condensed"
9886
align="center"
9987
className="text-sm"
10088
>
101-
<FieldLabel
102-
name="notificationVolume"
103-
label="Notification volume:"
89+
<Checkbox
90+
name="playSound"
91+
label="Play sound"
92+
checked={settings.playSound}
93+
onChange={(evt) => updateSetting('playSound', evt.target.checked)}
10494
/>
10595

106-
<ButtonGroup className="ml-2">
96+
<ButtonGroup className="ml-2" hidden={!settings.playSound}>
10797
<IconButton
10898
aria-label="Volume down"
10999
size="small"
110-
icon={DashIcon}
100+
icon={VolumeDownIcon}
111101
unsafeDisableTooltip={true}
112102
onClick={() => {
113103
const newVolume = Math.max(
@@ -126,7 +116,7 @@ export const SystemSettings: FC = () => {
126116
<IconButton
127117
aria-label="Volume up"
128118
size="small"
129-
icon={PlusIcon}
119+
icon={VolumeUpIcon}
130120
unsafeDisableTooltip={true}
131121
onClick={() => {
132122
const newVolume = Math.min(
@@ -142,7 +132,7 @@ export const SystemSettings: FC = () => {
142132
aria-label="Reset volume"
143133
size="small"
144134
variant="danger"
145-
icon={XCircleIcon}
135+
icon={SyncIcon}
146136
unsafeDisableTooltip={true}
147137
onClick={() => {
148138
updateSetting(

src/renderer/routes/__snapshots__/Settings.test.tsx.snap

Lines changed: 53 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)