mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-07-29 17:48:43 -04:00
refactor(gui): Reorganize imports
This commit is contained in:
parent
ef7c1abcaf
commit
956a26d181
22 changed files with 51 additions and 51 deletions
|
@ -1,12 +1,12 @@
|
||||||
import { Box, makeStyles, CssBaseline } from "@material-ui/core";
|
import { Box, CssBaseline, makeStyles } from "@material-ui/core";
|
||||||
import { createTheme, ThemeProvider } from "@material-ui/core/styles";
|
|
||||||
import { indigo } from "@material-ui/core/colors";
|
import { indigo } from "@material-ui/core/colors";
|
||||||
import { MemoryRouter as Router, Routes, Route } from "react-router-dom";
|
import { createTheme, ThemeProvider } from "@material-ui/core/styles";
|
||||||
|
import { Route, MemoryRouter as Router, Routes } from "react-router-dom";
|
||||||
import Navigation, { drawerWidth } from "./navigation/Navigation";
|
import Navigation, { drawerWidth } from "./navigation/Navigation";
|
||||||
|
import HelpPage from "./pages/help/HelpPage";
|
||||||
import HistoryPage from "./pages/history/HistoryPage";
|
import HistoryPage from "./pages/history/HistoryPage";
|
||||||
import SwapPage from "./pages/swap/SwapPage";
|
import SwapPage from "./pages/swap/SwapPage";
|
||||||
import WalletPage from "./pages/wallet/WalletPage";
|
import WalletPage from "./pages/wallet/WalletPage";
|
||||||
import HelpPage from "./pages/help/HelpPage";
|
|
||||||
import GlobalSnackbarProvider from "./snackbar/GlobalSnackbarProvider";
|
import GlobalSnackbarProvider from "./snackbar/GlobalSnackbarProvider";
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Drawer, makeStyles, Box } from "@material-ui/core";
|
import { Box, Drawer, makeStyles } from "@material-ui/core";
|
||||||
import NavigationHeader from "./NavigationHeader";
|
|
||||||
import NavigationFooter from "./NavigationFooter";
|
import NavigationFooter from "./NavigationFooter";
|
||||||
|
import NavigationHeader from "./NavigationHeader";
|
||||||
|
|
||||||
export const drawerWidth = 240;
|
export const drawerWidth = 240;
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
import RedditIcon from "@material-ui/icons/Reddit";
|
|
||||||
import GitHubIcon from "@material-ui/icons/GitHub";
|
|
||||||
import { Box, makeStyles } from "@material-ui/core";
|
import { Box, makeStyles } from "@material-ui/core";
|
||||||
import LinkIconButton from "../icons/LinkIconButton";
|
import GitHubIcon from "@material-ui/icons/GitHub";
|
||||||
import UnfinishedSwapsAlert from "../alert/UnfinishedSwapsAlert";
|
import RedditIcon from "@material-ui/icons/Reddit";
|
||||||
import FundsLeftInWalletAlert from "../alert/FundsLeftInWalletAlert";
|
import FundsLeftInWalletAlert from "../alert/FundsLeftInWalletAlert";
|
||||||
import RpcStatusAlert from "../alert/RpcStatusAlert";
|
|
||||||
import DiscordIcon from "../icons/DiscordIcon";
|
|
||||||
import { DISCORD_URL } from "../pages/help/ContactInfoBox";
|
|
||||||
import MoneroWalletRpcUpdatingAlert from "../alert/MoneroWalletRpcUpdatingAlert";
|
import MoneroWalletRpcUpdatingAlert from "../alert/MoneroWalletRpcUpdatingAlert";
|
||||||
|
import RpcStatusAlert from "../alert/RpcStatusAlert";
|
||||||
|
import UnfinishedSwapsAlert from "../alert/UnfinishedSwapsAlert";
|
||||||
|
import DiscordIcon from "../icons/DiscordIcon";
|
||||||
|
import LinkIconButton from "../icons/LinkIconButton";
|
||||||
|
import { DISCORD_URL } from "../pages/help/ContactInfoBox";
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
outer: {
|
outer: {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { Box, List } from "@material-ui/core";
|
import { Box, List } from "@material-ui/core";
|
||||||
import SwapHorizOutlinedIcon from "@material-ui/icons/SwapHorizOutlined";
|
|
||||||
import HistoryOutlinedIcon from "@material-ui/icons/HistoryOutlined";
|
|
||||||
import AccountBalanceWalletIcon from "@material-ui/icons/AccountBalanceWallet";
|
import AccountBalanceWalletIcon from "@material-ui/icons/AccountBalanceWallet";
|
||||||
import HelpOutlineIcon from "@material-ui/icons/HelpOutline";
|
import HelpOutlineIcon from "@material-ui/icons/HelpOutline";
|
||||||
|
import HistoryOutlinedIcon from "@material-ui/icons/HistoryOutlined";
|
||||||
|
import SwapHorizOutlinedIcon from "@material-ui/icons/SwapHorizOutlined";
|
||||||
import RouteListItemIconButton from "./RouteListItemIconButton";
|
import RouteListItemIconButton from "./RouteListItemIconButton";
|
||||||
import UnfinishedSwapsBadge from "./UnfinishedSwapsCountBadge";
|
import UnfinishedSwapsBadge from "./UnfinishedSwapsCountBadge";
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
import { ListItem, ListItemIcon, ListItemText } from "@material-ui/core";
|
||||||
import { ReactNode } from "react";
|
import { ReactNode } from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { ListItem, ListItemIcon, ListItemText } from "@material-ui/core";
|
|
||||||
|
|
||||||
export default function RouteListItemIconButton({
|
export default function RouteListItemIconButton({
|
||||||
name,
|
name,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { useState } from "react";
|
|
||||||
import { Box, IconButton, TextField } from "@material-ui/core";
|
import { Box, IconButton, TextField } from "@material-ui/core";
|
||||||
import SearchIcon from "@material-ui/icons/Search";
|
|
||||||
import CloseIcon from "@material-ui/icons/Close";
|
import CloseIcon from "@material-ui/icons/Close";
|
||||||
|
import SearchIcon from "@material-ui/icons/Search";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
export function ExpandableSearchBox({
|
export function ExpandableSearchBox({
|
||||||
query,
|
query,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import TreeView from "@material-ui/lab/TreeView";
|
|
||||||
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
|
||||||
import ChevronRightIcon from "@material-ui/icons/ChevronRight";
|
import ChevronRightIcon from "@material-ui/icons/ChevronRight";
|
||||||
|
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
||||||
import TreeItem from "@material-ui/lab/TreeItem";
|
import TreeItem from "@material-ui/lab/TreeItem";
|
||||||
|
import TreeView from "@material-ui/lab/TreeView";
|
||||||
import ScrollablePaperTextBox from "./ScrollablePaperTextBox";
|
import ScrollablePaperTextBox from "./ScrollablePaperTextBox";
|
||||||
|
|
||||||
interface JsonTreeViewProps {
|
interface JsonTreeViewProps {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from "react";
|
|
||||||
import Button, { ButtonProps } from "@material-ui/core/Button";
|
import Button, { ButtonProps } from "@material-ui/core/Button";
|
||||||
import CircularProgress from "@material-ui/core/CircularProgress";
|
import CircularProgress from "@material-ui/core/CircularProgress";
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
interface LoadingButtonProps extends ButtonProps {
|
interface LoadingButtonProps extends ButtonProps {
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Box, Chip, Typography } from "@material-ui/core";
|
import { Box, Chip, Typography } from "@material-ui/core";
|
||||||
import { useMemo, useState } from "react";
|
|
||||||
import { CliLog } from "models/cliModel";
|
import { CliLog } from "models/cliModel";
|
||||||
|
import { useMemo, useState } from "react";
|
||||||
import { logsToRawString } from "utils/parseUtils";
|
import { logsToRawString } from "utils/parseUtils";
|
||||||
import ScrollablePaperTextBox from "./ScrollablePaperTextBox";
|
import ScrollablePaperTextBox from "./ScrollablePaperTextBox";
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Typography } from "@material-ui/core";
|
import { Typography } from "@material-ui/core";
|
||||||
import DepositAddressInfoBox from "../../modal/swap/DepositAddressInfoBox";
|
|
||||||
import MoneroIcon from "../../icons/MoneroIcon";
|
import MoneroIcon from "../../icons/MoneroIcon";
|
||||||
|
import DepositAddressInfoBox from "../../modal/swap/DepositAddressInfoBox";
|
||||||
|
|
||||||
const XMR_DONATE_ADDRESS =
|
const XMR_DONATE_ADDRESS =
|
||||||
"87jS4C7ngk9EHdqFFuxGFgg8AyH63dRUoULshWDybFJaP75UA89qsutG5B1L1QTc4w228nsqsv8EjhL7bz8fB3611Mh98mg";
|
"87jS4C7ngk9EHdqFFuxGFgg8AyH63dRUoULshWDybFJaP75UA89qsutG5B1L1QTc4w228nsqsv8EjhL7bz8fB3611Mh98mg";
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Button, Typography } from "@material-ui/core";
|
import { Button, Typography } from "@material-ui/core";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import InfoBox from "../../modal/swap/InfoBox";
|
|
||||||
import FeedbackDialog from "../../modal/feedback/FeedbackDialog";
|
import FeedbackDialog from "../../modal/feedback/FeedbackDialog";
|
||||||
|
import InfoBox from "../../modal/swap/InfoBox";
|
||||||
|
|
||||||
export default function FeedbackInfoBox() {
|
export default function FeedbackInfoBox() {
|
||||||
const [showDialog, setShowDialog] = useState(false);
|
const [showDialog, setShowDialog] = useState(false);
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { Box, makeStyles } from "@material-ui/core";
|
import { Box, makeStyles } from "@material-ui/core";
|
||||||
import ContactInfoBox from "./ContactInfoBox";
|
import ContactInfoBox from "./ContactInfoBox";
|
||||||
import FeedbackInfoBox from "./FeedbackInfoBox";
|
|
||||||
import DonateInfoBox from "./DonateInfoBox";
|
import DonateInfoBox from "./DonateInfoBox";
|
||||||
import TorInfoBox from "./TorInfoBox";
|
import FeedbackInfoBox from "./FeedbackInfoBox";
|
||||||
import RpcControlBox from "./RpcControlBox";
|
import RpcControlBox from "./RpcControlBox";
|
||||||
|
import TorInfoBox from "./TorInfoBox";
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
outer: {
|
outer: {
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import { Box, makeStyles } from "@material-ui/core";
|
import { Box, makeStyles } from "@material-ui/core";
|
||||||
|
import FolderOpenIcon from "@material-ui/icons/FolderOpen";
|
||||||
|
import PlayArrowIcon from "@material-ui/icons/PlayArrow";
|
||||||
|
import StopIcon from "@material-ui/icons/Stop";
|
||||||
|
import { RpcProcessStateType } from "models/rpcModel";
|
||||||
import IpcInvokeButton from "renderer/components/IpcInvokeButton";
|
import IpcInvokeButton from "renderer/components/IpcInvokeButton";
|
||||||
import { useAppSelector } from "store/hooks";
|
import { useAppSelector } from "store/hooks";
|
||||||
import StopIcon from "@material-ui/icons/Stop";
|
|
||||||
import PlayArrowIcon from "@material-ui/icons/PlayArrow";
|
|
||||||
import { RpcProcessStateType } from "models/rpcModel";
|
|
||||||
import InfoBox from "../../modal/swap/InfoBox";
|
import InfoBox from "../../modal/swap/InfoBox";
|
||||||
import CliLogsBox from "../../other/RenderedCliLog";
|
import CliLogsBox from "../../other/RenderedCliLog";
|
||||||
import FolderOpenIcon from "@material-ui/icons/FolderOpen";
|
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
actionsOuter: {
|
actionsOuter: {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { Box, makeStyles, Typography } from "@material-ui/core";
|
import { Box, makeStyles, Typography } from "@material-ui/core";
|
||||||
|
import PlayArrowIcon from "@material-ui/icons/PlayArrow";
|
||||||
|
import StopIcon from "@material-ui/icons/Stop";
|
||||||
import IpcInvokeButton from "renderer/components/IpcInvokeButton";
|
import IpcInvokeButton from "renderer/components/IpcInvokeButton";
|
||||||
import { useAppSelector } from "store/hooks";
|
import { useAppSelector } from "store/hooks";
|
||||||
import StopIcon from "@material-ui/icons/Stop";
|
|
||||||
import PlayArrowIcon from "@material-ui/icons/PlayArrow";
|
|
||||||
import InfoBox from "../../modal/swap/InfoBox";
|
import InfoBox from "../../modal/swap/InfoBox";
|
||||||
import CliLogsBox from "../../other/RenderedCliLog";
|
import CliLogsBox from "../../other/RenderedCliLog";
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { Typography } from "@material-ui/core";
|
import { Typography } from "@material-ui/core";
|
||||||
import { useIsSwapRunning } from "store/hooks";
|
import { useIsSwapRunning } from "store/hooks";
|
||||||
import HistoryTable from "./table/HistoryTable";
|
|
||||||
import SwapDialog from "../../modal/swap/SwapDialog";
|
|
||||||
import SwapTxLockAlertsBox from "../../alert/SwapTxLockAlertsBox";
|
import SwapTxLockAlertsBox from "../../alert/SwapTxLockAlertsBox";
|
||||||
|
import SwapDialog from "../../modal/swap/SwapDialog";
|
||||||
|
import HistoryTable from "./table/HistoryTable";
|
||||||
|
|
||||||
export default function HistoryPage() {
|
export default function HistoryPage() {
|
||||||
const showDialog = useIsSwapRunning();
|
const showDialog = useIsSwapRunning();
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Box, makeStyles } from "@material-ui/core";
|
import { Box, makeStyles } from "@material-ui/core";
|
||||||
import SwapWidget from "./SwapWidget";
|
|
||||||
import ApiAlertsBox from "./ApiAlertsBox";
|
import ApiAlertsBox from "./ApiAlertsBox";
|
||||||
|
import SwapWidget from "./SwapWidget";
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
outer: {
|
outer: {
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
import { Box, Button, makeStyles, Typography } from "@material-ui/core";
|
import { Box, Button, makeStyles, Typography } from "@material-ui/core";
|
||||||
import { useState } from "react";
|
|
||||||
import SendIcon from "@material-ui/icons/Send";
|
import SendIcon from "@material-ui/icons/Send";
|
||||||
import { useAppSelector, useIsRpcEndpointBusy } from "store/hooks";
|
|
||||||
import { RpcMethod } from "models/rpcModel";
|
import { RpcMethod } from "models/rpcModel";
|
||||||
|
import { useState } from "react";
|
||||||
|
import { SatsAmount } from "renderer/components/other/Units";
|
||||||
|
import { useAppSelector, useIsRpcEndpointBusy } from "store/hooks";
|
||||||
import BitcoinIcon from "../../icons/BitcoinIcon";
|
import BitcoinIcon from "../../icons/BitcoinIcon";
|
||||||
|
import InfoBox from "../../modal/swap/InfoBox";
|
||||||
import WithdrawDialog from "../../modal/wallet/WithdrawDialog";
|
import WithdrawDialog from "../../modal/wallet/WithdrawDialog";
|
||||||
import WalletRefreshButton from "./WalletRefreshButton";
|
import WalletRefreshButton from "./WalletRefreshButton";
|
||||||
import InfoBox from "../../modal/swap/InfoBox";
|
|
||||||
import { SatsAmount } from "renderer/components/other/Units";
|
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
title: {
|
title: {
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
|
import { IconButton, styled } from "@material-ui/core";
|
||||||
|
import { Close } from "@material-ui/icons";
|
||||||
import {
|
import {
|
||||||
MaterialDesignContent,
|
MaterialDesignContent,
|
||||||
SnackbarKey,
|
SnackbarKey,
|
||||||
SnackbarProvider,
|
SnackbarProvider,
|
||||||
useSnackbar,
|
useSnackbar,
|
||||||
} from "notistack";
|
} from "notistack";
|
||||||
import { IconButton, styled } from "@material-ui/core";
|
|
||||||
import { Close } from "@material-ui/icons";
|
|
||||||
import { ReactNode } from "react";
|
import { ReactNode } from "react";
|
||||||
|
|
||||||
const StyledMaterialDesignContent = styled(MaterialDesignContent)(() => ({
|
const StyledMaterialDesignContent = styled(MaterialDesignContent)(() => ({
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
import { render } from "react-dom";
|
import { render } from "react-dom";
|
||||||
import { Provider } from "react-redux";
|
import { Provider } from "react-redux";
|
||||||
import { store } from "./store/storeRenderer";
|
|
||||||
import { setRegistryProviders } from "store/features/providersSlice";
|
|
||||||
import { setAlerts } from "store/features/alertsSlice";
|
import { setAlerts } from "store/features/alertsSlice";
|
||||||
import { setXmrPrice, setBtcPrice } from "store/features/ratesSlice";
|
import { setRegistryProviders } from "store/features/providersSlice";
|
||||||
|
import { setBtcPrice, setXmrPrice } from "store/features/ratesSlice";
|
||||||
|
import logger from "../utils/logger";
|
||||||
import {
|
import {
|
||||||
fetchAlertsViaHttp,
|
fetchAlertsViaHttp,
|
||||||
fetchBtcPrice,
|
fetchBtcPrice,
|
||||||
fetchProvidersViaHttp,
|
fetchProvidersViaHttp,
|
||||||
fetchXmrPrice,
|
fetchXmrPrice,
|
||||||
} from "./api";
|
} from "./api";
|
||||||
import logger from "../utils/logger";
|
|
||||||
import App from "./components/App";
|
import App from "./components/App";
|
||||||
import { checkBitcoinBalance, getRawSwapInfos } from "./rpc";
|
import { checkBitcoinBalance, getRawSwapInfos } from "./rpc";
|
||||||
|
import { store } from "./store/storeRenderer";
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
checkBitcoinBalance();
|
checkBitcoinBalance();
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import swapReducer from "./features/swapSlice";
|
|
||||||
import providersSlice from "./features/providersSlice";
|
|
||||||
import torSlice from "./features/torSlice";
|
|
||||||
import rpcSlice from "./features/rpcSlice";
|
|
||||||
import alertsSlice from "./features/alertsSlice";
|
import alertsSlice from "./features/alertsSlice";
|
||||||
|
import providersSlice from "./features/providersSlice";
|
||||||
import ratesSlice from "./features/ratesSlice";
|
import ratesSlice from "./features/ratesSlice";
|
||||||
|
import rpcSlice from "./features/rpcSlice";
|
||||||
|
import swapReducer from "./features/swapSlice";
|
||||||
|
import torSlice from "./features/torSlice";
|
||||||
|
|
||||||
export const reducers = {
|
export const reducers = {
|
||||||
swap: swapReducer,
|
swap: swapReducer,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
import { sortBy } from "lodash";
|
||||||
import { TypedUseSelectorHook, useDispatch, useSelector } from "react-redux";
|
import { TypedUseSelectorHook, useDispatch, useSelector } from "react-redux";
|
||||||
import type { AppDispatch, RootState } from "renderer/store/storeRenderer";
|
import type { AppDispatch, RootState } from "renderer/store/storeRenderer";
|
||||||
import { sortBy } from "lodash";
|
|
||||||
import { parseDateString } from "utils/parseUtils";
|
import { parseDateString } from "utils/parseUtils";
|
||||||
|
|
||||||
// Use throughout your app instead of plain `useDispatch` and `useSelector`
|
// Use throughout your app instead of plain `useDispatch` and `useSelector`
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { defineConfig } from "vite";
|
|
||||||
import react from "@vitejs/plugin-react";
|
import react from "@vitejs/plugin-react";
|
||||||
import { internalIpV4 } from "internal-ip";
|
import { internalIpV4 } from "internal-ip";
|
||||||
|
import { defineConfig } from "vite";
|
||||||
import tsconfigPaths from "vite-tsconfig-paths";
|
import tsconfigPaths from "vite-tsconfig-paths";
|
||||||
|
|
||||||
// @ts-expect-error process is a nodejs global
|
// @ts-expect-error process is a nodejs global
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue