change support button to settings button

and add new empty settings drawer
This commit is contained in:
David Lechner
2021-01-11 23:36:48 -06:00
parent fedef66931
commit 41a1cee092
16 changed files with 302 additions and 34 deletions
+26 -2
View File
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2020 The Pybricks Authors
// Copyright (c) 2020-2021 The Pybricks Authors
// File: actions/app.ts
// Actions for the app in general.
@@ -9,6 +9,10 @@ import { Action } from 'redux';
export enum AppActionType {
/** The app has just ben started. */
Startup = 'app.action.startup',
/** Open settings dialog. */
OpenSettings = 'app.action.openSettings',
/** Close settings dialog. */
CloseSettings = 'app.action.closeSettings',
/** Toggle documentation visibility. */
ToggleDocs = 'app.action.toggleDocs',
}
@@ -21,6 +25,22 @@ export function startup(): AppStartupAction {
return { type: AppActionType.Startup };
}
/** Action to open the settings dialog. */
export type AppOpenSettingsAction = Action<AppActionType.OpenSettings>;
/** Creates an action to open the settings dialog. */
export function openSettings(): AppOpenSettingsAction {
return { type: AppActionType.OpenSettings };
}
/** Action to close the settings dialog. */
export type AppCloseSettingsAction = Action<AppActionType.CloseSettings>;
/** Creates an action to close the settings dialog. */
export function closeSettings(): AppCloseSettingsAction {
return { type: AppActionType.CloseSettings };
}
/** Action to toggle documentation visibility. */
export type AppToggleDocsAction = Action<AppActionType.ToggleDocs>;
@@ -30,4 +50,8 @@ export function toggleDocs(): AppToggleDocsAction {
}
/** common type for all app actions. */
export type AppAction = AppStartupAction | AppToggleDocsAction;
export type AppAction =
| AppStartupAction
| AppOpenSettingsAction
| AppCloseSettingsAction
| AppToggleDocsAction;