Skip to content

Commit ac5a7f9

Browse files
committed
Convert theme picker to Phosphor icons
1 parent c771afa commit ac5a7f9

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

src/components/common/tabbed-options.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22

3-
import { Icon, IconProp } from '../../icons';
3+
import { Icon, IconKey } from '../../icons';
44
import { styled, css } from '../../styles';
55
import { omit } from 'lodash';
66
import { UnstyledButton } from './inputs';
@@ -45,7 +45,7 @@ export const TabsContainer = styled((p: {
4545
export const Tab = styled((p: {
4646
className?: string,
4747
selected?: boolean,
48-
icon: IconProp,
48+
icon: IconKey,
4949
value: any,
5050
children: React.ReactNode
5151
}) =>
@@ -56,7 +56,7 @@ export const Tab = styled((p: {
5656
event.tabValue = p.value;
5757
}}
5858
>
59-
<Icon icon={p.icon} size='2x' />
59+
<Icon icon={p.icon} />
6060
{ p.children }
6161
</UnstyledButton>
6262
)`
@@ -89,5 +89,7 @@ export const Tab = styled((p: {
8989
9090
> svg {
9191
margin-bottom: 10px;
92+
width: 2em;
93+
height: auto;
9294
}
9395
`;

src/components/settings/settings-page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,25 +300,25 @@ class SettingsPage extends React.Component<SettingsPageProps> {
300300
}}
301301
>
302302
<Tab
303-
icon={['fas', 'magic']}
303+
icon='MagicWand'
304304
value='automatic'
305305
>
306306
Automatic
307307
</Tab>
308308
<Tab
309-
icon={['fas', 'sun']}
309+
icon='Sun'
310310
value='light'
311311
>
312312
Light
313313
</Tab>
314314
<Tab
315-
icon={['fas', 'moon']}
315+
icon='Moon'
316316
value='dark'
317317
>
318318
Dark
319319
</Tab>
320320
<Tab
321-
icon={['fas', 'adjust']}
321+
icon='CircleHalf'
322322
value='high-contrast'
323323
>
324324
High Contrast

src/icons.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ import {
1919
Plug,
2020
QuestionMark,
2121
ArrowLeft,
22+
MagicWand,
23+
Sun,
24+
Moon,
25+
CircleHalf
2226
} from '@phosphor-icons/react';
2327

2428
export type IconKey = keyof typeof Icons;
@@ -46,6 +50,10 @@ const Icons = {
4650
Plug,
4751
QuestionMark,
4852
ArrowLeft,
53+
MagicWand,
54+
Sun,
55+
Moon,
56+
CircleHalf
4957
} as const;
5058

5159
// Import required FA icons:

0 commit comments

Comments
 (0)