Skip to content

Commit

Permalink
Run VSCode's "organize inputs" refactor against our import lists
Browse files Browse the repository at this point in the history
  • Loading branch information
obra committed Feb 29, 2024
1 parent e43a206 commit eacec43
Show file tree
Hide file tree
Showing 51 changed files with 116 additions and 146 deletions.
4 changes: 2 additions & 2 deletions src/api/focus.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import logger from "@renderer/utils/Logger";
import Colormap from "./focus/colormap";
import Macros from "./focus/macros";
import Keymap, { OnlyCustom } from "./focus/keymap";
import LayerNames from "./focus/layernames";
import logger from "@renderer/utils/Logger";
import Macros from "./focus/macros";

global.chrysalis_focus_instance = null;

Expand Down
2 changes: 1 addition & 1 deletion src/api/focus/keymap.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,4 @@ class OnlyCustom {
}
}

export { Keymap as default, OnlyCustom };
export { OnlyCustom, Keymap as default };
5 changes: 2 additions & 3 deletions src/api/focus/keymap/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@
* this program. If not, see <http://www.gnu.org/licenses/>.
*/

import logger from "@renderer/utils/Logger";
import i18n from "i18next";
import cldr_data from "./cldr_data";
import { Base } from "./db/base";
import { USQwerty } from "./db/base";
import { Base, USQwerty } from "./db/base";
import { constants } from "./db/constants";
import { withModifiers } from "./db/modifiers";
import logger from "@renderer/utils/Logger";

import enLangMap from "./cldr_languages/en";
import nlLangMap from "./cldr_languages/nl";
Expand Down
6 changes: 3 additions & 3 deletions src/api/focus/keymap/db/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* this program. If not, see <http://www.gnu.org/licenses/>.
*/

import { withModifiers } from "./modifiers";
import { GuiLabel } from "./gui";
import { constants } from "./constants";
import { GuiLabel } from "./gui";
import { withModifiers } from "./modifiers";

const assignKeysToCategory = (categories, keys) => {
const newKeys = [];
Expand Down Expand Up @@ -617,4 +617,4 @@ const Base = {
layout: key_layout_104key,
};

export { Base, USQwerty, addDualUseModifier, addDualUseLayer };
export { Base, USQwerty, addDualUseLayer, addDualUseModifier };
2 changes: 1 addition & 1 deletion src/api/focus/macros.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,4 +399,4 @@ const Macros = function () {
return this;
};

export { Macros as default, Step };
export { Step, Macros as default };
1 change: 1 addition & 0 deletions src/api/hardware-keyboardio-model01/components/Keymap.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import React from "react";
import Key from "./keymap/Key";

const Keymap = (props) => {
const keyProps = {
layerNames: props.LayerNames,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
*/

import KeymapDB from "@api/focus/keymap/db";
import React from "react";
import useTheme from "@mui/material/styles/useTheme";
import React from "react";

const db = new KeymapDB();

Expand Down
1 change: 0 additions & 1 deletion src/renderer/ActiveDevice.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { v4 as uuidv4 } from "uuid";

import { AVR109Flasher } from "@api/flash/AVR109Flasher";
import { WebDFUFlasher } from "@api/flash/WebDFUFlasher";
import { t } from "i18next";
import logger from "@renderer/utils/Logger";

export function ActiveDevice() {
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import KeymapDB from "@api/focus/keymap/db";
import { LocationProvider, Router } from "@gatsbyjs/reach-router";
import Box from "@mui/material/Box";
import CssBaseline from "@mui/material/CssBaseline";
import { createTheme, StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
import { StyledEngineProvider, ThemeProvider, createTheme } from "@mui/material/styles";
import React, { Suspense, useContext, useEffect, useState } from "react";
import { DndProvider } from "react-dnd";
import { HTML5Backend } from "react-dnd-html5-backend";
Expand All @@ -38,14 +38,14 @@ import ChangeLog from "./screens/ChangeLog";
import Editor from "./screens/Editor";
import FirmwareUpdate from "./screens/FirmwareUpdate";
import FocusNotDetected from "./screens/FocusNotDetected";
import ImportExport from "./screens/ImportExport";
import KeyboardSelect from "./screens/KeyboardSelect";
import LayoutCard from "./screens/LayoutCard";
import Preferences from "./screens/Preferences";
import SystemInfo from "./screens/SystemInfo";
import ImportExport from "./screens/ImportExport";

import logger from "@renderer/utils/Logger";
import { Store } from "@renderer/localStore";
import logger from "@renderer/utils/Logger";
const settings = new Store();

const App = (props) => {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/breaking-news/firmware-0.90.1.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
import AlertTitle from "@mui/material/AlertTitle";
import Button from "@mui/material/Button";
import Typography from "@mui/material/Typography";
import { GlobalContext } from "@renderer/components/GlobalContext";
import openURL from "@renderer/utils/openURL";
import React from "react";
import { useTranslation } from "react-i18next";
import { GlobalContext } from "@renderer/components/GlobalContext";

import { BreakingNews } from "@renderer/components/BreakingNews";
import logger from "@renderer/utils/Logger";
Expand Down
1 change: 0 additions & 1 deletion src/renderer/components/GlobalContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/

import React, { createContext, useState, useEffect } from "react";
import { Logger } from "@renderer/utils/Logger"; // Assuming Logger class is exported from Logger.js

export const GlobalContext = createContext();

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import Typography from "@mui/material/Typography";
import useMediaQuery from "@mui/material/useMediaQuery";
import ConfirmationDialog from "@renderer/components/ConfirmationDialog";
import { GlobalContext } from "@renderer/components/GlobalContext";
import React, { useEffect, useState, useContext } from "react";
import React, { useContext, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import "typeface-roboto/index.css";
import "typeface-source-code-pro/index.css";
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/components/LoadingScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
import { keyframes } from "@mui/system";
import logo from "images/logo.png";
import React from "react";
import { useTranslation } from "react-i18next";
import logo from "images/logo.png";

function LoadingScreen(props) {
const spin = keyframes`
from {
Expand Down
1 change: 0 additions & 1 deletion src/renderer/components/MainMenu/MainMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import ChatIcon from "@mui/icons-material/Chat";
import CloudUploadIcon from "@mui/icons-material/CloudUpload";
import ExitToAppIcon from "@mui/icons-material/ExitToApp";
import InfoIcon from "@mui/icons-material/Info";
import KeyboardIcon from "@mui/icons-material/Keyboard";
import ListIcon from "@mui/icons-material/List";
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/SaveChangesButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import SaveAltIcon from "@mui/icons-material/SaveAlt";
import Box from "@mui/material/Box";
import CircularProgress from "@mui/material/CircularProgress";
import Fab from "@mui/material/Fab";
import Tooltip from "@mui/material/Tooltip";
import Typography from "@mui/material/Typography";
import i18n from "@renderer/i18n";
import React from "react";
import Typography from "@mui/material/Typography";

const SaveChangesButton = (props) => {
const [inProgress, setInProgress] = React.useState(false);
const [success, setSuccess] = React.useState(false);
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/Toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React, { useState, useEffect } from "react";
import React, { useEffect, useState } from "react";

import Alert from "@mui/material/Alert";
import LinearProgress from "@mui/material/LinearProgress";
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/WebSerialCheck.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from "react";
import Modal from "@mui/material/Modal";
import Alert from "@mui/material/Alert";
import Modal from "@mui/material/Modal";
import React, { useState } from "react";
const webSerialSupported = !!navigator.serial;

export const WebSerialCheck = () => {
Expand Down
3 changes: 1 addition & 2 deletions src/renderer/hooks/useCheckDeviceSupportsPlugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
*/

import { GlobalContext } from "@renderer/components/GlobalContext";

import { useEffect, useState, useContext } from "react";
import { useContext, useEffect, useState } from "react";

const useCheckDeviceSupportsPlugins = (desiredPlugins) => {
const globalContext = useContext(GlobalContext);
Expand Down
3 changes: 1 addition & 2 deletions src/renderer/hooks/usePluginEffect.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
*/

import { GlobalContext } from "@renderer/components/GlobalContext";

import { useEffect, useState, useContext } from "react";
import { useContext, useEffect, useState } from "react";

const usePluginEffect = (initialize) => {
const globalContext = useContext(GlobalContext);
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/hooks/usePluginVisibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import { useEffect, useContext, useState } from "react";
import { GlobalContext } from "@renderer/components/GlobalContext";

import { Store } from "@renderer/localStore";
import { useContext, useEffect, useState } from "react";

const settings = new Store();

export default function usePluginVisibility(plugin) {
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import English from "@renderer/i18n/en";
import Dutch from "@renderer/i18n/nl";
import i18n from "i18next";
import { initReactI18next } from "react-i18next";

const resources = {
en: {
Expand Down
18 changes: 9 additions & 9 deletions src/renderer/screens/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,32 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import logger from "@renderer/utils/Logger";

import Keymap from "@api/focus/keymap";
import KeymapDB from "@api/focus/keymap/db";
import Macros, { Step as MacroStep } from "@api/focus/macros";
import LayerNames from "@api/focus/layernames";
import Button from "@mui/material/Button";
import Macros, { Step as MacroStep } from "@api/focus/macros";
import Box from "@mui/material/Box";
import Button from "@mui/material/Button";
import Drawer from "@mui/material/Drawer";
import useTheme from "@mui/material/styles/useTheme";
import { hideContextBar, showContextBar } from "@renderer/components/ContextBar";
import { GlobalContext } from "@renderer/components/GlobalContext";
import LoadingScreen from "@renderer/components/LoadingScreen";
import { PageTitle } from "@renderer/components/PageTitle";
import SaveChangesButton from "@renderer/components/SaveChangesButton";
import { toast } from "@renderer/components/Toast";
import useEffectOnce from "@renderer/hooks/useEffectOnce";
import logger from "@renderer/utils/Logger";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import MacroEditor from "./Editor/Macros/MacroEditor";
import LayoutSharing from "./Editor/Sidebar/LayoutSharing";
import Overview from "./Editor/Sidebar/Overview";
import { KeyPicker } from "./Editor/components/KeyPicker";
import { MacroStorageAlert } from "./Editor/components/MacroStorageAlert";
import { LayerNamesStorageAlert } from "./Editor/components/LayerNamesStorageAlert";
import { MacroStorageAlert } from "./Editor/components/MacroStorageAlert";
import OnlyCustomScreen from "./Editor/components/OnlyCustomScreen";
import MacroEditor from "./Editor/Macros/MacroEditor";
import Overview from "./Editor/Sidebar/Overview";
import Drawer from "@mui/material/Drawer";
import LayoutSharing from "./Editor/Sidebar/LayoutSharing";
import useTheme from "@mui/material/styles/useTheme";

const db = new KeymapDB();

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/screens/Editor/Macros/MacroEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

import CloseIcon from "@mui/icons-material/Close";
import { Divider } from "@mui/material";
import Card from "@mui/material/Card";
import CardContent from "@mui/material/CardContent";
import CardHeader from "@mui/material/CardHeader";
Expand All @@ -27,7 +28,6 @@ import { useTranslation } from "react-i18next";
import MacroStep from "./MacroStep";
import MacroStepAdd from "./MacroStepAdd";
import MacroStepEditor from "./MacroStepEditor";
import { Divider } from "@mui/material";

const MacroEditor = (props) => {
const { macroId, macro, onMacroChange, macroStep, setMacroStep } = props;
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/screens/Editor/Macros/MacroStepAdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React, { useState } from "react";
import React from "react";
import { useTranslation } from "react-i18next";

import KeymapDB from "@api/focus/keymap/db";
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/screens/Editor/Sidebar/Colormap.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import Stack from "@mui/material/Stack";
import React from "react";
import { ChromePicker } from "react-color";
import { useTranslation } from "react-i18next";
import PalettePicker from "./Colormap/PalettePicker";
import FKPCategorySelector from "../components/FKPCategorySelector";
import Stack from "@mui/material/Stack";
import PalettePicker from "./Colormap/PalettePicker";

const Colormap = (props) => {
const { t } = useTranslation();
Expand Down
12 changes: 6 additions & 6 deletions src/renderer/screens/Editor/Sidebar/DynamicMacroKeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from "react";
import { useTranslation } from "react-i18next";
import KeymapDB from "@api/focus/keymap/db";
import Macros from "@api/focus/macros";
import Button from "@mui/material/Button";
import Paper from "@mui/material/Paper";
import Divider from "@mui/material/Divider";
import Grid from "@mui/material/Grid";
import Paper from "@mui/material/Paper";
import Typography from "@mui/material/Typography";
import React from "react";
import { useTranslation } from "react-i18next";
import FKPCategorySelector from "../components/FKPCategorySelector";
import Divider from "@mui/material/Divider";
import Macros from "@api/focus/macros";
import KeymapDB from "@api/focus/keymap/db";

const DynamicMacroKeys = (props) => {
const { currentKey } = props;
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/screens/Editor/Sidebar/LayerNameInput.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import InputBase from "@mui/material/InputBase";
import React from "react";
import useCheckDeviceSupportsPlugins from "@renderer/hooks/useCheckDeviceSupportsPlugins";
import React from "react";

export const LayerNameInput = (props) => {
const [loaded, plugins] = useCheckDeviceSupportsPlugins(["LayerNames"]);
Expand Down
11 changes: 1 addition & 10 deletions src/renderer/screens/Editor/Sidebar/LayoutSharing.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import CloseIcon from "@mui/icons-material/Close";
import Box from "@mui/material/Box";
import Button from "@mui/material/Button";
import Dialog from "@mui/material/Dialog";
import DialogContent from "@mui/material/DialogContent";
import DialogTitle from "@mui/material/DialogTitle";
import Divider from "@mui/material/Divider";
import Drawer from "@mui/material/Drawer";
import IconButton from "@mui/material/IconButton";
import Typography from "@mui/material/Typography";
import ConfirmationDialog from "@renderer/components/ConfirmationDialog";
import { GlobalContext } from "@renderer/components/GlobalContext";

import { t } from "i18next";
import React, { useContext, useState, useEffect } from "react";

import React, { useContext, useEffect, useState } from "react";
import { ExportToFile } from "./LayoutSharing/ExportToFile";
import { FileImport } from "./LayoutSharing/FileImport";
import { LibraryImport } from "./LayoutSharing/LibraryImport";
Expand Down
Loading

0 comments on commit eacec43

Please sign in to comment.