mirror of
https://github.com/haveno-dex/haveno-ui.git
synced 2025-09-09 07:21:33 -04:00
chore(dev): eslint import rules
--- Co-authored-by: @schowdhuri Reviewed-by: @schowdhuri
This commit is contained in:
parent
ec2193b460
commit
07a984bb52
129 changed files with 337 additions and 170 deletions
.eslintrc.jsonpackage.json
packages
main
preload
renderer
.eslintrc.json
src
components
atoms
AppProviders
Buttons
CircleIcon
ConnectionProgress
Currency
DetailItem
DetailItemCard
Header
Link
Modal
MoneroNodeListItem
PasswordInput
ProtectedRoute
Select
SyncStatus
Tabs
TextInput
Typography
molecules
AddressCard
NodeConnectSwitch
NodeConnectSwitch.stories.tsxNodeConnectSwitch.test.tsxNodeConnectSwitch.tsxNodeConnectSwitchMethod.tsx
PaymentMethodCard
AddPaymentMethodButton.tsxPaymentMethodCard.stories.tsxPaymentMethodCard.test.tsxPaymentMethodCard.tsx_constants.ts
SecondarySidebar
Table
WalletBalance
WalletTransactions
organisms
AccountSidebar
ChangePassword
MyWalletMoneroBalance
MyWalletPrimaryAddress
MyWalletReceive
MyWalletSendForm
MyWalletTransactions
SelectMoneroNode
SetPassword
Sidebar
WalletManagement
templates
constants
hooks/haveno
|
@ -8,19 +8,38 @@
|
||||||
"extends": [
|
"extends": [
|
||||||
"eslint:recommended",
|
"eslint:recommended",
|
||||||
"plugin:@typescript-eslint/recommended",
|
"plugin:@typescript-eslint/recommended",
|
||||||
"plugin:prettier/recommended"
|
"plugin:prettier/recommended",
|
||||||
|
"plugin:import/recommended",
|
||||||
|
"plugin:import/typescript"
|
||||||
],
|
],
|
||||||
"parser": "@typescript-eslint/parser",
|
"parser": "@typescript-eslint/parser",
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaVersion": 12,
|
"ecmaVersion": 12,
|
||||||
"sourceType": "module"
|
"sourceType": "module"
|
||||||
},
|
},
|
||||||
"plugins": ["@typescript-eslint"],
|
"plugins": ["@typescript-eslint", "import"],
|
||||||
"ignorePatterns": ["node_modules/**", "**/dist/**"],
|
"ignorePatterns": ["node_modules/**", "**/dist/**"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/no-unused-vars": "error",
|
"@typescript-eslint/no-unused-vars": "error",
|
||||||
"@typescript-eslint/no-var-requires": "off",
|
"@typescript-eslint/no-var-requires": "off",
|
||||||
"@typescript-eslint/consistent-type-imports": "error",
|
"@typescript-eslint/consistent-type-imports": "error",
|
||||||
"prettier/prettier": "error"
|
"@typescript-eslint/ban-ts-comment": "off",
|
||||||
|
"import/no-named-as-default": "off",
|
||||||
|
"prettier/prettier": "error",
|
||||||
|
"import/newline-after-import": ["error", { "count": 1 }],
|
||||||
|
"import/order": "error"
|
||||||
|
},
|
||||||
|
"settings": {
|
||||||
|
"import/resolver": {
|
||||||
|
"node": {
|
||||||
|
"extensions": [".js", ".jsx", ".ts", ".tsx"]
|
||||||
|
},
|
||||||
|
"typescript": {
|
||||||
|
"project": [
|
||||||
|
"packages/main/tsconfig.json",
|
||||||
|
"packages/preload/tsconfig.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,6 +70,8 @@
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.5.0",
|
||||||
"eslint-plugin-prettier": "^4.0.0",
|
"eslint-plugin-prettier": "^4.0.0",
|
||||||
"eslint-plugin-react": "^7.29.4",
|
"eslint-plugin-react": "^7.29.4",
|
||||||
|
"eslint-import-resolver-typescript": "^2.7.1",
|
||||||
|
"eslint-plugin-import": "^2.26.0",
|
||||||
"happy-dom": "2.41.0",
|
"happy-dom": "2.41.0",
|
||||||
"husky": "^7.0.4",
|
"husky": "^7.0.4",
|
||||||
"jsdom": "^19.0.0",
|
"jsdom": "^19.0.0",
|
||||||
|
|
|
@ -16,9 +16,9 @@
|
||||||
|
|
||||||
import { app } from "electron";
|
import { app } from "electron";
|
||||||
import "./security-restrictions";
|
import "./security-restrictions";
|
||||||
|
import { registerHavenoHandlers } from "./services/haveno";
|
||||||
import { restoreOrCreateWindow } from "@src/mainWindow";
|
import { restoreOrCreateWindow } from "@src/mainWindow";
|
||||||
import { registerStoreHandlers } from "@src/services/store";
|
import { registerStoreHandlers } from "@src/services/store";
|
||||||
import { registerHavenoHandlers } from "./services/haveno";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prevent multiple instances
|
* Prevent multiple instances
|
||||||
|
|
|
@ -14,9 +14,9 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import { BrowserWindow } from "electron";
|
|
||||||
import { join } from "path";
|
import { join } from "path";
|
||||||
import { URL } from "url";
|
import { URL } from "url";
|
||||||
|
import { BrowserWindow } from "electron";
|
||||||
|
|
||||||
async function createWindow() {
|
async function createWindow() {
|
||||||
const browserWindow = new BrowserWindow({
|
const browserWindow = new BrowserWindow({
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import { app, shell } from "electron";
|
|
||||||
import { URL } from "url";
|
import { URL } from "url";
|
||||||
|
import { app, shell } from "electron";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of origins that you allow open INSIDE the application and permissions for each of them.
|
* List of origins that you allow open INSIDE the application and permissions for each of them.
|
||||||
|
|
|
@ -16,11 +16,10 @@
|
||||||
|
|
||||||
import fsPromises from "fs/promises";
|
import fsPromises from "fs/promises";
|
||||||
import { ipcMain, dialog } from "electron";
|
import { ipcMain, dialog } from "electron";
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
||||||
// @ts-ignore
|
|
||||||
import QRCode from "qrcode/lib/server";
|
|
||||||
import type { DownloadBackupInput } from "@src/types";
|
|
||||||
import { IpcChannels } from "@src/types";
|
import { IpcChannels } from "@src/types";
|
||||||
|
import type { DownloadBackupInput } from "@src/types";
|
||||||
|
|
||||||
|
const { toFile } = require("qrcode/lib");
|
||||||
|
|
||||||
export function registerHavenoHandlers() {
|
export function registerHavenoHandlers() {
|
||||||
ipcMain.handle(
|
ipcMain.handle(
|
||||||
|
@ -76,7 +75,7 @@ export function registerHavenoHandlers() {
|
||||||
if (!file?.filePath) {
|
if (!file?.filePath) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QRCode.toFile(
|
toFile(
|
||||||
file.filePath,
|
file.filePath,
|
||||||
code,
|
code,
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,6 +16,13 @@
|
||||||
|
|
||||||
import { ipcMain, safeStorage } from "electron";
|
import { ipcMain, safeStorage } from "electron";
|
||||||
import Store from "electron-store";
|
import Store from "electron-store";
|
||||||
|
import { StorageKeys, IpcChannels, StoreSchema } from "@src/types";
|
||||||
|
import {
|
||||||
|
createAuthToken,
|
||||||
|
hashPassword,
|
||||||
|
verifyAuthAuthToken,
|
||||||
|
verifyPassword,
|
||||||
|
} from "@src/utils/password";
|
||||||
import type {
|
import type {
|
||||||
AccountInfoDto,
|
AccountInfoDto,
|
||||||
ChangePasswordInput,
|
ChangePasswordInput,
|
||||||
|
@ -23,14 +30,6 @@ import type {
|
||||||
IStoreSchema,
|
IStoreSchema,
|
||||||
SetPasswordInput,
|
SetPasswordInput,
|
||||||
} from "@src/types";
|
} from "@src/types";
|
||||||
import { StorageKeys } from "@src/types";
|
|
||||||
import { IpcChannels, StoreSchema } from "@src/types";
|
|
||||||
import {
|
|
||||||
createAuthToken,
|
|
||||||
hashPassword,
|
|
||||||
verifyAuthAuthToken,
|
|
||||||
verifyPassword,
|
|
||||||
} from "@src/utils/password";
|
|
||||||
|
|
||||||
const store = new Store<IStoreSchema>({ schema: StoreSchema });
|
const store = new Store<IStoreSchema>({ schema: StoreSchema });
|
||||||
|
|
||||||
|
|
|
@ -14,11 +14,10 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { MaybeMocked } from "vitest";
|
|
||||||
import { beforeEach, expect, test, vi } from "vitest";
|
import { beforeEach, expect, test, vi } from "vitest";
|
||||||
import { restoreOrCreateWindow } from "../src/mainWindow";
|
|
||||||
|
|
||||||
import { BrowserWindow } from "electron";
|
import { BrowserWindow } from "electron";
|
||||||
|
import type { MaybeMocked } from "vitest";
|
||||||
|
import { restoreOrCreateWindow } from "../src/mainWindow";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mock real electron BrowserWindow API
|
* Mock real electron BrowserWindow API
|
||||||
|
|
|
@ -14,9 +14,9 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import { node } from "../../.electron-vendors.cache.json";
|
|
||||||
import { join } from "path";
|
import { join } from "path";
|
||||||
import { builtinModules } from "module";
|
import { builtinModules } from "module";
|
||||||
|
import { node } from "../../.electron-vendors.cache.json";
|
||||||
|
|
||||||
const PACKAGE_ROOT = __dirname;
|
const PACKAGE_ROOT = __dirname;
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
import { ipcRenderer } from "electron";
|
import { ipcRenderer } from "electron";
|
||||||
import { exposeInMainWorld } from "./exposeInMainWorld";
|
import { exposeInMainWorld } from "./exposeInMainWorld";
|
||||||
import type { DownloadBackupInput } from "./types";
|
|
||||||
import { IpcChannels } from "./types";
|
import { IpcChannels } from "./types";
|
||||||
|
import type { DownloadBackupInput } from "./types";
|
||||||
|
|
||||||
// Export for types in contracts.d.ts
|
// Export for types in contracts.d.ts
|
||||||
export const haveno = {
|
export const haveno = {
|
||||||
|
|
|
@ -16,13 +16,13 @@
|
||||||
|
|
||||||
import { ipcRenderer } from "electron";
|
import { ipcRenderer } from "electron";
|
||||||
import { exposeInMainWorld } from "./exposeInMainWorld";
|
import { exposeInMainWorld } from "./exposeInMainWorld";
|
||||||
|
import { IpcChannels } from "./types";
|
||||||
import type {
|
import type {
|
||||||
AccountInfoDto,
|
AccountInfoDto,
|
||||||
ChangePasswordInput,
|
ChangePasswordInput,
|
||||||
IPreferences,
|
IPreferences,
|
||||||
SetPasswordInput,
|
SetPasswordInput,
|
||||||
} from "./types";
|
} from "./types";
|
||||||
import { IpcChannels } from "./types";
|
|
||||||
|
|
||||||
// Export for types in contracts.d.ts
|
// Export for types in contracts.d.ts
|
||||||
export const store = {
|
export const store = {
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import { chrome } from "../../.electron-vendors.cache.json";
|
|
||||||
import { builtinModules } from "module";
|
import { builtinModules } from "module";
|
||||||
|
import { chrome } from "../../.electron-vendors.cache.json";
|
||||||
|
|
||||||
const PACKAGE_ROOT = __dirname;
|
const PACKAGE_ROOT = __dirname;
|
||||||
|
|
||||||
|
|
|
@ -7,24 +7,41 @@
|
||||||
"plugin:@typescript-eslint/recommended",
|
"plugin:@typescript-eslint/recommended",
|
||||||
"plugin:react/recommended",
|
"plugin:react/recommended",
|
||||||
"plugin:react/jsx-runtime",
|
"plugin:react/jsx-runtime",
|
||||||
"plugin:prettier/recommended"
|
"plugin:prettier/recommended",
|
||||||
|
"plugin:import/recommended",
|
||||||
|
"plugin:import/typescript"
|
||||||
],
|
],
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"parser": "@typescript-eslint/parser",
|
"parser": "@typescript-eslint/parser",
|
||||||
"ecmaVersion": 12,
|
"ecmaVersion": 12,
|
||||||
"sourceType": "module"
|
"sourceType": "module"
|
||||||
},
|
},
|
||||||
"plugins": ["@typescript-eslint", "react"],
|
"plugins": ["@typescript-eslint", "react", "import"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/no-unused-vars": "error",
|
"@typescript-eslint/no-unused-vars": "error",
|
||||||
"@typescript-eslint/no-var-requires": "off",
|
"@typescript-eslint/no-var-requires": "off",
|
||||||
"@typescript-eslint/consistent-type-imports": "error",
|
"@typescript-eslint/consistent-type-imports": "error",
|
||||||
|
"@typescript-eslint/ban-ts-comment": "off",
|
||||||
|
"import/no-named-as-default": "off",
|
||||||
"prettier/prettier": "error",
|
"prettier/prettier": "error",
|
||||||
"react/jsx-curly-brace-presence": "error"
|
"react/jsx-curly-brace-presence": "error",
|
||||||
|
"import/order": "error",
|
||||||
|
"import/newline-after-import": "error"
|
||||||
},
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
"react": {
|
"react": {
|
||||||
"version": "detect"
|
"version": "detect"
|
||||||
|
},
|
||||||
|
"import/parsers": {
|
||||||
|
"@typescript-eslint/parser": [".ts", ".tsx"]
|
||||||
|
},
|
||||||
|
"import/resolver": {
|
||||||
|
"node": {
|
||||||
|
"extensions": [".js", ".jsx", ".ts", ".tsx"]
|
||||||
|
},
|
||||||
|
"typescript": {
|
||||||
|
"project": ["packages/renderer/tsconfig.json"]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,11 +14,11 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { FC } from "react";
|
|
||||||
import { useEffect, useMemo, useState } from "react";
|
import { useEffect, useMemo, useState } from "react";
|
||||||
import { IntlProvider as ReacIntlProvider } from "react-intl";
|
import { IntlProvider as ReacIntlProvider } from "react-intl";
|
||||||
import type { LangKeys } from "@src/constants/lang";
|
import type { FC } from "react";
|
||||||
import { LangPack, SupportedLocales } from "@src/constants/lang";
|
import { LangPack, SupportedLocales } from "@src/constants/lang";
|
||||||
|
import type { LangKeys } from "@src/constants/lang";
|
||||||
|
|
||||||
const DEFAULT_LOCALE = SupportedLocales.EN;
|
const DEFAULT_LOCALE = SupportedLocales.EN;
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { FC } from "react";
|
|
||||||
import { QueryClient, QueryClientProvider as QCProvider } from "react-query";
|
import { QueryClient, QueryClientProvider as QCProvider } from "react-query";
|
||||||
|
import type { FC } from "react";
|
||||||
|
|
||||||
const queryClient = new QueryClient({
|
const queryClient = new QueryClient({
|
||||||
defaultOptions: {
|
defaultOptions: {
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { FC } from "react";
|
|
||||||
import { MantineProvider, Global } from "@mantine/core";
|
import { MantineProvider, Global } from "@mantine/core";
|
||||||
|
import type { FC } from "react";
|
||||||
import { themeOverride, globalStyles } from "@src/theme";
|
import { themeOverride, globalStyles } from "@src/theme";
|
||||||
|
|
||||||
export const ThemeProvider: FC = ({ children }) => {
|
export const ThemeProvider: FC = ({ children }) => {
|
||||||
|
|
|
@ -14,14 +14,14 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { FC } from "react";
|
|
||||||
import { RecoilRoot } from "recoil";
|
import { RecoilRoot } from "recoil";
|
||||||
import { HashRouter } from "react-router-dom";
|
import { HashRouter } from "react-router-dom";
|
||||||
import { NotificationsProvider } from "@mantine/notifications";
|
import { NotificationsProvider } from "@mantine/notifications";
|
||||||
import { ModalsProvider } from "@atoms/Modal";
|
import type { FC } from "react";
|
||||||
import { QueryClientProvider } from "./QueryClientProvider";
|
import { QueryClientProvider } from "./QueryClientProvider";
|
||||||
import { IntlProvider } from "./IntlProvider";
|
import { IntlProvider } from "./IntlProvider";
|
||||||
import { ThemeProvider } from "./ThemeProvider";
|
import { ThemeProvider } from "./ThemeProvider";
|
||||||
|
import { ModalsProvider } from "@atoms/Modal";
|
||||||
|
|
||||||
export const AppProviders: FC = ({ children }) => (
|
export const AppProviders: FC = ({ children }) => (
|
||||||
<HashRouter>
|
<HashRouter>
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { ButtonProps as MButtonProps } from "@mantine/core";
|
|
||||||
import { Button as MButton, createStyles } from "@mantine/core";
|
import { Button as MButton, createStyles } from "@mantine/core";
|
||||||
|
import type { ButtonProps as MButtonProps } from "@mantine/core";
|
||||||
|
|
||||||
type ButtonProps<TComponent> = MButtonProps<TComponent> & {
|
type ButtonProps<TComponent> = MButtonProps<TComponent> & {
|
||||||
flavor?: "primary" | "neutral" | "success" | "danger";
|
flavor?: "primary" | "neutral" | "success" | "danger";
|
||||||
|
|
|
@ -14,9 +14,9 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
|
import { UnstyledButton } from "@mantine/core";
|
||||||
import type { ReactNode } from "react";
|
import type { ReactNode } from "react";
|
||||||
import type { UnstyledButtonProps } from "@mantine/core";
|
import type { UnstyledButtonProps } from "@mantine/core";
|
||||||
import { UnstyledButton } from "@mantine/core";
|
|
||||||
import { BodyText } from "@atoms/Typography";
|
import { BodyText } from "@atoms/Typography";
|
||||||
|
|
||||||
interface TextButtonProps extends UnstyledButtonProps<"button"> {
|
interface TextButtonProps extends UnstyledButtonProps<"button"> {
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
||||||
import { Stack } from "@mantine/core";
|
import { Stack } from "@mantine/core";
|
||||||
|
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
||||||
import { CircleIcon } from "./CircleIcon";
|
import { CircleIcon } from "./CircleIcon";
|
||||||
import { ReactComponent as ArrowNorth } from "@assets/arrow-north.svg";
|
import { ReactComponent as ArrowNorth } from "@assets/arrow-north.svg";
|
||||||
import { ReactComponent as ArrowWest } from "@assets/arrow-west.svg";
|
import { ReactComponent as ArrowWest } from "@assets/arrow-west.svg";
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { DefaultProps } from "@mantine/core";
|
|
||||||
import { Box, createStyles } from "@mantine/core";
|
import { Box, createStyles } from "@mantine/core";
|
||||||
|
import type { DefaultProps } from "@mantine/core";
|
||||||
|
|
||||||
export interface CircleIconProps extends DefaultProps {
|
export interface CircleIconProps extends DefaultProps {
|
||||||
color?: string;
|
color?: string;
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import { render } from "@testing-library/react";
|
import { render } from "@testing-library/react";
|
||||||
import { AppProviders } from "@atoms/AppProviders";
|
|
||||||
import { ConnectionProgress } from ".";
|
import { ConnectionProgress } from ".";
|
||||||
|
import { AppProviders } from "@atoms/AppProviders";
|
||||||
|
|
||||||
describe("atoms::ConnectionProgress", () => {
|
describe("atoms::ConnectionProgress", () => {
|
||||||
it("renders without exploding", () => {
|
it("renders without exploding", () => {
|
||||||
|
|
|
@ -14,10 +14,10 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import { BodyText } from "@atoms/Typography";
|
|
||||||
import { Stack } from "@mantine/core";
|
import { Stack } from "@mantine/core";
|
||||||
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
||||||
import { Currency } from ".";
|
import { Currency } from ".";
|
||||||
|
import { BodyText } from "@atoms/Typography";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: "atoms/Currency",
|
title: "atoms/Currency",
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import { render } from "@testing-library/react";
|
import { render } from "@testing-library/react";
|
||||||
import { AppProviders } from "@atoms/AppProviders";
|
|
||||||
import { Currency } from ".";
|
import { Currency } from ".";
|
||||||
|
import { AppProviders } from "@atoms/AppProviders";
|
||||||
|
|
||||||
describe("atoms::Currency", () => {
|
describe("atoms::Currency", () => {
|
||||||
it("renders without exploding", () => {
|
it("renders without exploding", () => {
|
||||||
|
|
|
@ -14,9 +14,10 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { DefaultProps } from "@mantine/core";
|
|
||||||
import { Stack, createStyles, Text } from "@mantine/core";
|
import { Stack, createStyles, Text } from "@mantine/core";
|
||||||
|
import type { DefaultProps } from "@mantine/core";
|
||||||
import { BodyText } from "@atoms/Typography";
|
import { BodyText } from "@atoms/Typography";
|
||||||
|
|
||||||
export interface DetailItemProps extends DefaultProps {
|
export interface DetailItemProps extends DefaultProps {
|
||||||
label?: string;
|
label?: string;
|
||||||
textAlign?: "left" | "right";
|
textAlign?: "left" | "right";
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import { createStyles, Group } from "@mantine/core";
|
import { createStyles, Group } from "@mantine/core";
|
||||||
import type { DetailItemProps } from "@atoms/DetailItem";
|
|
||||||
import { DetailItem } from "@atoms/DetailItem";
|
import { DetailItem } from "@atoms/DetailItem";
|
||||||
|
import type { DetailItemProps } from "@atoms/DetailItem";
|
||||||
|
|
||||||
export interface DetailItemCardProps extends DetailItemProps {
|
export interface DetailItemCardProps extends DetailItemProps {
|
||||||
primary?: boolean;
|
primary?: boolean;
|
||||||
|
|
|
@ -1 +1,17 @@
|
||||||
|
// =============================================================================
|
||||||
|
// Copyright 2022 Haveno
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
// =============================================================================
|
||||||
|
|
||||||
export * from "./DetailItemCard";
|
export * from "./DetailItemCard";
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import { render } from "@testing-library/react";
|
import { render } from "@testing-library/react";
|
||||||
import { AppProviders } from "@atoms/AppProviders";
|
|
||||||
import { HeaderWithLogo } from ".";
|
import { HeaderWithLogo } from ".";
|
||||||
|
import { AppProviders } from "@atoms/AppProviders";
|
||||||
|
|
||||||
describe("atoms::HeaderWithLogo", () => {
|
describe("atoms::HeaderWithLogo", () => {
|
||||||
it("renders without exploding", () => {
|
it("renders without exploding", () => {
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
import { Stack } from "@mantine/core";
|
import { Stack } from "@mantine/core";
|
||||||
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
||||||
import type { LinkProps } from ".";
|
|
||||||
import { Link } from ".";
|
import { Link } from ".";
|
||||||
|
import type { LinkProps } from ".";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: "atoms/Link",
|
title: "atoms/Link",
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import { render } from "@testing-library/react";
|
import { render } from "@testing-library/react";
|
||||||
import { AppProviders } from "@atoms/AppProviders";
|
|
||||||
import { Link } from ".";
|
import { Link } from ".";
|
||||||
|
import { AppProviders } from "@atoms/AppProviders";
|
||||||
|
|
||||||
describe("atoms::Link", () => {
|
describe("atoms::Link", () => {
|
||||||
it("renders without exploding", () => {
|
it("renders without exploding", () => {
|
||||||
|
|
|
@ -14,10 +14,10 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { LinkProps as RouterLinkProps } from "react-router-dom";
|
|
||||||
import { Link as RouterLink } from "react-router-dom";
|
import { Link as RouterLink } from "react-router-dom";
|
||||||
import { BodyText } from "@atoms/Typography";
|
import type { LinkProps as RouterLinkProps } from "react-router-dom";
|
||||||
import type { ReactText } from "react";
|
import type { ReactText } from "react";
|
||||||
|
import { BodyText } from "@atoms/Typography";
|
||||||
|
|
||||||
export interface LinkProps extends RouterLinkProps {
|
export interface LinkProps extends RouterLinkProps {
|
||||||
children: ReactText;
|
children: ReactText;
|
||||||
|
|
|
@ -14,10 +14,10 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { ModalProps as MModalProps } from "@mantine/core";
|
|
||||||
import { createStyles, Modal as MModal } from "@mantine/core";
|
import { createStyles, Modal as MModal } from "@mantine/core";
|
||||||
import type { ModalsProviderProps } from "@mantine/modals";
|
|
||||||
import { ModalsProvider as MModalsProvider } from "@mantine/modals";
|
import { ModalsProvider as MModalsProvider } from "@mantine/modals";
|
||||||
|
import type { ModalProps as MModalProps } from "@mantine/core";
|
||||||
|
import type { ModalsProviderProps } from "@mantine/modals";
|
||||||
|
|
||||||
const commonModalProps = {
|
const commonModalProps = {
|
||||||
overlayOpacity: 0.25,
|
overlayOpacity: 0.25,
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import { render } from "@testing-library/react";
|
import { render } from "@testing-library/react";
|
||||||
import { AppProviders } from "@atoms/AppProviders";
|
|
||||||
import { MoneroNodeListItem, NodeStatus } from "./MoneroNodeListItem";
|
import { MoneroNodeListItem, NodeStatus } from "./MoneroNodeListItem";
|
||||||
|
import { AppProviders } from "@atoms/AppProviders";
|
||||||
|
|
||||||
describe("atoms::MoneroNodeListItem", () => {
|
describe("atoms::MoneroNodeListItem", () => {
|
||||||
it("renders without exploding", () => {
|
it("renders without exploding", () => {
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import { Stack } from "@mantine/core";
|
import { Stack } from "@mantine/core";
|
||||||
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
||||||
import { EyeCheck, EyeOff } from "tabler-icons-react";
|
import { EyeCheck, EyeOff } from "tabler-icons-react";
|
||||||
|
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
||||||
import { PasswordInput } from ".";
|
import { PasswordInput } from ".";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { PasswordInputProps as MPasswordInputProps } from "@mantine/core";
|
|
||||||
import { createStyles, PasswordInput as MPasswordInput } from "@mantine/core";
|
import { createStyles, PasswordInput as MPasswordInput } from "@mantine/core";
|
||||||
|
import type { PasswordInputProps as MPasswordInputProps } from "@mantine/core";
|
||||||
|
|
||||||
interface PasswordInputProps extends MPasswordInputProps {
|
interface PasswordInputProps extends MPasswordInputProps {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
|
@ -17,11 +17,11 @@
|
||||||
const navigateSpy = vi.fn();
|
const navigateSpy = vi.fn();
|
||||||
const deleteSessionSpy = vi.fn();
|
const deleteSessionSpy = vi.fn();
|
||||||
|
|
||||||
import type { SpyInstanceFn } from "vitest";
|
|
||||||
import { beforeAll, describe, expect, it, vi, afterEach } from "vitest";
|
import { beforeAll, describe, expect, it, vi, afterEach } from "vitest";
|
||||||
import { render, screen } from "@testing-library/react";
|
import { render, screen } from "@testing-library/react";
|
||||||
import { useAuth } from "@hooks/session/useAuth";
|
import type { SpyInstanceFn } from "vitest";
|
||||||
import { ProtectedRoute } from "./ProtectedRoute";
|
import { ProtectedRoute } from "./ProtectedRoute";
|
||||||
|
import { useAuth } from "@hooks/session/useAuth";
|
||||||
import { ROUTES } from "@constants/routes";
|
import { ROUTES } from "@constants/routes";
|
||||||
|
|
||||||
describe("atoms::ProtectedRoute", () => {
|
describe("atoms::ProtectedRoute", () => {
|
||||||
|
|
|
@ -14,9 +14,9 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { ReactNode } from "react";
|
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
|
import type { ReactNode } from "react";
|
||||||
import { useAuth } from "@hooks/session/useAuth";
|
import { useAuth } from "@hooks/session/useAuth";
|
||||||
import { deleteSession } from "@utils/session";
|
import { deleteSession } from "@utils/session";
|
||||||
import { ROUTES } from "@constants/routes";
|
import { ROUTES } from "@constants/routes";
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import { useState, useMemo } from "react";
|
import { useState, useMemo } from "react";
|
||||||
import type { SelectProps as MSelectProps } from "@mantine/core";
|
|
||||||
import { createStyles, Select as MSelect } from "@mantine/core";
|
import { createStyles, Select as MSelect } from "@mantine/core";
|
||||||
|
import type { SelectProps as MSelectProps } from "@mantine/core";
|
||||||
import { ReactComponent as ArrowIcon } from "@assets/arrow-down.svg";
|
import { ReactComponent as ArrowIcon } from "@assets/arrow-down.svg";
|
||||||
|
|
||||||
interface SelectProps extends MSelectProps {
|
interface SelectProps extends MSelectProps {
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
import { Stack } from "@mantine/core";
|
import { Stack } from "@mantine/core";
|
||||||
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
||||||
import { SyncStatus as SyncStatusOptions } from "@constants/sync-status";
|
|
||||||
import { SyncStatus } from ".";
|
import { SyncStatus } from ".";
|
||||||
|
import { SyncStatus as SyncStatusOptions } from "@constants/sync-status";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: "molecules/Sync Status",
|
title: "molecules/Sync Status",
|
||||||
|
|
|
@ -16,9 +16,9 @@
|
||||||
|
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import { render } from "@testing-library/react";
|
import { render } from "@testing-library/react";
|
||||||
|
import { SyncStatus } from ".";
|
||||||
import { AppProviders } from "@atoms/AppProviders";
|
import { AppProviders } from "@atoms/AppProviders";
|
||||||
import { SyncStatus as SyncStatusOptions } from "@constants/sync-status";
|
import { SyncStatus as SyncStatusOptions } from "@constants/sync-status";
|
||||||
import { SyncStatus } from ".";
|
|
||||||
|
|
||||||
describe("atoms::Sync Status", () => {
|
describe("atoms::Sync Status", () => {
|
||||||
it("renders the not synced status by default", () => {
|
it("renders the not synced status by default", () => {
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { TabsProps as MTabsProps } from "@mantine/core";
|
|
||||||
import { Tabs as MTabs, Tab as MTab, createStyles } from "@mantine/core";
|
import { Tabs as MTabs, Tab as MTab, createStyles } from "@mantine/core";
|
||||||
|
import type { TabsProps as MTabsProps } from "@mantine/core";
|
||||||
|
|
||||||
export function Tabs(props: MTabsProps) {
|
export function Tabs(props: MTabsProps) {
|
||||||
const style = useStyles();
|
const style = useStyles();
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
import { Stack } from "@mantine/core";
|
import { Stack } from "@mantine/core";
|
||||||
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
||||||
import { ReactComponent as BtcIcon } from "@assets/btc.svg";
|
|
||||||
import { TextInput } from ".";
|
import { TextInput } from ".";
|
||||||
|
import { ReactComponent as BtcIcon } from "@assets/btc.svg";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: "atoms/TextInput",
|
title: "atoms/TextInput",
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { TextInputProps as MTextInputProps } from "@mantine/core";
|
|
||||||
import { createStyles, TextInput as MTextInput } from "@mantine/core";
|
import { createStyles, TextInput as MTextInput } from "@mantine/core";
|
||||||
|
import type { TextInputProps as MTextInputProps } from "@mantine/core";
|
||||||
|
|
||||||
interface TextInputProps extends MTextInputProps {
|
interface TextInputProps extends MTextInputProps {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
|
@ -1,3 +1,19 @@
|
||||||
|
// =============================================================================
|
||||||
|
// Copyright 2022 Haveno
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
// =============================================================================
|
||||||
|
|
||||||
import { Anchor as MAnchor, createStyles } from "@mantine/core";
|
import { Anchor as MAnchor, createStyles } from "@mantine/core";
|
||||||
import type { AnchorProps as MAnchorProps } from "@mantine/core";
|
import type { AnchorProps as MAnchorProps } from "@mantine/core";
|
||||||
|
|
||||||
|
|
|
@ -14,10 +14,10 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { ReactText } from "react";
|
|
||||||
import { FormattedMessage } from "react-intl";
|
import { FormattedMessage } from "react-intl";
|
||||||
import type { TitleProps } from "@mantine/core";
|
|
||||||
import { Title } from "@mantine/core";
|
import { Title } from "@mantine/core";
|
||||||
|
import type { ReactText } from "react";
|
||||||
|
import type { TitleProps } from "@mantine/core";
|
||||||
import type { LangKeys } from "@constants/lang";
|
import type { LangKeys } from "@constants/lang";
|
||||||
|
|
||||||
interface HeadingProps extends TitleProps {
|
interface HeadingProps extends TitleProps {
|
||||||
|
|
|
@ -14,10 +14,10 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { ReactNode, ReactText } from "react";
|
|
||||||
import { FormattedMessage } from "react-intl";
|
import { FormattedMessage } from "react-intl";
|
||||||
import type { TextProps as MTextProps } from "@mantine/core";
|
|
||||||
import { Text as MText, createStyles } from "@mantine/core";
|
import { Text as MText, createStyles } from "@mantine/core";
|
||||||
|
import type { ReactNode, ReactText } from "react";
|
||||||
|
import type { TextProps as MTextProps } from "@mantine/core";
|
||||||
import type { LangKeys } from "@constants/lang";
|
import type { LangKeys } from "@constants/lang";
|
||||||
|
|
||||||
type TextProps<TComponent> = MTextProps<TComponent> & {
|
type TextProps<TComponent> = MTextProps<TComponent> & {
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
||||||
import { Stack } from "@mantine/core";
|
import { Stack } from "@mantine/core";
|
||||||
|
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
||||||
import { AddressCard } from "./AddressCard";
|
import { AddressCard } from "./AddressCard";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
|
@ -16,11 +16,11 @@
|
||||||
|
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
import QRCode from "react-qr-code";
|
import QRCode from "react-qr-code";
|
||||||
import type { OpenConfirmModal } from "@mantine/modals/lib/context";
|
|
||||||
import { showNotification } from "@mantine/notifications";
|
import { showNotification } from "@mantine/notifications";
|
||||||
import { useModals } from "@mantine/modals";
|
import { useModals } from "@mantine/modals";
|
||||||
import { useClipboard } from "@mantine/hooks";
|
import { useClipboard } from "@mantine/hooks";
|
||||||
import { Box, createStyles, Group, SimpleGrid, Skeleton } from "@mantine/core";
|
import { Box, createStyles, Group, SimpleGrid, Skeleton } from "@mantine/core";
|
||||||
|
import type { OpenConfirmModal } from "@mantine/modals/lib/context";
|
||||||
import { DetailItem } from "@atoms/DetailItem";
|
import { DetailItem } from "@atoms/DetailItem";
|
||||||
import { Button } from "@atoms/Buttons";
|
import { Button } from "@atoms/Buttons";
|
||||||
import { Anchor } from "@atoms/Typography";
|
import { Anchor } from "@atoms/Typography";
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
||||||
import { Stack } from "@mantine/core";
|
import { Stack } from "@mantine/core";
|
||||||
|
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
||||||
import { AddressCardSkeleton } from "./AddressCard";
|
import { AddressCardSkeleton } from "./AddressCard";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
|
@ -14,11 +14,11 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
||||||
import { Text } from "@mantine/core";
|
import { Text } from "@mantine/core";
|
||||||
|
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
||||||
|
import { NodeConnectSwitch } from ".";
|
||||||
import { ReactComponent as CloudIcon } from "@assets/setting-cloud.svg";
|
import { ReactComponent as CloudIcon } from "@assets/setting-cloud.svg";
|
||||||
import { ReactComponent as ServerIcon } from "@assets/setting-server.svg";
|
import { ReactComponent as ServerIcon } from "@assets/setting-server.svg";
|
||||||
import { NodeConnectSwitch } from ".";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: "molecules/NodeConnectSwitch",
|
title: "molecules/NodeConnectSwitch",
|
||||||
|
|
|
@ -16,10 +16,10 @@
|
||||||
|
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import { fireEvent, render, screen } from "@testing-library/react";
|
import { fireEvent, render, screen } from "@testing-library/react";
|
||||||
|
import { NodeConnectSwitch } from ".";
|
||||||
import { AppProviders } from "@atoms/AppProviders";
|
import { AppProviders } from "@atoms/AppProviders";
|
||||||
import { ReactComponent as CloudIcon } from "@assets/setting-cloud.svg";
|
import { ReactComponent as CloudIcon } from "@assets/setting-cloud.svg";
|
||||||
import { ReactComponent as ServerIcon } from "@assets/setting-server.svg";
|
import { ReactComponent as ServerIcon } from "@assets/setting-server.svg";
|
||||||
import { NodeConnectSwitch } from ".";
|
|
||||||
|
|
||||||
describe("molecules::NodeConnectSwitch", () => {
|
describe("molecules::NodeConnectSwitch", () => {
|
||||||
it("renders without exploding", () => {
|
it("renders without exploding", () => {
|
||||||
|
|
|
@ -14,10 +14,10 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { ReactElement, ReactNode } from "react";
|
|
||||||
import { cloneElement, Children } from "react";
|
import { cloneElement, Children } from "react";
|
||||||
import { Box } from "@mantine/core";
|
import { Box } from "@mantine/core";
|
||||||
import { useUncontrolled } from "@mantine/hooks";
|
import { useUncontrolled } from "@mantine/hooks";
|
||||||
|
import type { ReactElement, ReactNode } from "react";
|
||||||
import { NodeConnectSwitchMethod } from "./NodeConnectSwitchMethod";
|
import { NodeConnectSwitchMethod } from "./NodeConnectSwitchMethod";
|
||||||
import { useTabsStyles } from "./NodeConnectSwitch.style";
|
import { useTabsStyles } from "./NodeConnectSwitch.style";
|
||||||
|
|
||||||
|
|
|
@ -14,10 +14,10 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import { LangKeys } from "@constants/lang";
|
|
||||||
import { Box } from "@mantine/core";
|
import { Box } from "@mantine/core";
|
||||||
import { FormattedMessage } from "react-intl";
|
import { FormattedMessage } from "react-intl";
|
||||||
import { useControlStyles } from "./NodeConnectSwitch.style";
|
import { useControlStyles } from "./NodeConnectSwitch.style";
|
||||||
|
import { LangKeys } from "@constants/lang";
|
||||||
|
|
||||||
interface SettingTabProps {
|
interface SettingTabProps {
|
||||||
active?: boolean;
|
active?: boolean;
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import { createStyles, UnstyledButton } from "@mantine/core";
|
import { createStyles, UnstyledButton } from "@mantine/core";
|
||||||
import { ReactComponent as AddIcon } from "@assets/circle-plus.svg";
|
|
||||||
import { HEIGHT, WIDTH } from "./_constants";
|
import { HEIGHT, WIDTH } from "./_constants";
|
||||||
|
import { ReactComponent as AddIcon } from "@assets/circle-plus.svg";
|
||||||
|
|
||||||
interface AddCardProps {
|
interface AddCardProps {
|
||||||
onClick: () => void;
|
onClick: () => void;
|
||||||
|
|
|
@ -15,12 +15,12 @@
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import { Stack } from "@mantine/core";
|
import { Stack } from "@mantine/core";
|
||||||
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
||||||
import {
|
import {
|
||||||
CryptoCurrencyAccountPayload,
|
CryptoCurrencyAccountPayload,
|
||||||
PaymentAccount,
|
PaymentAccount,
|
||||||
PaymentAccountPayload,
|
PaymentAccountPayload,
|
||||||
} from "haveno-ts";
|
} from "haveno-ts";
|
||||||
|
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
||||||
import { AddPaymentMethodButton, PaymentMethodCard } from ".";
|
import { AddPaymentMethodButton, PaymentMethodCard } from ".";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
|
@ -21,8 +21,8 @@ import {
|
||||||
PaymentAccount,
|
PaymentAccount,
|
||||||
PaymentAccountPayload,
|
PaymentAccountPayload,
|
||||||
} from "haveno-ts";
|
} from "haveno-ts";
|
||||||
import { AppProviders } from "@atoms/AppProviders";
|
|
||||||
import { PaymentMethodCard } from ".";
|
import { PaymentMethodCard } from ".";
|
||||||
|
import { AppProviders } from "@atoms/AppProviders";
|
||||||
|
|
||||||
describe("molecules::PaymentMethodCard", () => {
|
describe("molecules::PaymentMethodCard", () => {
|
||||||
it("renders without exploding", () => {
|
it("renders without exploding", () => {
|
||||||
|
|
|
@ -24,8 +24,8 @@ import {
|
||||||
UnstyledButton,
|
UnstyledButton,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import type { PaymentAccount } from "haveno-ts";
|
import type { PaymentAccount } from "haveno-ts";
|
||||||
import { ReactComponent as MenuIcon } from "@assets/ellipsis.svg";
|
|
||||||
import { HEIGHT, WIDTH } from "./_constants";
|
import { HEIGHT, WIDTH } from "./_constants";
|
||||||
|
import { ReactComponent as MenuIcon } from "@assets/ellipsis.svg";
|
||||||
import { BodyText } from "@atoms/Typography";
|
import { BodyText } from "@atoms/Typography";
|
||||||
import {
|
import {
|
||||||
getPaymentAccountLogo,
|
getPaymentAccountLogo,
|
||||||
|
|
|
@ -15,10 +15,10 @@
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { FC } from "react";
|
import type { FC } from "react";
|
||||||
|
import type { SupportedCurrencies } from "./_types";
|
||||||
import { ReactComponent as BtcLogo } from "@assets/btc.svg";
|
import { ReactComponent as BtcLogo } from "@assets/btc.svg";
|
||||||
import { ReactComponent as EthLogo } from "@assets/eth.svg";
|
import { ReactComponent as EthLogo } from "@assets/eth.svg";
|
||||||
import { ReactComponent as EurLogo } from "@assets/eur.svg";
|
import { ReactComponent as EurLogo } from "@assets/eur.svg";
|
||||||
import type { SupportedCurrencies } from "./_types";
|
|
||||||
|
|
||||||
export const WIDTH = "17rem";
|
export const WIDTH = "17rem";
|
||||||
export const HEIGHT = "7.25rem";
|
export const HEIGHT = "7.25rem";
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import { render } from "@testing-library/react";
|
import { render } from "@testing-library/react";
|
||||||
import { AppProviders } from "@atoms/AppProviders";
|
|
||||||
import { SecondarySidebar, SecondarySidebarItem } from "./";
|
import { SecondarySidebar, SecondarySidebarItem } from "./";
|
||||||
|
import { AppProviders } from "@atoms/AppProviders";
|
||||||
|
|
||||||
describe("molecules::SecondarySidebar", () => {
|
describe("molecules::SecondarySidebar", () => {
|
||||||
it("renders without exploding", () => {
|
it("renders without exploding", () => {
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import { useNavLinkActive } from "@hooks/misc/useNavLinkActive";
|
|
||||||
import { UnstyledButton, Group, Text, createStyles } from "@mantine/core";
|
import { UnstyledButton, Group, Text, createStyles } from "@mantine/core";
|
||||||
|
import { useNavLinkActive } from "@hooks/misc/useNavLinkActive";
|
||||||
|
|
||||||
interface SecondarySidebarItemProps {
|
interface SecondarySidebarItemProps {
|
||||||
isActive?: boolean;
|
isActive?: boolean;
|
||||||
|
|
|
@ -20,10 +20,10 @@ import {
|
||||||
getExpandedRowModel,
|
getExpandedRowModel,
|
||||||
} from "@tanstack/react-table";
|
} from "@tanstack/react-table";
|
||||||
import { Table as MTable } from "@mantine/core";
|
import { Table as MTable } from "@mantine/core";
|
||||||
import type { TableProps } from "./_types";
|
|
||||||
import { TableProvider } from "./use-table-context";
|
import { TableProvider } from "./use-table-context";
|
||||||
import { TableHeader } from "./TableHeader";
|
import { TableHeader } from "./TableHeader";
|
||||||
import { TableBody } from "./TableBody";
|
import { TableBody } from "./TableBody";
|
||||||
|
import type { TableProps } from "./_types";
|
||||||
|
|
||||||
export function Table(props: TableProps) {
|
export function Table(props: TableProps) {
|
||||||
const { table, columns, data, tableWrap } = props;
|
const { table, columns, data, tableWrap } = props;
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
import { beforeAll, describe, expect, it, vi } from "vitest";
|
import { beforeAll, describe, expect, it, vi } from "vitest";
|
||||||
import { render, waitForElementToBeRemoved } from "@testing-library/react";
|
import { render, waitForElementToBeRemoved } from "@testing-library/react";
|
||||||
import { AppProviders } from "@atoms/AppProviders";
|
|
||||||
import { WalletBalance } from ".";
|
import { WalletBalance } from ".";
|
||||||
|
import { AppProviders } from "@atoms/AppProviders";
|
||||||
|
|
||||||
describe("molecules::WalletBalance", () => {
|
describe("molecules::WalletBalance", () => {
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
||||||
import { WalletTransactions } from "./WalletTransactions";
|
import { WalletTransactions } from "./WalletTransactions";
|
||||||
import type { TWalletTransaction } from "./_types";
|
|
||||||
import { WalletTransactionType } from "./_types";
|
import { WalletTransactionType } from "./_types";
|
||||||
|
import type { TWalletTransaction } from "./_types";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: "organisms/WalletTransactions",
|
title: "organisms/WalletTransactions",
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import { createTable } from "@tanstack/react-table";
|
import { createTable } from "@tanstack/react-table";
|
||||||
import { Table } from "@molecules/Table";
|
|
||||||
import { createStyles } from "@mantine/core";
|
import { createStyles } from "@mantine/core";
|
||||||
import {
|
import {
|
||||||
WalletTransactionnSignCell,
|
WalletTransactionnSignCell,
|
||||||
|
@ -23,6 +22,7 @@ import {
|
||||||
} from "./WalletTransactionsCells";
|
} from "./WalletTransactionsCells";
|
||||||
import { WalletTransactionRowExpanded } from "./WalletTransactionsRowExpanded";
|
import { WalletTransactionRowExpanded } from "./WalletTransactionsRowExpanded";
|
||||||
import type { TWalletTransaction } from "./_types";
|
import type { TWalletTransaction } from "./_types";
|
||||||
|
import { Table } from "@molecules/Table";
|
||||||
|
|
||||||
const table = createTable().setRowType<TWalletTransaction>();
|
const table = createTable().setRowType<TWalletTransaction>();
|
||||||
|
|
||||||
|
|
|
@ -16,13 +16,13 @@
|
||||||
|
|
||||||
import { FormattedDate, FormattedTime, useIntl } from "react-intl";
|
import { FormattedDate, FormattedTime, useIntl } from "react-intl";
|
||||||
import { Box, Group, Stack, Text, useMantineTheme } from "@mantine/core";
|
import { Box, Group, Stack, Text, useMantineTheme } from "@mantine/core";
|
||||||
|
import { WalletTransactionType } from "./_types";
|
||||||
|
import type { TWalletTransaction } from "./_types";
|
||||||
import { ReactComponent as ArrowNorth } from "@assets/arrow-north.svg";
|
import { ReactComponent as ArrowNorth } from "@assets/arrow-north.svg";
|
||||||
import { ReactComponent as ArrowWest } from "@assets/arrow-west.svg";
|
import { ReactComponent as ArrowWest } from "@assets/arrow-west.svg";
|
||||||
import { LangKeys } from "@constants/lang";
|
import { LangKeys } from "@constants/lang";
|
||||||
import { Currency } from "@atoms/Currency";
|
import { Currency } from "@atoms/Currency";
|
||||||
import { CircleIcon } from "@atoms/CircleIcon/CircleIcon";
|
import { CircleIcon } from "@atoms/CircleIcon/CircleIcon";
|
||||||
import type { TWalletTransaction } from "./_types";
|
|
||||||
import { WalletTransactionType } from "./_types";
|
|
||||||
|
|
||||||
export function WalletTransactionnSignCell({
|
export function WalletTransactionnSignCell({
|
||||||
row,
|
row,
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import { render } from "@testing-library/react";
|
import { render } from "@testing-library/react";
|
||||||
import { AppProviders } from "@atoms/AppProviders";
|
|
||||||
import { AccountSidebar } from "./AccountSidebar";
|
import { AccountSidebar } from "./AccountSidebar";
|
||||||
|
import { AppProviders } from "@atoms/AppProviders";
|
||||||
|
|
||||||
describe("molecules::AccountSidebar", () => {
|
describe("molecules::AccountSidebar", () => {
|
||||||
it("renders without exploding", () => {
|
it("renders without exploding", () => {
|
||||||
|
|
|
@ -17,13 +17,13 @@
|
||||||
import { createStyles, Box, Title } from "@mantine/core";
|
import { createStyles, Box, Title } from "@mantine/core";
|
||||||
import { FormattedMessage } from "react-intl";
|
import { FormattedMessage } from "react-intl";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
|
import { WIDTH } from "./_constants";
|
||||||
|
import { useGetAccountSidebarMenu } from "./_hooks";
|
||||||
import {
|
import {
|
||||||
SecondarySidebar,
|
SecondarySidebar,
|
||||||
SecondarySidebarItem,
|
SecondarySidebarItem,
|
||||||
} from "@molecules/SecondarySidebar";
|
} from "@molecules/SecondarySidebar";
|
||||||
import { LangKeys } from "@constants/lang";
|
import { LangKeys } from "@constants/lang";
|
||||||
import { WIDTH } from "./_constants";
|
|
||||||
import { useGetAccountSidebarMenu } from "./_hooks";
|
|
||||||
|
|
||||||
export function AccountSidebar() {
|
export function AccountSidebar() {
|
||||||
const { classes } = useStyles();
|
const { classes } = useStyles();
|
||||||
|
|
|
@ -14,10 +14,10 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import { LangKeys } from "@constants/lang";
|
|
||||||
import { ROUTES } from "@constants/routes";
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useIntl } from "react-intl";
|
import { useIntl } from "react-intl";
|
||||||
|
import { LangKeys } from "@constants/lang";
|
||||||
|
import { ROUTES } from "@constants/routes";
|
||||||
|
|
||||||
export interface AccountSidebarItem {
|
export interface AccountSidebarItem {
|
||||||
label: string;
|
label: string;
|
||||||
|
|
|
@ -18,12 +18,12 @@ import { FormattedMessage } from "react-intl";
|
||||||
import { Stack, Box, Group } from "@mantine/core";
|
import { Stack, Box, Group } from "@mantine/core";
|
||||||
import { useForm, joiResolver } from "@mantine/form";
|
import { useForm, joiResolver } from "@mantine/form";
|
||||||
import { showNotification } from "@mantine/notifications";
|
import { showNotification } from "@mantine/notifications";
|
||||||
|
import { useAccountSecurityFormSchema } from "./_hooks";
|
||||||
|
import type { ChangePasswordFormValues } from "./_types";
|
||||||
import { PasswordInput } from "@atoms/PasswordInput";
|
import { PasswordInput } from "@atoms/PasswordInput";
|
||||||
import { LangKeys } from "@constants/lang";
|
import { LangKeys } from "@constants/lang";
|
||||||
import { Button } from "@atoms/Buttons";
|
import { Button } from "@atoms/Buttons";
|
||||||
import { useChangePassword } from "@hooks/storage/useChangePassword";
|
import { useChangePassword } from "@hooks/storage/useChangePassword";
|
||||||
import { useAccountSecurityFormSchema } from "./_hooks";
|
|
||||||
import type { ChangePasswordFormValues } from "./_types";
|
|
||||||
|
|
||||||
export function ChangePassword() {
|
export function ChangePassword() {
|
||||||
const accountSecurityFormSchema = useAccountSecurityFormSchema();
|
const accountSecurityFormSchema = useAccountSecurityFormSchema();
|
||||||
|
|
|
@ -14,10 +14,10 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import { LangKeys } from "@constants/lang";
|
|
||||||
import Joi from "joi";
|
import Joi from "joi";
|
||||||
import { useIntl } from "react-intl";
|
import { useIntl } from "react-intl";
|
||||||
import type { ChangePasswordFormValues } from "./_types";
|
import type { ChangePasswordFormValues } from "./_types";
|
||||||
|
import { LangKeys } from "@constants/lang";
|
||||||
|
|
||||||
const MIN_PASSWORD_CHARS = 8;
|
const MIN_PASSWORD_CHARS = 8;
|
||||||
|
|
||||||
|
|
|
@ -14,12 +14,12 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { FC } from "react";
|
|
||||||
import { useIntl } from "react-intl";
|
import { useIntl } from "react-intl";
|
||||||
|
import type { FC } from "react";
|
||||||
|
import { MyWalletMeneroBalanceSkeleton } from "./MyWalletMeneroBalanceSkeleton";
|
||||||
import { LangKeys } from "@constants/lang";
|
import { LangKeys } from "@constants/lang";
|
||||||
import { useBalances } from "@hooks/haveno/useBalances";
|
import { useBalances } from "@hooks/haveno/useBalances";
|
||||||
import { MoneroBalance } from "@organisms/MoneroBalance";
|
import { MoneroBalance } from "@organisms/MoneroBalance";
|
||||||
import { MyWalletMeneroBalanceSkeleton } from "./MyWalletMeneroBalanceSkeleton";
|
|
||||||
import { Currency } from "@atoms/Currency";
|
import { Currency } from "@atoms/Currency";
|
||||||
|
|
||||||
export function MyWalletMoneroBalanceContent() {
|
export function MyWalletMoneroBalanceContent() {
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
import { describe, expect, it, vi, beforeAll } from "vitest";
|
import { describe, expect, it, vi, beforeAll } from "vitest";
|
||||||
import { render, screen } from "@testing-library/react";
|
import { render, screen } from "@testing-library/react";
|
||||||
import { AppProviders } from "@atoms/AppProviders";
|
|
||||||
import { MyWalletPrimaryAddress } from "./MyWalletPrimaryAddress";
|
import { MyWalletPrimaryAddress } from "./MyWalletPrimaryAddress";
|
||||||
|
import { AppProviders } from "@atoms/AppProviders";
|
||||||
|
|
||||||
describe("organisms::MyWalletPrimaryAddress", () => {
|
describe("organisms::MyWalletPrimaryAddress", () => {
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
|
|
|
@ -17,11 +17,11 @@
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { FormattedMessage } from "react-intl";
|
import { FormattedMessage } from "react-intl";
|
||||||
import { Box, Button, Group, Stack, Text } from "@mantine/core";
|
import { Box, Button, Group, Stack, Text } from "@mantine/core";
|
||||||
|
import { getActiveReceiveAddresses, saveReceiveAddresss } from "./_utils";
|
||||||
import { LangKeys } from "@constants/lang";
|
import { LangKeys } from "@constants/lang";
|
||||||
import { Heading } from "@atoms/Typography";
|
import { Heading } from "@atoms/Typography";
|
||||||
import { AddressCard } from "@molecules/AddressCard/AddressCard";
|
import { AddressCard } from "@molecules/AddressCard/AddressCard";
|
||||||
import { useSetXmrNewSubaddress } from "@hooks/haveno/useSetXmrNewSubaddress";
|
import { useSetXmrNewSubaddress } from "@hooks/haveno/useSetXmrNewSubaddress";
|
||||||
import { getActiveReceiveAddresses, saveReceiveAddresss } from "./_utils";
|
|
||||||
|
|
||||||
export function MyWalletReceive() {
|
export function MyWalletReceive() {
|
||||||
const { mutateAsync: setXmrNewSubaddress, isLoading: isSetXmrLoading } =
|
const { mutateAsync: setXmrNewSubaddress, isLoading: isSetXmrLoading } =
|
||||||
|
|
|
@ -18,9 +18,9 @@ import { joiResolver, useForm } from "@mantine/form";
|
||||||
import { Group, SimpleGrid, Stack, Text } from "@mantine/core";
|
import { Group, SimpleGrid, Stack, Text } from "@mantine/core";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
import { useModals } from "@mantine/modals";
|
import { useModals } from "@mantine/modals";
|
||||||
import { TextInput } from "@atoms/TextInput";
|
|
||||||
import type { MyWalletSendFormValues } from "./_hooks";
|
|
||||||
import { useMyWalletSendFormValidation } from "./_hooks";
|
import { useMyWalletSendFormValidation } from "./_hooks";
|
||||||
|
import type { MyWalletSendFormValues } from "./_hooks";
|
||||||
|
import { TextInput } from "@atoms/TextInput";
|
||||||
import { LangKeys } from "@constants/lang";
|
import { LangKeys } from "@constants/lang";
|
||||||
import { Button } from "@atoms/Buttons";
|
import { Button } from "@atoms/Buttons";
|
||||||
import { useSetXmrSend } from "@hooks/haveno/useSetXmrSend";
|
import { useSetXmrSend } from "@hooks/haveno/useSetXmrSend";
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
import { describe, expect, it, vi, beforeAll } from "vitest";
|
import { describe, expect, it, vi, beforeAll } from "vitest";
|
||||||
import { render, screen } from "@testing-library/react";
|
import { render, screen } from "@testing-library/react";
|
||||||
import { AppProviders } from "@atoms/AppProviders";
|
|
||||||
import { MyWalletTransactions } from "./MyWalletTransactions";
|
import { MyWalletTransactions } from "./MyWalletTransactions";
|
||||||
|
import { AppProviders } from "@atoms/AppProviders";
|
||||||
|
|
||||||
describe("organisms::MyWalletMoneroBalance", () => {
|
describe("organisms::MyWalletMoneroBalance", () => {
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
|
|
|
@ -14,12 +14,12 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { FC } from "react";
|
|
||||||
import { useMemo } from "react";
|
import { useMemo } from "react";
|
||||||
import { Group, Loader } from "@mantine/core";
|
import { Group, Loader } from "@mantine/core";
|
||||||
|
import type { FC } from "react";
|
||||||
|
import { transfromXmrTxs } from "./_utils";
|
||||||
import { useXmrTxs } from "@hooks/haveno/useXmrTxs";
|
import { useXmrTxs } from "@hooks/haveno/useXmrTxs";
|
||||||
import { WalletTransactions } from "@molecules/WalletTransactions";
|
import { WalletTransactions } from "@molecules/WalletTransactions";
|
||||||
import { transfromXmrTxs } from "./_utils";
|
|
||||||
|
|
||||||
export function MyWalletTransactionsTable() {
|
export function MyWalletTransactionsTable() {
|
||||||
const { data: xmrTxs } = useXmrTxs();
|
const { data: xmrTxs } = useXmrTxs();
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
import { isEmpty } from "lodash";
|
import { isEmpty } from "lodash";
|
||||||
import type { XmrTx } from "haveno-ts";
|
import type { XmrTx } from "haveno-ts";
|
||||||
import type { TWalletTransaction } from "@molecules/WalletTransactions/_types";
|
|
||||||
import { WalletTransactionType } from "@molecules/WalletTransactions/_types";
|
import { WalletTransactionType } from "@molecules/WalletTransactions/_types";
|
||||||
|
import type { TWalletTransaction } from "@molecules/WalletTransactions/_types";
|
||||||
|
|
||||||
export const transfromXmrTxs = (
|
export const transfromXmrTxs = (
|
||||||
xmrTxs: Array<XmrTx.AsObject>
|
xmrTxs: Array<XmrTx.AsObject>
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { FormEvent } from "react";
|
|
||||||
import { Stack, Space, Group } from "@mantine/core";
|
import { Stack, Space, Group } from "@mantine/core";
|
||||||
|
import type { FormEvent } from "react";
|
||||||
import { BodyText, Heading } from "@atoms/Typography";
|
import { BodyText, Heading } from "@atoms/Typography";
|
||||||
import { Button, TextButton } from "@atoms/Buttons";
|
import { Button, TextButton } from "@atoms/Buttons";
|
||||||
import { Select } from "@atoms/Select";
|
import { Select } from "@atoms/Select";
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
import { describe, expect, it, vi } from "vitest";
|
import { describe, expect, it, vi } from "vitest";
|
||||||
import { fireEvent, render, screen } from "@testing-library/react";
|
import { fireEvent, render, screen } from "@testing-library/react";
|
||||||
import userEvent from "@testing-library/user-event";
|
import userEvent from "@testing-library/user-event";
|
||||||
import { AppProviders } from "@atoms/AppProviders";
|
|
||||||
import { SetPassword } from ".";
|
import { SetPassword } from ".";
|
||||||
|
import { AppProviders } from "@atoms/AppProviders";
|
||||||
|
|
||||||
describe("organisms::SetPassword", () => {
|
describe("organisms::SetPassword", () => {
|
||||||
it("renders without exploding", () => {
|
it("renders without exploding", () => {
|
||||||
|
|
|
@ -16,9 +16,9 @@
|
||||||
|
|
||||||
import { beforeAll, describe, expect, it, vi } from "vitest";
|
import { beforeAll, describe, expect, it, vi } from "vitest";
|
||||||
import { render } from "@testing-library/react";
|
import { render } from "@testing-library/react";
|
||||||
|
import { Sidebar } from ".";
|
||||||
import { AppProviders } from "@atoms/AppProviders";
|
import { AppProviders } from "@atoms/AppProviders";
|
||||||
import { SyncStatus } from "@constants/sync-status";
|
import { SyncStatus } from "@constants/sync-status";
|
||||||
import { Sidebar } from ".";
|
|
||||||
|
|
||||||
describe("molecules::Sidebar", () => {
|
describe("molecules::Sidebar", () => {
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
|
|
|
@ -15,12 +15,12 @@
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import { Box, createStyles, Navbar, Stack } from "@mantine/core";
|
import { Box, createStyles, Navbar, Stack } from "@mantine/core";
|
||||||
|
import { NAV_LINKS, WIDTH } from "./_constants";
|
||||||
|
import { NavLink } from "./_NavLink";
|
||||||
import { WalletBalance } from "@molecules/WalletBalance";
|
import { WalletBalance } from "@molecules/WalletBalance";
|
||||||
import { ReactComponent as Logo } from "@assets/logo-icon.svg";
|
import { ReactComponent as Logo } from "@assets/logo-icon.svg";
|
||||||
import { SyncStatus } from "@atoms/SyncStatus";
|
import { SyncStatus } from "@atoms/SyncStatus";
|
||||||
import { useSyncStatus } from "@hooks/haveno/useSyncStatus";
|
import { useSyncStatus } from "@hooks/haveno/useSyncStatus";
|
||||||
import { NAV_LINKS, WIDTH } from "./_constants";
|
|
||||||
import { NavLink } from "./_NavLink";
|
|
||||||
|
|
||||||
export function Sidebar() {
|
export function Sidebar() {
|
||||||
const { classes } = useStyles();
|
const { classes } = useStyles();
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { ReactNode } from "react";
|
|
||||||
import { UnstyledButton, Group, Text, createStyles } from "@mantine/core";
|
import { UnstyledButton, Group, Text, createStyles } from "@mantine/core";
|
||||||
|
import type { ReactNode } from "react";
|
||||||
|
|
||||||
interface NavLinkProps {
|
interface NavLinkProps {
|
||||||
icon: ReactNode;
|
icon: ReactNode;
|
||||||
|
|
|
@ -16,9 +16,9 @@
|
||||||
|
|
||||||
import { beforeAll, describe, expect, it, vi } from "vitest";
|
import { beforeAll, describe, expect, it, vi } from "vitest";
|
||||||
import { render, waitForElementToBeRemoved } from "@testing-library/react";
|
import { render, waitForElementToBeRemoved } from "@testing-library/react";
|
||||||
import { AppProviders } from "@atoms/AppProviders";
|
|
||||||
import { WalletManagement } from ".";
|
|
||||||
import { SeedPhrase } from "./SeedPhrase";
|
import { SeedPhrase } from "./SeedPhrase";
|
||||||
|
import { WalletManagement } from ".";
|
||||||
|
import { AppProviders } from "@atoms/AppProviders";
|
||||||
|
|
||||||
describe("molecules::WalletManagement", () => {
|
describe("molecules::WalletManagement", () => {
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
|
|
|
@ -19,11 +19,11 @@ import { FormattedMessage } from "react-intl";
|
||||||
import { useForm } from "@mantine/hooks";
|
import { useForm } from "@mantine/hooks";
|
||||||
import { Group, Space, Stack } from "@mantine/core";
|
import { Group, Space, Stack } from "@mantine/core";
|
||||||
import { showNotification } from "@mantine/notifications";
|
import { showNotification } from "@mantine/notifications";
|
||||||
|
import { SeedPhrase } from "./SeedPhrase";
|
||||||
import { Button } from "@atoms/Buttons";
|
import { Button } from "@atoms/Buttons";
|
||||||
import { PasswordInput } from "@atoms/PasswordInput";
|
import { PasswordInput } from "@atoms/PasswordInput";
|
||||||
import { useValidatePassword } from "@hooks/haveno/useValidatePassword";
|
import { useValidatePassword } from "@hooks/haveno/useValidatePassword";
|
||||||
import { LangKeys } from "@constants/lang";
|
import { LangKeys } from "@constants/lang";
|
||||||
import { SeedPhrase } from "./SeedPhrase";
|
|
||||||
|
|
||||||
export function WalletManagement() {
|
export function WalletManagement() {
|
||||||
const [isRevealed, setRevealed] = useState(false);
|
const [isRevealed, setRevealed] = useState(false);
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { FC } from "react";
|
|
||||||
import { Container, Stack } from "@mantine/core";
|
import { Container, Stack } from "@mantine/core";
|
||||||
|
import type { FC } from "react";
|
||||||
import { HeaderWithLogo } from "@atoms/Header";
|
import { HeaderWithLogo } from "@atoms/Header";
|
||||||
|
|
||||||
interface CenteredLayoutProps {
|
interface CenteredLayoutProps {
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import type { FC } from "react";
|
|
||||||
import { Box, createStyles, Group } from "@mantine/core";
|
import { Box, createStyles, Group } from "@mantine/core";
|
||||||
|
import type { FC } from "react";
|
||||||
import { Sidebar } from "@organisms/Sidebar";
|
import { Sidebar } from "@organisms/Sidebar";
|
||||||
|
|
||||||
export const NavbarLayout: FC = (props) => {
|
export const NavbarLayout: FC = (props) => {
|
||||||
|
|
|
@ -14,10 +14,10 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
|
import { PaymentMethodIds } from "./payment-methods";
|
||||||
import { ReactComponent as BtcLogo } from "@assets/btc.svg";
|
import { ReactComponent as BtcLogo } from "@assets/btc.svg";
|
||||||
import { ReactComponent as EthLogo } from "@assets/eth.svg";
|
import { ReactComponent as EthLogo } from "@assets/eth.svg";
|
||||||
import { ReactComponent as EurLogo } from "@assets/eur.svg";
|
import { ReactComponent as EurLogo } from "@assets/eur.svg";
|
||||||
import { PaymentMethodIds } from "./payment-methods";
|
|
||||||
|
|
||||||
export type SupportedFiat = "USD" | "EUR" | "GBP";
|
export type SupportedFiat = "USD" | "EUR" | "GBP";
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
import { useMutation, useQueryClient } from "react-query";
|
import { useMutation, useQueryClient } from "react-query";
|
||||||
import { UrlConnection } from "haveno-ts";
|
import { UrlConnection } from "haveno-ts";
|
||||||
import { QueryKeys } from "@constants/query-keys";
|
|
||||||
import { useHavenoClient } from "./useHavenoClient";
|
import { useHavenoClient } from "./useHavenoClient";
|
||||||
|
import { QueryKeys } from "@constants/query-keys";
|
||||||
|
|
||||||
interface Variables {
|
interface Variables {
|
||||||
address: string;
|
address: string;
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import { useQuery } from "react-query";
|
import { useQuery } from "react-query";
|
||||||
import { QueryKeys } from "@constants/query-keys";
|
|
||||||
import { useHavenoClient } from "./useHavenoClient";
|
import { useHavenoClient } from "./useHavenoClient";
|
||||||
|
import { QueryKeys } from "@constants/query-keys";
|
||||||
|
|
||||||
export function useAddress() {
|
export function useAddress() {
|
||||||
const client = useHavenoClient();
|
const client = useHavenoClient();
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import { useQuery } from "react-query";
|
import { useQuery } from "react-query";
|
||||||
import { QueryKeys } from "@constants/query-keys";
|
|
||||||
import { useHavenoClient } from "./useHavenoClient";
|
import { useHavenoClient } from "./useHavenoClient";
|
||||||
|
import { QueryKeys } from "@constants/query-keys";
|
||||||
|
|
||||||
interface BalanceInfo {
|
interface BalanceInfo {
|
||||||
balance: number;
|
balance: number;
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import { useQuery } from "react-query";
|
import { useQuery } from "react-query";
|
||||||
import { QueryKeys } from "@constants/query-keys";
|
|
||||||
import { useHavenoClient } from "./useHavenoClient";
|
import { useHavenoClient } from "./useHavenoClient";
|
||||||
|
import { QueryKeys } from "@constants/query-keys";
|
||||||
|
|
||||||
export function useGetMoneroConnection() {
|
export function useGetMoneroConnection() {
|
||||||
const client = useHavenoClient();
|
const client = useHavenoClient();
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import { useQuery } from "react-query";
|
import { useQuery } from "react-query";
|
||||||
import { QueryKeys } from "@constants/query-keys";
|
|
||||||
import { useHavenoClient } from "./useHavenoClient";
|
import { useHavenoClient } from "./useHavenoClient";
|
||||||
|
import { QueryKeys } from "@constants/query-keys";
|
||||||
|
|
||||||
export function useHavenoVersion() {
|
export function useHavenoVersion() {
|
||||||
const client = useHavenoClient();
|
const client = useHavenoClient();
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import { useQuery } from "react-query";
|
import { useQuery } from "react-query";
|
||||||
import { QueryKeys } from "@constants/query-keys";
|
|
||||||
import { useHavenoClient } from "./useHavenoClient";
|
import { useHavenoClient } from "./useHavenoClient";
|
||||||
|
import { QueryKeys } from "@constants/query-keys";
|
||||||
|
|
||||||
export function useIsMoneroNodeRunning() {
|
export function useIsMoneroNodeRunning() {
|
||||||
const client = useHavenoClient();
|
const client = useHavenoClient();
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
import { useQuery } from "react-query";
|
import { useQuery } from "react-query";
|
||||||
import type { UrlConnection } from "haveno-ts";
|
import type { UrlConnection } from "haveno-ts";
|
||||||
import { QueryKeys } from "@constants/query-keys";
|
|
||||||
import { useHavenoClient } from "./useHavenoClient";
|
import { useHavenoClient } from "./useHavenoClient";
|
||||||
|
import { QueryKeys } from "@constants/query-keys";
|
||||||
|
|
||||||
export function useMoneroConnections() {
|
export function useMoneroConnections() {
|
||||||
const client = useHavenoClient();
|
const client = useHavenoClient();
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
import { useQuery } from "react-query";
|
import { useQuery } from "react-query";
|
||||||
import type { MoneroNodeSettings } from "haveno-ts";
|
import type { MoneroNodeSettings } from "haveno-ts";
|
||||||
import { QueryKeys } from "@constants/query-keys";
|
|
||||||
import { useHavenoClient } from "./useHavenoClient";
|
import { useHavenoClient } from "./useHavenoClient";
|
||||||
|
import { QueryKeys } from "@constants/query-keys";
|
||||||
|
|
||||||
export function useMoneroNodeSettings() {
|
export function useMoneroNodeSettings() {
|
||||||
const client = useHavenoClient();
|
const client = useHavenoClient();
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
import { useQuery } from "react-query";
|
import { useQuery } from "react-query";
|
||||||
import type { PaymentAccount } from "haveno-ts";
|
import type { PaymentAccount } from "haveno-ts";
|
||||||
import { QueryKeys } from "@constants/query-keys";
|
|
||||||
import { useHavenoClient } from "./useHavenoClient";
|
import { useHavenoClient } from "./useHavenoClient";
|
||||||
|
import { QueryKeys } from "@constants/query-keys";
|
||||||
|
|
||||||
export function usePaymentAccounts() {
|
export function usePaymentAccounts() {
|
||||||
const client = useHavenoClient();
|
const client = useHavenoClient();
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
import { useQuery } from "react-query";
|
import { useQuery } from "react-query";
|
||||||
import type { MarketPriceInfo } from "haveno-ts";
|
import type { MarketPriceInfo } from "haveno-ts";
|
||||||
import { QueryKeys } from "@constants/query-keys";
|
|
||||||
import { useHavenoClient } from "./useHavenoClient";
|
import { useHavenoClient } from "./useHavenoClient";
|
||||||
|
import { QueryKeys } from "@constants/query-keys";
|
||||||
|
|
||||||
export function usePrices() {
|
export function usePrices() {
|
||||||
const client = useHavenoClient();
|
const client = useHavenoClient();
|
||||||
|
|
|
@ -16,9 +16,9 @@
|
||||||
|
|
||||||
import { useMutation, useQueryClient } from "react-query";
|
import { useMutation, useQueryClient } from "react-query";
|
||||||
import { MoneroNodeSettings } from "haveno-ts";
|
import { MoneroNodeSettings } from "haveno-ts";
|
||||||
|
import { useHavenoClient } from "./useHavenoClient";
|
||||||
import { QueryKeys } from "@constants/query-keys";
|
import { QueryKeys } from "@constants/query-keys";
|
||||||
import { useSaveRemoteNode } from "@hooks/storage/useSaveRemoteNode";
|
import { useSaveRemoteNode } from "@hooks/storage/useSaveRemoteNode";
|
||||||
import { useHavenoClient } from "./useHavenoClient";
|
|
||||||
|
|
||||||
interface Variables {
|
interface Variables {
|
||||||
blockchainPath: string;
|
blockchainPath: string;
|
||||||
|
|
|
@ -15,9 +15,9 @@
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
import { useMutation, useQueryClient } from "react-query";
|
import { useMutation, useQueryClient } from "react-query";
|
||||||
|
import { useHavenoClient } from "./useHavenoClient";
|
||||||
import { useSaveRemoteNode } from "@hooks/storage/useSaveRemoteNode";
|
import { useSaveRemoteNode } from "@hooks/storage/useSaveRemoteNode";
|
||||||
import { QueryKeys } from "@constants/query-keys";
|
import { QueryKeys } from "@constants/query-keys";
|
||||||
import { useHavenoClient } from "./useHavenoClient";
|
|
||||||
|
|
||||||
interface Variables {
|
interface Variables {
|
||||||
uri: string;
|
uri: string;
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
import { useMutation, useQueryClient } from "react-query";
|
import { useMutation, useQueryClient } from "react-query";
|
||||||
import { XmrDestination } from "haveno-ts";
|
import { XmrDestination } from "haveno-ts";
|
||||||
import { showNotification } from "@mantine/notifications";
|
import { showNotification } from "@mantine/notifications";
|
||||||
import { QueryKeys } from "@constants/query-keys";
|
|
||||||
import { useHavenoClient } from "./useHavenoClient";
|
import { useHavenoClient } from "./useHavenoClient";
|
||||||
|
import { QueryKeys } from "@constants/query-keys";
|
||||||
|
|
||||||
interface SetXmrSendVariables {
|
interface SetXmrSendVariables {
|
||||||
address: string;
|
address: string;
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue