mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-15 02:54:07 +00:00
change support button to settings button
and add new empty settings drawer
This commit is contained in:
+26
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user