+
+
+
+ {placeholder && (
+
+ {placeholder}
+
+ )}
{options.map((item) => {
return (
-
+
);
};
diff --git a/src/components/fields/__snapshots__/RadioGroup.test.tsx.snap b/src/components/fields/__snapshots__/RadioGroup.test.tsx.snap
index 370259142..70e146f0e 100644
--- a/src/components/fields/__snapshots__/RadioGroup.test.tsx.snap
+++ b/src/components/fields/__snapshots__/RadioGroup.test.tsx.snap
@@ -1,29 +1,31 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`components/fields/radiogroup.tsx should render 1`] = `
-
+
`;
diff --git a/src/context/App.test.tsx b/src/context/App.test.tsx
index 63d0e8bfa..d31f24631 100644
--- a/src/context/App.test.tsx
+++ b/src/context/App.test.tsx
@@ -285,7 +285,7 @@ describe('context/App.tsx', () => {
expect(saveStateMock).toHaveBeenCalledWith(
{ enterpriseAccounts: [], token: null, user: null },
{
- appearance: 'SYSTEM',
+ theme: 'SYSTEM',
openAtStartup: false,
participating: true,
playSound: true,
@@ -324,7 +324,7 @@ describe('context/App.tsx', () => {
expect(saveStateMock).toHaveBeenCalledWith(
{ enterpriseAccounts: [], token: null, user: null },
{
- appearance: 'SYSTEM',
+ theme: 'SYSTEM',
openAtStartup: true,
participating: false,
playSound: true,
diff --git a/src/context/App.tsx b/src/context/App.tsx
index 3da7ba375..6fe2e7587 100644
--- a/src/context/App.tsx
+++ b/src/context/App.tsx
@@ -10,14 +10,14 @@ import { useInterval } from '../hooks/useInterval';
import { useNotifications } from '../hooks/useNotifications';
import {
AccountNotifications,
- Appearance,
+ Theme,
AuthOptions,
AuthState,
AuthTokenOptions,
SettingsState,
} from '../types';
import { apiRequestAuth } from '../utils/api-requests';
-import { setAppearance } from '../utils/appearance';
+import { setTheme } from '../utils/theme';
import { addAccount, authGitHub, getToken, getUserData } from '../utils/auth';
import { setAutoLaunch } from '../utils/comms';
import Constants from '../utils/constants';
@@ -36,7 +36,7 @@ export const defaultSettings: SettingsState = {
showNotifications: true,
showBots: true,
openAtStartup: false,
- appearance: Appearance.SYSTEM,
+ theme: Theme.SYSTEM,
colors: null,
markAsDoneOnOpen: false,
};
@@ -87,8 +87,8 @@ export const AppProvider = ({ children }: { children: React.ReactNode }) => {
}, []);
useEffect(() => {
- setAppearance(settings.appearance as Appearance);
- }, [settings.appearance]);
+ setTheme(settings.theme as Theme);
+ }, [settings.theme]);
useEffect(() => {
fetchNotifications(accounts, settings);
@@ -103,7 +103,7 @@ export const AppProvider = ({ children }: { children: React.ReactNode }) => {
}, 60000);
const updateSetting = useCallback(
- (name: keyof SettingsState, value: boolean | Appearance) => {
+ (name: keyof SettingsState, value: boolean | Theme) => {
if (name === 'openAtStartup') {
setAutoLaunch(value as boolean);
}
diff --git a/src/routes/Settings.test.tsx b/src/routes/Settings.test.tsx
index 3e36c9da1..6394ec305 100644
--- a/src/routes/Settings.test.tsx
+++ b/src/routes/Settings.test.tsx
@@ -267,7 +267,7 @@ describe('routes/Settings.tsx', () => {
expect(updateSetting).toHaveBeenCalledWith('openAtStartup', false);
});
- it('should change the appearance radio group', async () => {
+ it('should change the theme radio group', async () => {
let getByLabelText;
await act(async () => {
@@ -290,7 +290,7 @@ describe('routes/Settings.tsx', () => {
fireEvent.click(getByLabelText('Light'));
expect(updateSetting).toHaveBeenCalledTimes(1);
- expect(updateSetting).toHaveBeenCalledWith('appearance', 'LIGHT');
+ expect(updateSetting).toHaveBeenCalledWith('theme', 'LIGHT');
});
it('should go to the enterprise login route', async () => {
diff --git a/src/routes/Settings.tsx b/src/routes/Settings.tsx
index 1c218bacf..0fa76eb94 100644
--- a/src/routes/Settings.tsx
+++ b/src/routes/Settings.tsx
@@ -17,9 +17,9 @@ import { useNavigate } from 'react-router-dom';
import { FieldCheckbox } from '../components/fields/Checkbox';
import { FieldRadioGroup } from '../components/fields/RadioGroup';
import { AppContext } from '../context/App';
-import { Appearance } from '../types';
+import { Theme } from '../types';
import { apiRequestAuth } from '../utils/api-requests';
-import { setAppearance } from '../utils/appearance';
+import { setTheme } from '../utils/theme';
import { openExternalLink, updateTrayIcon } from '../utils/comms';
import Constants from '../utils/constants';
import { generateGitHubAPIUrl } from '../utils/helpers';
@@ -61,9 +61,9 @@ export const SettingsRoute: React.FC = () => {
})();
}, [accounts.token]);
- ipcRenderer.on('update-native-theme', (_, updatedAppearance: Appearance) => {
- if (settings.appearance === Appearance.SYSTEM) {
- setAppearance(updatedAppearance);
+ ipcRenderer.on('update-native-theme', (_, updatedTheme: Theme) => {
+ if (settings.theme === Theme.SYSTEM) {
+ setTheme(updatedTheme);
}
});
@@ -86,7 +86,7 @@ export const SettingsRoute: React.FC = () => {
return (
@@ -105,77 +105,95 @@ export const SettingsRoute: React.FC = () => {
Settings
-
-
{
- updateSetting('appearance', evt.target.value);
- }}
- />
-
-
- colorScope && updateSetting('colors', evt.target.checked)
- }
- disabled={!colorScope}
- />
- updateSetting('participating', evt.target.checked)}
- />
-
-
- updateSetting('showNotifications', evt.target.checked)
- }
- />
- updateSetting('showBots', evt.target.checked)}
- />
-
- updateSetting('markAsDoneOnOpen', evt.target.checked)
- }
- />
- updateSetting('playSound', evt.target.checked)}
- />
- {!isLinux && (
+
+
+
+
+
+
diff --git a/src/routes/__snapshots__/Settings.test.tsx.snap b/src/routes/__snapshots__/Settings.test.tsx.snap
index 2fa0d6d38..73583eb5e 100644
--- a/src/routes/__snapshots__/Settings.test.tsx.snap
+++ b/src/routes/__snapshots__/Settings.test.tsx.snap
@@ -30,7 +30,7 @@ exports[`routes/Settings.tsx should not be able to enable colors due to missing
exports[`routes/Settings.tsx should render itself & its children 1`] = `
+
+
+
-
-
-
-
+ Notifications
+
-
-
-
-
-
-
-
-
-
+
+
- Show only participating
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
- Show notifications from Bot accounts
-
+
+
-
-
-
+
- Mark as done on open
-
+
+
-
-
+
-
-
+
+
+
+
+
-
+