4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
15 |
16 | Haveno :: Storybook
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "label": "TS Watch",
6 | "type": "process",
7 | "command": "./.vscode/tscwatch.sh",
8 | "isBackground": true,
9 | "group": {
10 | "kind": "build",
11 | "isDefault": true
12 | },
13 | "presentation": {
14 | "reveal": "never",
15 | "echo": false,
16 | "focus": false,
17 | "panel": "shared"
18 | },
19 | "problemMatcher": "$tsc-watch",
20 | "runOptions": {
21 | "runOn": "folderOpen"
22 | }
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/.vscode/tscwatch.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | ./node_modules/.bin/tsc --watch --noEmit --project packages/main &
3 | P1=$!
4 | ./node_modules/.bin/tsc --watch --noEmit --project packages/preload &
5 | P2=$!
6 | ./node_modules/.bin/tsc --watch --noEmit --project packages/renderer &
7 | P3=$!
8 | wait $P1 $P2 $P3
9 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Haveno User Interface
2 |
3 | ## Development
4 |
5 | ### Prerequisites
6 |
7 | 1. Node 16.x
8 | 2. yarn 1.x
9 | 3. Run user1-daemon-local and envoy proxy by following [these instructions](https://github.com/haveno-dex/haveno-ts#run-tests)
10 |
11 | ### Install dependencies
12 |
13 | ```sh
14 | yarn
15 | ```
16 |
17 | ### Configure environment variables
18 |
19 | Copy [.env.example](./.env.example) to a file called `.env` and point the environment variables to the envoy proxy.
20 |
21 | ### Start the app in watch mode
22 |
23 | ```sh
24 | yarn watch
25 | ```
26 |
27 | ### Tests
28 |
29 | ```sh
30 | yarn test
31 | ```
32 |
33 | ### Storybook
34 |
35 | ```sh
36 | yarn storybook
37 | ```
38 |
39 | ### App Data Folder
40 |
41 | The UI's data folder can be cleared to reset the UI state, located at:
42 |
43 | - Mac: ~/Library/Application Support/haveno-ui/
44 | - Linux: ~/.local/share/haveno-ui/
45 | - Windows: ~\AppData\Roaming\haveno-ui\
--------------------------------------------------------------------------------
/buildResources/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haveno-dex/haveno-ui/1cd1ecfe6b65ece5462383de6ebf4b51cb92b830/buildResources/.gitkeep
--------------------------------------------------------------------------------
/buildResources/icon.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haveno-dex/haveno-ui/1cd1ecfe6b65ece5462383de6ebf4b51cb92b830/buildResources/icon.icns
--------------------------------------------------------------------------------
/buildResources/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haveno-dex/haveno-ui/1cd1ecfe6b65ece5462383de6ebf4b51cb92b830/buildResources/icon.png
--------------------------------------------------------------------------------
/commitlint.config.js:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | module.exports = {
18 | extends: ["@commitlint/config-conventional"],
19 | };
20 |
--------------------------------------------------------------------------------
/packages/main/src/types/haveno.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export interface DownloadBackupInput {
18 | bytes: ArrayBuffer;
19 | }
20 |
--------------------------------------------------------------------------------
/packages/main/src/types/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./ipc";
18 | export * from "./store";
19 | export * from "./haveno";
20 |
--------------------------------------------------------------------------------
/packages/main/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "esnext",
4 | "target": "esnext",
5 | "sourceMap": false,
6 | "moduleResolution": "Node",
7 | "skipLibCheck": true,
8 | "strict": true,
9 | "isolatedModules": true,
10 | "allowSyntheticDefaultImports": true,
11 | "types": ["node", "vite-plugin-svgr/client"],
12 |
13 | "baseUrl": ".",
14 | "paths": {
15 | "@src/*": ["./src/*"],
16 | "@services/*": ["./src/services/*"],
17 | "@types/*": ["./src/types/*"]
18 | }
19 | },
20 | "include": ["src/**/*.ts", "../../types/**/*.d.ts"],
21 | "exclude": ["**/*.spec.ts", "**/*.test.ts"]
22 | }
23 |
--------------------------------------------------------------------------------
/packages/main/vitest.coverage.config.js:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | /**
18 | * Config for global end-to-end tests
19 | * placed in project root tests folder
20 | * @type {import('vite').UserConfig}
21 | * @see https://vitest.dev/config/
22 | */
23 | const config = {
24 | test: {
25 | include: ["./src/**/*.{test,spec}.{ts,tsx}"],
26 | coverage: {
27 | reporter: ["html"],
28 | },
29 | },
30 | };
31 |
32 | export default config;
33 |
--------------------------------------------------------------------------------
/packages/preload/contracts.d.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | /* eslint-disable @typescript-eslint/consistent-type-imports */
18 |
19 | interface Exposed {
20 | readonly nodeCrypto: Readonly;
21 | readonly versions: Readonly;
22 | readonly electronStore: Readonly;
23 | readonly haveno: Readonly;
24 | }
25 |
26 | // eslint-disable-next-line @typescript-eslint/no-empty-interface
27 | interface Window extends Exposed {}
28 |
--------------------------------------------------------------------------------
/packages/preload/src/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | /**
18 | * @module preload
19 | */
20 |
21 | import "./nodeCrypto";
22 | import "./versions";
23 | import "./store";
24 | import "./haveno";
25 |
--------------------------------------------------------------------------------
/packages/preload/src/nodeCrypto.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { type BinaryLike, createHash } from "crypto";
18 | import { exposeInMainWorld } from "./exposeInMainWorld";
19 |
20 | function sha256sum(data: BinaryLike) {
21 | return createHash("sha256").update(data).digest("hex");
22 | }
23 |
24 | // Export for types in contracts.d.ts
25 | export const nodeCrypto = { sha256sum } as const;
26 |
27 | exposeInMainWorld("nodeCrypto", nodeCrypto);
28 |
--------------------------------------------------------------------------------
/packages/preload/src/types/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "../../../main/src/types";
18 |
--------------------------------------------------------------------------------
/packages/preload/src/versions.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { exposeInMainWorld } from "./exposeInMainWorld";
18 |
19 | // Export for types in contracts.d.ts
20 | export const versions = process.versions;
21 |
22 | exposeInMainWorld("versions", versions);
23 |
--------------------------------------------------------------------------------
/packages/preload/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "esnext",
4 | "target": "esnext",
5 | "sourceMap": false,
6 | "moduleResolution": "Node",
7 | "skipLibCheck": true,
8 | "strict": true,
9 | "isolatedModules": true,
10 |
11 | "types": ["node"],
12 |
13 | "baseUrl": "."
14 | },
15 | "include": ["src/**/*.ts", "contracts.d.ts", "../../types/**/*.d.ts"],
16 | "exclude": ["**/*.spec.ts", "**/*.test.ts"]
17 | }
18 |
--------------------------------------------------------------------------------
/packages/preload/vitest.coverage.config.js:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | /**
18 | * Config for global end-to-end tests
19 | * placed in project root tests folder
20 | * @type {import('vite').UserConfig}
21 | * @see https://vitest.dev/config/
22 | */
23 | const config = {
24 | test: {
25 | include: ["./src/**/*.{test,spec}.{ts,tsx}"],
26 | coverage: {
27 | reporter: ["html"],
28 | },
29 | },
30 | };
31 |
32 | export default config;
33 |
--------------------------------------------------------------------------------
/packages/renderer/assets/account.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/packages/renderer/assets/arrow-down.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/packages/renderer/assets/arrow-north.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/packages/renderer/assets/arrow-up.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/packages/renderer/assets/arrow-west.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/packages/renderer/assets/check-circle.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/packages/renderer/assets/circle-plus.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/packages/renderer/assets/ellipsis.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/packages/renderer/assets/eth.svg:
--------------------------------------------------------------------------------
1 |
19 |
--------------------------------------------------------------------------------
/packages/renderer/assets/eur.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/packages/renderer/assets/fonts/Inter-Variable.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haveno-dex/haveno-ui/1cd1ecfe6b65ece5462383de6ebf4b51cb92b830/packages/renderer/assets/fonts/Inter-Variable.ttf
--------------------------------------------------------------------------------
/packages/renderer/assets/logo-icon.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/packages/renderer/assets/logo-white.svg:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/packages/renderer/assets/markets.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/packages/renderer/assets/monero.svg:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/packages/renderer/assets/notification.svg:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/packages/renderer/assets/notifications.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/packages/renderer/assets/setting-cloud.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/renderer/assets/setting-server.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/packages/renderer/assets/trades.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/packages/renderer/assets/unknown.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/packages/renderer/assets/xmr-logo-1.svg:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/packages/renderer/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 | Haveno
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/AppProviders/QueryClientProvider.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { QueryClient, QueryClientProvider as QCProvider } from "react-query";
18 | import type { FC } from "react";
19 |
20 | const queryClient = new QueryClient({
21 | defaultOptions: {
22 | queries: {
23 | refetchOnWindowFocus: false,
24 | staleTime: 60 * 1000, // 60 sec
25 | },
26 | },
27 | });
28 |
29 | export const QueryClientProvider: FC = ({ children }) => (
30 | {children}
31 | );
32 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/AppProviders/ThemeProvider.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { MantineProvider, Global } from "@mantine/core";
18 | import type { FC } from "react";
19 | import { themeOverride, globalStyles } from "@src/theme";
20 |
21 | export const ThemeProvider: FC = ({ children }) => {
22 | return (
23 |
24 |
25 | {children}
26 |
27 | );
28 | };
29 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/Buttons/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./Button";
18 | export * from "./TextButton";
19 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/CircleIcon/CircleIcon.test.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { describe, expect, it } from "vitest";
18 | import { render } from "@testing-library/react";
19 | import { CircleIcon } from "./CircleIcon";
20 | import { ReactComponent as ArrowNorth } from "@assets/arrow-north.svg";
21 |
22 | describe("atoms::CircleIcon", () => {
23 | it("renders without exploding", () => {
24 | const { asFragment } = render(
25 |
26 |
27 |
28 | );
29 | expect(asFragment()).toMatchSnapshot();
30 | });
31 | });
32 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/CircleIcon/__snapshots__/CircleIcon.test.tsx.snap:
--------------------------------------------------------------------------------
1 | // Vitest Snapshot v1
2 |
3 | exports[`atoms::CircleIcon > renders without exploding 1`] = `
4 |
5 |
8 |
20 |
21 |
22 | `;
23 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/ConnectionProgress/ConnectionProgress.test.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { describe, expect, it } from "vitest";
18 | import { render } from "@testing-library/react";
19 | import { ConnectionProgress } from ".";
20 | import { AppProviders } from "@atoms/AppProviders";
21 |
22 | describe("atoms::ConnectionProgress", () => {
23 | it("renders without exploding", () => {
24 | const { asFragment } = render(
25 |
26 |
27 |
28 | );
29 | expect(asFragment()).toMatchSnapshot();
30 | });
31 | });
32 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/ConnectionProgress/__snapshots__/ConnectionProgress.test.tsx.snap:
--------------------------------------------------------------------------------
1 | // Vitest Snapshot v1
2 |
3 | exports[`atoms::ConnectionProgress > renders without exploding 1`] = `
4 |
5 |
8 |
11 | Connecting to Monero Network
12 |
13 |
16 |
19 |
20 |
21 |
22 | `;
23 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/ConnectionProgress/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./ConnectionProgress";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/Currency/__snapshots__/Currency.test.tsx.snap:
--------------------------------------------------------------------------------
1 | // Vitest Snapshot v1
2 |
3 | exports[`atoms::Currency > renders currency value 1`] = `
4 |
5 | USD 10.00
6 |
7 | `;
8 |
9 | exports[`atoms::Currency > renders decimal value 1`] = `
10 |
11 | 10.12345678
12 |
13 | `;
14 |
15 | exports[`atoms::Currency > renders without exploding 1`] = `
16 |
17 | 10.00
18 |
19 | `;
20 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/Currency/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./Currency";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/DetailItem/__snapshots__/DetailItem.test.tsx.snap:
--------------------------------------------------------------------------------
1 | // Vitest Snapshot v1
2 |
3 | exports[`atoms::DetailItem > renders without exploding 1`] = `
4 |
5 |
8 |
11 | Label
12 |
13 |
16 | Content
17 |
18 |
19 |
20 | `;
21 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/DetailItem/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./DetailItem";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/DetailItemCard/index.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./DetailItemCard";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/Header/Header.stories.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { Stack } from "@mantine/core";
18 | import type { ComponentStory, ComponentMeta } from "@storybook/react";
19 | import { HeaderWithLogo } from ".";
20 |
21 | export default {
22 | title: "atoms/Header",
23 | component: HeaderWithLogo,
24 | } as ComponentMeta;
25 |
26 | const Template: ComponentStory = () => {
27 | return (
28 |
29 |
30 |
31 | );
32 | };
33 |
34 | export const Default = Template.bind({});
35 | Default.args = {};
36 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/Header/HeaderWithLogo.test.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { describe, expect, it } from "vitest";
18 | import { render } from "@testing-library/react";
19 | import { HeaderWithLogo } from ".";
20 | import { AppProviders } from "@atoms/AppProviders";
21 |
22 | describe("atoms::HeaderWithLogo", () => {
23 | it("renders without exploding", () => {
24 | const { asFragment } = render(
25 |
26 |
27 |
28 | );
29 | expect(asFragment()).toMatchSnapshot();
30 | });
31 | });
32 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/Header/HeaderWithLogo.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { Box } from "@mantine/core";
18 | import Logo from "@assets/logo.svg";
19 |
20 | export function HeaderWithLogo() {
21 | return (
22 |
27 |
28 |
29 | );
30 | }
31 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/Header/__snapshots__/HeaderWithLogo.test.tsx.snap:
--------------------------------------------------------------------------------
1 | // Vitest Snapshot v1
2 |
3 | exports[`atoms::HeaderWithLogo > renders without exploding 1`] = `
4 |
5 |
8 |
13 |
14 |
15 | `;
16 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/Header/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./HeaderWithLogo";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/Link/Link.test.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { describe, expect, it } from "vitest";
18 | import { render } from "@testing-library/react";
19 | import { Link } from ".";
20 | import { AppProviders } from "@atoms/AppProviders";
21 |
22 | describe("atoms::Link", () => {
23 | it("renders without exploding", () => {
24 | const { asFragment } = render(
25 |
26 | Click me
27 |
28 | );
29 | expect(asFragment()).toMatchSnapshot();
30 | });
31 | });
32 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/Link/__snapshots__/Link.test.tsx.snap:
--------------------------------------------------------------------------------
1 | // Vitest Snapshot v1
2 |
3 | exports[`atoms::Link > renders without exploding 1`] = `
4 |
5 |
8 |
11 | Click me
12 |
13 |
14 |
15 | `;
16 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/Link/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./Link";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/Modal/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./Modal";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/MoneroNodeListItem/__snapshots__/MoneroNodeListItem.test.tsx.snap:
--------------------------------------------------------------------------------
1 | // Vitest Snapshot v1
2 |
3 | exports[`atoms::MoneroNodeListItem > renders without exploding 1`] = `
4 |
5 |
22 |
39 |
40 | `;
41 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/MoneroNodeListItem/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./MoneroNodeListItem";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/PasswordInput/PasswordInput.test.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { describe, expect, it } from "vitest";
18 | import { render } from "@testing-library/react";
19 | import { PasswordInput } from ".";
20 |
21 | describe("atoms::PasswordInput", () => {
22 | it("renders without exploding", () => {
23 | const { asFragment } = render(
24 |
25 | );
26 | expect(asFragment()).toMatchSnapshot();
27 | });
28 | });
29 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/PasswordInput/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./PasswordInput";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/ProtectedRoute/__snapshots__/ProtectedRoute.test.tsx.snap:
--------------------------------------------------------------------------------
1 | // Vitest Snapshot v1
2 |
3 | exports[`atoms::ProtectedRoute > renders children if auth session exists 1`] = `
4 |
5 |
6 | Protected content
7 |
8 |
9 | `;
10 |
11 | exports[`atoms::ProtectedRoute > skips rendering children and redirects to login if auth session can't be retrieved 1`] = ``;
12 |
13 | exports[`atoms::ProtectedRoute > skips rendering children and redirects to login if no auth session exists 1`] = ``;
14 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/ProtectedRoute/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./ProtectedRoute";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/Select/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./Select";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/SyncStatus/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./SyncStatus";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/Tabs/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./Tabs";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/TextInput/TextInput.test.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { describe, expect, it } from "vitest";
18 | import { render } from "@testing-library/react";
19 | import { TextInput } from ".";
20 |
21 | describe("atoms::TextInput", () => {
22 | it("renders without exploding", () => {
23 | const { asFragment } = render(
24 |
30 | );
31 | expect(asFragment()).toMatchSnapshot();
32 | });
33 | });
34 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/TextInput/__snapshots__/TextInput.test.tsx.snap:
--------------------------------------------------------------------------------
1 | // Vitest Snapshot v1
2 |
3 | exports[`atoms::TextInput > renders without exploding 1`] = `
4 |
5 |
8 |
15 |
18 |
25 |
26 |
27 |
28 | `;
29 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/TextInput/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./TextInput";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/ToggleButton/ToggleButton.stories.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import type { ComponentStory, ComponentMeta } from "@storybook/react";
18 | import { ToggleButton } from "./ToggleButton";
19 |
20 | export default {
21 | title: "atoms/ToggleButton",
22 | component: ToggleButton,
23 | } as ComponentMeta;
24 |
25 | const Template: ComponentStory = (args) => {
26 | return ;
27 | };
28 |
29 | export const Default = Template.bind({});
30 |
31 | Default.args = {
32 | labels: ["Sell XMR", "Buy XMR"],
33 | };
34 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/Typography/Anchor.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { Anchor as MAnchor, createStyles } from "@mantine/core";
18 | import type { AnchorProps as MAnchorProps } from "@mantine/core";
19 |
20 | export function Anchor(props: MAnchorProps<"a">) {
21 | const { classes, cx } = useStyles();
22 |
23 | return ;
24 | }
25 |
26 | const useStyles = createStyles((theme) => ({
27 | anchor: {
28 | color: theme.colors.blue[6],
29 | },
30 | }));
31 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/atoms/Typography/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./Heading";
18 | export * from "./Text";
19 | export * from "./Anchor";
20 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/molecules/AddressCard/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./AddressCard";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/molecules/NodeConnectSwitch/index.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./NodeConnectSwitch";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/molecules/PaymentMethodCard/__snapshots__/AddPaymentMethodButton.test.tsx.snap:
--------------------------------------------------------------------------------
1 | // Vitest Snapshot v1
2 |
3 | exports[`molecules::AddPaymentMethodButton > renders without exploding 1`] = `
4 |
5 |
23 |
24 | `;
25 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/molecules/PaymentMethodCard/_types.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | // TODO @subir: move this to @constants/currencies
18 | export type SupportedCurrencies = "BTC" | "ETH" | "EUR";
19 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/molecules/PaymentMethodCard/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./AddPaymentMethodButton";
18 | export * from "./PaymentMethodCard";
19 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/molecules/ReadyToUse/__snapshots__/ReadyToUse.test.tsx.snap:
--------------------------------------------------------------------------------
1 | // Vitest Snapshot v1
2 |
3 | exports[`molecules::ReadyToUse > renders without exploding 1`] = `
4 |
5 |
8 |
11 | Haveno is ready for use.
12 |
13 |
16 | You’ve succesfully set up Haveno. Please note that to be able to trade, you need to deposit Monero in your Haveno wallet and set up a payment account.
17 |
18 |
21 |
24 |
38 |
39 |
40 |
41 | `;
42 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/molecules/ReadyToUse/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./ReadyToUse";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/molecules/SecondarySidebar/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./SecondarySidebar";
18 | export * from "./SecondarySidebarItem";
19 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/molecules/Table/__snapshots__/Table.test.tsx.snap:
--------------------------------------------------------------------------------
1 | // Vitest Snapshot v1
2 |
3 | exports[`molecules::Table > renders without exploding. 1`] = `
4 |
5 |
8 |
9 |
10 |
14 | Name
15 |
16 |
17 |
18 |
22 | First Name
23 |
24 |
28 | Last Name
29 |
30 |
31 |
32 |
33 |
34 |
37 | Ahmed
38 |
39 |
42 | Subir
43 |
44 |
45 |
46 |
47 |
48 | `;
49 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/molecules/Table/_utils.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export const updateTableCell = (
18 | // eslint-disable-next-line @typescript-eslint/no-explicit-any
19 | data: Array,
20 | rowIndex: number,
21 | columnId: string,
22 | value: unknown
23 | ) => {
24 | return data.map((row, index) => {
25 | if (index === rowIndex) {
26 | return {
27 | // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
28 | ...data[rowIndex]!,
29 | [columnId]: value,
30 | };
31 | }
32 | return row;
33 | });
34 | };
35 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/molecules/Table/cells/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./CheckboxCell";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/molecules/Table/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./_types";
18 | export * from "./Table";
19 | export * from "./cells";
20 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/molecules/WalletBalance/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./WalletBalance";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/molecules/WalletTransactions/_types.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export enum WalletTransactionType {
18 | Sent = "Sent",
19 | Received = "Received",
20 | }
21 |
22 | export interface TWalletTransaction {
23 | type: WalletTransactionType;
24 | timestamp: number | Date;
25 |
26 | amount: number;
27 | amountCurrency: string;
28 |
29 | foreignAmount?: number;
30 | foreignAmountCurrency?: string;
31 |
32 | transactionId: string;
33 |
34 | destinationAddresses?: Array;
35 | incomingAddresses?: Array;
36 |
37 | fee: number;
38 | height: number;
39 | }
40 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/molecules/WalletTransactions/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./WalletTransactions";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/AccountSidebar/AccountSidebar.stories.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import type { ComponentStory, ComponentMeta } from "@storybook/react";
18 | import { AccountSidebar } from "./AccountSidebar";
19 |
20 | export default {
21 | title: "organisms/AccountSidebar",
22 | component: AccountSidebar,
23 | } as ComponentMeta;
24 |
25 | const Template: ComponentStory = () => {
26 | return ;
27 | };
28 |
29 | export const Default = Template.bind({});
30 | Default.args = {};
31 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/AccountSidebar/AccountSidebar.test.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { describe, expect, it } from "vitest";
18 | import { render } from "@testing-library/react";
19 | import { AccountSidebar } from "./AccountSidebar";
20 | import { AppProviders } from "@atoms/AppProviders";
21 |
22 | describe("molecules::AccountSidebar", () => {
23 | it("renders without exploding", () => {
24 | const { asFragment } = render(
25 |
26 |
27 |
28 | );
29 | expect(asFragment()).toMatchSnapshot();
30 | });
31 | });
32 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/AccountSidebar/_constants.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export const WIDTH = 210;
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/AccountSidebar/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./AccountSidebar";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/AddNode/AddNode.stories.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import type { ComponentStory, ComponentMeta } from "@storybook/react";
18 | import { AddNode } from ".";
19 |
20 | export default {
21 | title: "organisms/Add Node",
22 | component: AddNode,
23 | } as ComponentMeta;
24 |
25 | const Template: ComponentStory = (args) => {
26 | return ;
27 | };
28 |
29 | export const Default = Template.bind({});
30 | Default.args = {
31 | isLoading: false,
32 | onSubmit: (values) => console.log(values),
33 | showTitle: true,
34 | };
35 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/AddNode/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./AddNode";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/AddPaymentMethod/AddPaymentMethod.stories.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import type { ComponentStory, ComponentMeta } from "@storybook/react";
18 | import { AddPaymentMethod } from ".";
19 |
20 | export default {
21 | title: "organisms/Add Payment Method",
22 | component: AddPaymentMethod,
23 | } as ComponentMeta;
24 |
25 | const Template: ComponentStory = () => {
26 | return ;
27 | };
28 |
29 | export const Default = Template.bind({});
30 | Default.args = {};
31 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/AddPaymentMethod/AddPaymentMethod.test.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { describe, expect, it } from "vitest";
18 | import { render } from "@testing-library/react";
19 | import { AddPaymentMethod } from ".";
20 |
21 | describe("organisms::AddPaymentMethod", () => {
22 | it("renders without exploding", () => {
23 | const { asFragment } = render();
24 | expect(asFragment()).toMatchSnapshot();
25 | });
26 | });
27 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/AddPaymentMethod/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./AddPaymentMethod";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/ChangePassword/ChangePassword.stories.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import type { ComponentStory, ComponentMeta } from "@storybook/react";
18 | import { ChangePassword } from ".";
19 |
20 | export default {
21 | title: "organisms/Change Password",
22 | component: ChangePassword,
23 | } as ComponentMeta;
24 |
25 | const Template: ComponentStory = () => {
26 | return ;
27 | };
28 |
29 | export const Default = Template.bind({});
30 | Default.args = {};
31 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/ChangePassword/_types.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export interface ChangePasswordFormValues {
18 | currentPassword: string;
19 | newPassword: string;
20 | confirmPassword: string;
21 | }
22 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/ChangePassword/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./ChangePassword";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/MarketOffersFilterAccountsForm/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./MarketOffersFilterAccountsForm";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/MarketOffersFilterAmountForm/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./MarketOffersFilterAmountForm";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/MarketOffersFilterBar/MarketOffersFilterBar.stories.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import type { ComponentStory, ComponentMeta } from "@storybook/react";
18 | import { MarketOffersFilterBar } from ".";
19 |
20 | export default {
21 | title: "organisms/MarketOffersFilterBar",
22 | component: MarketOffersFilterBar,
23 | } as ComponentMeta;
24 |
25 | const Template: ComponentStory = () => {
26 | return ;
27 | };
28 |
29 | export const Default = Template.bind({});
30 | Default.args = {};
31 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/MarketOffersFilterBar/hooks/index.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./useMarketOffersPairModal";
18 | export * from "./useMarketOffersPaymentMethods";
19 | export * from "./useMarketOffersAccountModal";
20 | export * from "./useMarketOffersAmountModal";
21 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/MarketOffersFilterBar/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./MarketOffersFilterBar";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/MarketOffersFilterPaymentMethods/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./MarketOffersFilterPaymentMethods";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/MarketOffersPaymentMethodsTable/_types.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export interface TMarketOfferPaymentMethod {
18 | methodChecked?: boolean;
19 | methodName: string;
20 | methodKey: string;
21 | rateTradeLimit: number;
22 | rateTradeLimitCurrency: string;
23 | info: string;
24 | }
25 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/MarketOffersPaymentMethodsTable/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./MarketOffersPaymentMethodsTable";
18 | export type { TMarketOfferPaymentMethod } from "./_types";
19 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/MarketOffersTable/_types.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export interface MarketOffer {
18 | price: number;
19 | priceComparison: number;
20 | priceCurrency: string;
21 | amount: number;
22 | amountCurrency: string;
23 | cost: number;
24 | costCurrency: string;
25 | paymentMethod: string;
26 | accountAge: number;
27 | accountTrades: number;
28 | }
29 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/MarketOffersTable/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./MarketOffersTable";
18 | export * from "./_types";
19 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/MarketOffersTradingPair/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./MarketOffersTradingPair";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/MarketOffersTradingPairTable/_types.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { createTable } from "@tanstack/react-table";
18 |
19 | export interface TMarketOffersTradingPair {
20 | fromPair: string;
21 | toPair: string;
22 | lastPrice: number;
23 | lastPriceCurrency: string;
24 | dayChangeRate: number;
25 | dayChangeVolume: number;
26 | }
27 |
28 | export const marketTradingPairTable =
29 | createTable().setRowType();
30 |
31 | export type TMarketTradingPairTable = typeof marketTradingPairTable.generics;
32 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/MarketOffersTradingPairTable/_utils.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import type { TMarketOffersTradingPair } from "./_types";
18 |
19 | export const pairColumnAccessor = (row: TMarketOffersTradingPair): string =>
20 | `${row.fromPair}/${row.toPair}`;
21 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/MarketOffersTradingPairTable/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./MarketOffersTradingPairTable";
18 | export type {
19 | TMarketOffersTradingPair,
20 | TMarketTradingPairTable,
21 | } from "./_types";
22 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/MarketsOffers/MarketsOffers.stories.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import type { ComponentStory, ComponentMeta } from "@storybook/react";
18 | import { MarketsOffers } from "./MarketsOffers";
19 |
20 | export default {
21 | title: "organisms/MarketsOffers",
22 | component: MarketsOffers,
23 | } as ComponentMeta;
24 |
25 | const Template: ComponentStory = () => {
26 | return ;
27 | };
28 |
29 | export const Default = Template.bind({});
30 |
31 | Default.args = {};
32 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/MarketsOffers/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./MarketsOffers";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/MoneroBalance/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./MoneroBalance";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/MyWalletMoneroBalance/MyWalletMoneroBalance.stories.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import type { ComponentStory, ComponentMeta } from "@storybook/react";
18 | import { MyWalletMoneroBalance } from "./MyWalletMeneroBalance";
19 |
20 | export default {
21 | title: "organisms/MyWalletMoneroBalance",
22 | component: MyWalletMoneroBalance,
23 | } as ComponentMeta;
24 |
25 | const Template: ComponentStory = () => {
26 | return ;
27 | };
28 |
29 | export const Default = Template.bind({});
30 |
31 | Default.args = {};
32 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/MyWalletMoneroBalance/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./MyWalletMeneroBalance";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/MyWalletPrimaryAddress/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./MyWalletPrimaryAddress";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/MyWalletReceive/MyWalletReceive.stories.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import type { ComponentStory, ComponentMeta } from "@storybook/react";
18 | import { MyWalletReceive } from "./MyWalletReceive";
19 |
20 | export default {
21 | title: "organisms/MyWalletReceive",
22 | component: MyWalletReceive,
23 | } as ComponentMeta;
24 |
25 | const Template: ComponentStory = () => {
26 | return ;
27 | };
28 |
29 | export const Default = Template.bind({});
30 | Default.args = {};
31 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/MyWalletReceive/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./MyWalletReceive";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/MyWalletSendForm/MyWalletSendForm.stories.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import type { ComponentStory, ComponentMeta } from "@storybook/react";
18 | import { MyWalletSendForm } from "./MyWalletSendForm";
19 |
20 | export default {
21 | title: "organisms/MyWalletSendForm",
22 | component: MyWalletSendForm,
23 | } as ComponentMeta;
24 |
25 | const Template: ComponentStory = () => {
26 | return ;
27 | };
28 |
29 | export const Default = Template.bind({});
30 | Default.args = {};
31 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/MyWalletSendForm/_hooks.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import * as Joi from "joi";
18 |
19 | export interface MyWalletSendFormValues {
20 | amount: string;
21 | address: string;
22 | paymentId: string;
23 | }
24 |
25 | export function useMyWalletSendFormValidation() {
26 | return Joi.object({
27 | amount: Joi.number().required(),
28 | address: Joi.string().required(),
29 | paymentId: Joi.string().optional().empty(""),
30 | });
31 | }
32 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/MyWalletSendForm/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./MyWalletSendForm";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/Navbar/Navbar.stories.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { Stack } from "@mantine/core";
18 | import type { ComponentStory, ComponentMeta } from "@storybook/react";
19 | import { Navbar } from ".";
20 |
21 | export default {
22 | title: "organisms/Navbar",
23 | component: Navbar,
24 | } as ComponentMeta;
25 |
26 | const Template: ComponentStory = () => {
27 | return (
28 |
29 |
30 |
31 | );
32 | };
33 |
34 | export const Default = Template.bind({});
35 |
36 | Default.args = {};
37 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/Navbar/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./Navbar";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/PaymentMethodList/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./PaymentMethodList";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/SelectMoneroNode/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./SelectMoneroNode";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/SetPassword/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./SetPassword";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/SetPrimaryFiat/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./SetPrimaryFiat";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/WalletManagement/WalletManagement.stories.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import type { ComponentStory, ComponentMeta } from "@storybook/react";
18 | import { WalletManagement } from ".";
19 |
20 | export default {
21 | title: "organisms/Wallet Management",
22 | component: WalletManagement,
23 | } as ComponentMeta;
24 |
25 | const Template: ComponentStory = () => {
26 | return ;
27 | };
28 |
29 | export const Default = Template.bind({});
30 | Default.args = {};
31 |
--------------------------------------------------------------------------------
/packages/renderer/src/components/organisms/WalletManagement/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./WalletManagement";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/constants/haveno-daemon.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export const HAVENO_DAEMON_URL =
18 | import.meta.env.VITE_HAVENO_URL ?? "http://localhost:8080";
19 | export const HAVENO_DAEMON_PASSWORD =
20 | import.meta.env.VITE_HAVENO_PASSWORD ?? "apitest";
21 |
--------------------------------------------------------------------------------
/packages/renderer/src/constants/lang/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./LangKeys";
18 | import en from "./en";
19 | import es from "./es";
20 |
21 | export const SupportedLocales = {
22 | EN: "en",
23 | ES: "es",
24 | };
25 |
26 | export const LangPack = {
27 | [SupportedLocales.EN]: en,
28 | [SupportedLocales.ES]: es,
29 | };
30 |
--------------------------------------------------------------------------------
/packages/renderer/src/constants/modals.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export enum Modals {
18 | QRCodeAddress = "QRCodeAddress",
19 | }
20 |
--------------------------------------------------------------------------------
/packages/renderer/src/constants/notifications.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export enum Notifications {
18 | AccountRestoring = "AccountRestoring",
19 | MoneroRestartAfterRestoring = "MoneroRestartAfterRestoring",
20 | }
21 |
--------------------------------------------------------------------------------
/packages/renderer/src/constants/sync-status.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export enum SyncStatus {
18 | Full = "Fully Synced",
19 | InProgress = "Syncing",
20 | NotSynced = "Not Synced",
21 | }
22 |
--------------------------------------------------------------------------------
/packages/renderer/src/hooks/haveno/useAddress.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { useQuery } from "react-query";
18 | import { useHavenoClient } from "./useHavenoClient";
19 | import { QueryKeys } from "@constants/query-keys";
20 |
21 | export function useAddress() {
22 | const client = useHavenoClient();
23 | return useQuery(QueryKeys.PrimaryAddress, async () =>
24 | client.getXmrPrimaryAddress()
25 | );
26 | }
27 |
--------------------------------------------------------------------------------
/packages/renderer/src/hooks/haveno/useCreateAccount.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { useMutation } from "react-query";
18 | import { useHavenoClient } from "./useHavenoClient";
19 |
20 | interface Variables {
21 | password: string;
22 | }
23 |
24 | export function useCreateAccount() {
25 | const client = useHavenoClient();
26 | return useMutation(async (variables: Variables) =>
27 | client.createAccount(variables.password)
28 | );
29 | }
30 |
--------------------------------------------------------------------------------
/packages/renderer/src/hooks/haveno/useGetMoneroConnection.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { useQuery } from "react-query";
18 | import { useHavenoClient } from "./useHavenoClient";
19 | import { QueryKeys } from "@constants/query-keys";
20 |
21 | export function useGetMoneroConnection() {
22 | const client = useHavenoClient();
23 | return useQuery(QueryKeys.MoneroConnection, async () =>
24 | client.getMoneroConnection()
25 | );
26 | }
27 |
--------------------------------------------------------------------------------
/packages/renderer/src/hooks/haveno/useHavenoClient.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { useRef } from "react";
18 | import { HavenoClient } from "haveno-ts";
19 | import {
20 | HAVENO_DAEMON_PASSWORD,
21 | HAVENO_DAEMON_URL,
22 | } from "@constants/haveno-daemon";
23 |
24 | let havenoClient: HavenoClient;
25 |
26 | export function useHavenoClient() {
27 | const client = useRef(havenoClient);
28 | if (!client.current) {
29 | client.current = havenoClient = new HavenoClient(
30 | HAVENO_DAEMON_URL,
31 | HAVENO_DAEMON_PASSWORD
32 | );
33 | }
34 | return client.current;
35 | }
36 |
--------------------------------------------------------------------------------
/packages/renderer/src/hooks/haveno/useHavenoVersion.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { useQuery } from "react-query";
18 | import { useHavenoClient } from "./useHavenoClient";
19 | import { QueryKeys } from "@constants/query-keys";
20 |
21 | export function useHavenoVersion() {
22 | const client = useHavenoClient();
23 | return useQuery(QueryKeys.HavenoVersion, async () => client.getVersion());
24 | }
25 |
--------------------------------------------------------------------------------
/packages/renderer/src/hooks/haveno/useMoneroNodeSettings.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { useQuery } from "react-query";
18 | import type { MoneroNodeSettings } from "haveno-ts";
19 | import { useHavenoClient } from "./useHavenoClient";
20 | import { QueryKeys } from "@constants/query-keys";
21 |
22 | export function useMoneroNodeSettings() {
23 | const client = useHavenoClient();
24 | return useQuery(
25 | QueryKeys.MoneroNodeSettings,
26 | async () => client.getMoneroNodeSettings()
27 | );
28 | }
29 |
--------------------------------------------------------------------------------
/packages/renderer/src/hooks/haveno/usePrices.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { useQuery } from "react-query";
18 | import type { MarketPriceInfo } from "haveno-ts";
19 | import { useHavenoClient } from "./useHavenoClient";
20 | import { QueryKeys } from "@constants/query-keys";
21 |
22 | export function usePrices() {
23 | const client = useHavenoClient();
24 | return useQuery, Error>(
25 | QueryKeys.Prices,
26 | async () => {
27 | const prices = await client.getPrices();
28 | return prices.map((price) => price.toObject());
29 | }
30 | );
31 | }
32 |
--------------------------------------------------------------------------------
/packages/renderer/src/hooks/haveno/useSetDownloadQRCode.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { useMutation } from "react-query";
18 |
19 | export function useSetDownloadQRCode() {
20 | return useMutation(async (code: string) => {
21 | await window.haveno.downloadQRCode(code);
22 | });
23 | }
24 |
--------------------------------------------------------------------------------
/packages/renderer/src/hooks/haveno/useSetXmrNewSubaddress.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { useMutation } from "react-query";
18 | import { useHavenoClient } from "./useHavenoClient";
19 |
20 | export function useSetXmrNewSubaddress() {
21 | const client = useHavenoClient();
22 |
23 | return useMutation(async () => {
24 | return client.getXmrNewSubaddress();
25 | });
26 | }
27 |
--------------------------------------------------------------------------------
/packages/renderer/src/hooks/haveno/useStopMoneroNode.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { useMutation, useQueryClient } from "react-query";
18 | import { useHavenoClient } from "./useHavenoClient";
19 | import { QueryKeys } from "@constants/query-keys";
20 |
21 | export function useStopMoneroNode() {
22 | const queryClient = useQueryClient();
23 | const client = useHavenoClient();
24 |
25 | return useMutation(async () => client.stopMoneroNode(), {
26 | onSuccess: () => {
27 | queryClient.invalidateQueries(QueryKeys.MoneroNodeIsRunning);
28 | },
29 | });
30 | }
31 |
--------------------------------------------------------------------------------
/packages/renderer/src/hooks/haveno/useSyncStatus.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { useQuery } from "react-query";
18 | import { QueryKeys } from "@constants/query-keys";
19 | import { SyncStatus } from "@constants/sync-status";
20 | // import { useHavenoClient } from "./useHavenoClient";
21 |
22 | export function useSyncStatus() {
23 | // const client = useHavenoClient();
24 | return useQuery(
25 | QueryKeys.SyncStatus,
26 | async () => {
27 | // TODO: this is a stub
28 | return SyncStatus.NotSynced;
29 | },
30 | {
31 | staleTime: 10_000,
32 | }
33 | );
34 | }
35 |
--------------------------------------------------------------------------------
/packages/renderer/src/hooks/haveno/useXmrPrimaryAddress.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { useQuery } from "react-query";
18 | import { useHavenoClient } from "./useHavenoClient";
19 | import { QueryKeys } from "@constants/query-keys";
20 |
21 | export const useXmrPrimaryAddress = () => {
22 | const client = useHavenoClient();
23 |
24 | return useQuery(QueryKeys.XmrPrimaryAddress, async () =>
25 | client.getXmrPrimaryAddress()
26 | );
27 | };
28 |
--------------------------------------------------------------------------------
/packages/renderer/src/hooks/haveno/useXmrSeed.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { useQuery } from "react-query";
18 | import { useHavenoClient } from "./useHavenoClient";
19 | import { QueryKeys } from "@constants/query-keys";
20 |
21 | export function useXmrSeed() {
22 | const client = useHavenoClient();
23 | return useQuery(QueryKeys.XmrSeed, async () => {
24 | return client.getXmrSeed();
25 | });
26 | }
27 |
--------------------------------------------------------------------------------
/packages/renderer/src/hooks/haveno/useXmrTxs.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { useQuery } from "react-query";
18 | import type { XmrTx } from "haveno-ts";
19 | import { useHavenoClient } from "./useHavenoClient";
20 | import { QueryKeys } from "@constants/query-keys";
21 |
22 | export const useXmrTxs = () => {
23 | const client = useHavenoClient();
24 |
25 | return useQuery>(QueryKeys.XmrTxs, async () => {
26 | const txs = await client.getXmrTxs();
27 |
28 | return txs?.map((tx) => tx.toObject());
29 | });
30 | };
31 |
--------------------------------------------------------------------------------
/packages/renderer/src/hooks/session/useAuth.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { useQuery } from "react-query";
18 | import { QueryKeys } from "@constants/query-keys";
19 | import { validateSession } from "@utils/session";
20 |
21 | export function useAuth() {
22 | return useQuery(
23 | QueryKeys.AuthSession,
24 | async () => {
25 | if (await validateSession()) {
26 | return true;
27 | }
28 | return false;
29 | },
30 | {
31 | staleTime: 60000,
32 | retry: false,
33 | }
34 | );
35 | }
36 |
--------------------------------------------------------------------------------
/packages/renderer/src/hooks/session/useLogin.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { useMutation } from "react-query";
18 | import { createSession } from "@src/utils/session";
19 |
20 | interface Variables {
21 | password: string;
22 | }
23 |
24 | export function useLogin() {
25 | return useMutation(async (variables: Variables) => {
26 | const authToken = await window.electronStore.verifyPassword(
27 | variables.password
28 | );
29 | if (!authToken) {
30 | throw new Error("Invalid password");
31 | }
32 | createSession(authToken);
33 | });
34 | }
35 |
--------------------------------------------------------------------------------
/packages/renderer/src/hooks/storage/useAccountInfo.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { useQuery } from "react-query";
18 | import { QueryKeys } from "@constants/query-keys";
19 | import type { AccountInfoDto } from "@src/types";
20 |
21 | export function useAccountInfo() {
22 | return useQuery(
23 | QueryKeys.StorageAccountInfo,
24 | async () => window.electronStore.getAccountInfo()
25 | );
26 | }
27 |
--------------------------------------------------------------------------------
/packages/renderer/src/hooks/storage/useIsLocalNodeSelected.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { useEffect, useState } from "react";
18 | import { usePreferences } from "./usePreferences";
19 |
20 | export function useIsLocalNodeSelected() {
21 | const [data, setData] = useState(false);
22 | const { data: preferences, ...rest } = usePreferences();
23 | useEffect(() => {
24 | setData(!preferences?.selectedNode);
25 | }, [preferences]);
26 | return { data, ...rest };
27 | }
28 |
--------------------------------------------------------------------------------
/packages/renderer/src/hooks/storage/usePreferences.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { useQuery } from "react-query";
18 | import { QueryKeys } from "@constants/query-keys";
19 | import type { IPreferences } from "@src/types";
20 |
21 | export function usePreferences() {
22 | return useQuery(QueryKeys.StoragePreferences, async () =>
23 | window.electronStore.getPreferences()
24 | );
25 | }
26 |
--------------------------------------------------------------------------------
/packages/renderer/src/index.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { StrictMode } from "react";
18 | import ReactDOM from "react-dom";
19 | import { AppRoutes } from "./Routes";
20 | import { AppProviders } from "@atoms/AppProviders";
21 |
22 | ReactDOM.render(
23 |
24 |
25 |
26 |
27 | ,
28 | document.getElementById("app")
29 | );
30 |
--------------------------------------------------------------------------------
/packages/renderer/src/pages/Account/AddPaymentAccount.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { AddPaymentMethod as AddPaymentMethodOrganism } from "@organisms/AddPaymentMethod";
18 | import { AccountLayout } from "@templates/AccountLayout";
19 |
20 | export function AddPaymentAccount() {
21 | return (
22 |
23 |
24 |
25 | );
26 | }
27 |
--------------------------------------------------------------------------------
/packages/renderer/src/pages/Account/PaymentAccounts.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { useNavigate } from "react-router-dom";
18 | import { ROUTES } from "@constants/routes";
19 | import { PaymentMethodList } from "@organisms/PaymentMethodList";
20 | import { AccountLayout } from "@templates/AccountLayout";
21 |
22 | export function PaymentAccounts() {
23 | const navigate = useNavigate();
24 | return (
25 |
26 | navigate(ROUTES.AddPaymentAccount)} />
27 |
28 | );
29 | }
30 |
--------------------------------------------------------------------------------
/packages/renderer/src/pages/Account/PaymentMethods.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { useNavigate } from "react-router-dom";
18 | import { PaymentMethodList } from "@organisms/PaymentMethodList";
19 | import { NavbarLayout } from "@templates/NavbarLayout";
20 | import { ROUTES } from "@constants/routes";
21 |
22 | export function PaymentMethods() {
23 | const navigate = useNavigate();
24 |
25 | return (
26 |
27 | navigate(ROUTES.AddPaymentAccount)} />
28 |
29 | );
30 | }
31 |
--------------------------------------------------------------------------------
/packages/renderer/src/pages/Account/Settings/_hooks.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import Joi from "joi";
18 | import type { LocalSettingsFormValues } from "./_types";
19 |
20 | export function useLocalSettingsValidation() {
21 | return Joi.object({
22 | blockchainLocation: Joi.string().empty("").uri({ relativeOnly: true }),
23 | startupFlags: Joi.string().empty(""),
24 | bootstrapUrl: Joi.string().allow("").uri({ allowRelative: false }),
25 | port: Joi.number().allow("").port(),
26 | });
27 | }
28 |
--------------------------------------------------------------------------------
/packages/renderer/src/pages/Account/Settings/_types.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export interface LocalSettingsFormValues {
18 | blockchainLocation: string;
19 | startupFlags: string;
20 | bootstrapUrl: string;
21 | port: string;
22 | }
23 |
--------------------------------------------------------------------------------
/packages/renderer/src/pages/Account/Settings/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./Settings";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/pages/Account/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./AddPaymentAccount";
18 | export * from "./PaymentMethods";
19 | export * from "./Settings";
20 | export * from "./PaymentAccounts";
21 | export * from "./Security";
22 | export * from "./Wallet";
23 | export * from "./AccountBackup";
24 |
--------------------------------------------------------------------------------
/packages/renderer/src/pages/Home/Home.stories.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import type { ComponentStory, ComponentMeta } from "@storybook/react";
18 | import { Home } from ".";
19 |
20 | export default {
21 | title: "pages/Home",
22 | component: Home,
23 | } as ComponentMeta;
24 |
25 | const Template: ComponentStory = () => {
26 | return ;
27 | };
28 |
29 | export const Default = Template.bind({});
30 | Default.args = {};
31 |
--------------------------------------------------------------------------------
/packages/renderer/src/pages/Home/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./Home";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/pages/Login/Login.stories.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import type { ComponentStory, ComponentMeta } from "@storybook/react";
18 | import { Login } from ".";
19 |
20 | export default {
21 | title: "pages/Login",
22 | component: Login,
23 | } as ComponentMeta;
24 |
25 | const Template: ComponentStory = () => {
26 | return ;
27 | };
28 |
29 | export const Default = Template.bind({});
30 | Default.args = {};
31 |
--------------------------------------------------------------------------------
/packages/renderer/src/pages/Login/_constants.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export const CONTENT_MAX_WIDTH = 470;
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/pages/Login/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./Login";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/pages/Markets/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./MarketsOffers";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/pages/MyWallet/MyWallet.stories.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import { Stack } from "@mantine/core";
18 | import type { ComponentStory, ComponentMeta } from "@storybook/react";
19 | import { MyWallet } from "./MyWallet";
20 |
21 | export default {
22 | title: "pages/MyWallet",
23 | component: MyWallet,
24 | } as ComponentMeta;
25 |
26 | const Template: ComponentStory = () => {
27 | return (
28 |
29 |
30 |
31 | );
32 | };
33 |
34 | export const Default = Template.bind({});
35 |
36 | Default.args = {};
37 |
--------------------------------------------------------------------------------
/packages/renderer/src/pages/MyWallet/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./MyWallet";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/pages/Onboarding/ConnectingMonero.stories.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import type { ComponentStory, ComponentMeta } from "@storybook/react";
18 | import { ConnectingMonero } from ".";
19 |
20 | export default {
21 | title: "pages/Onboarding/Connecting Monero",
22 | component: ConnectingMonero,
23 | } as ComponentMeta;
24 |
25 | const Template: ComponentStory = () => {
26 | return ;
27 | };
28 |
29 | export const Default = Template.bind({});
30 | Default.args = {};
31 |
--------------------------------------------------------------------------------
/packages/renderer/src/pages/Onboarding/CreateAccount.stories.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import type { ComponentStory, ComponentMeta } from "@storybook/react";
18 | import { CreateAccount } from ".";
19 |
20 | export default {
21 | title: "pages/Onboarding/Create Account",
22 | component: CreateAccount,
23 | } as ComponentMeta;
24 |
25 | const Template: ComponentStory = () => {
26 | return ;
27 | };
28 |
29 | export const Default = Template.bind({});
30 | Default.args = {};
31 |
--------------------------------------------------------------------------------
/packages/renderer/src/pages/Onboarding/Welcome.stories.tsx:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import type { ComponentStory, ComponentMeta } from "@storybook/react";
18 | import { Welcome } from ".";
19 |
20 | export default {
21 | title: "pages/Onboarding/Welcome",
22 | component: Welcome,
23 | } as ComponentMeta;
24 |
25 | const Template: ComponentStory = () => {
26 | return ;
27 | };
28 |
29 | export const Default = Template.bind({});
30 | Default.args = {};
31 |
--------------------------------------------------------------------------------
/packages/renderer/src/pages/Onboarding/_constants.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export const CONTENT_MAX_WIDTH = 470;
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/pages/Onboarding/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./ConnectingMonero";
18 | export * from "./CreateAccount";
19 | export * from "./Welcome";
20 |
--------------------------------------------------------------------------------
/packages/renderer/src/state/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haveno-dex/haveno-ui/1cd1ecfe6b65ece5462383de6ebf4b51cb92b830/packages/renderer/src/state/.gitkeep
--------------------------------------------------------------------------------
/packages/renderer/src/theme/global-styles.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | import type { CSSObject } from "@emotion/react";
18 | import InterFont from "@assets/fonts/Inter-Variable.ttf";
19 |
20 | export const globalStyles: CSSObject = {
21 | "@font-face": {
22 | fontFamily: "Inter",
23 | src: `url('${InterFont}')`,
24 | fontWeight: "100 800",
25 | fontStyle: "normal italic",
26 | },
27 | "*, *::before, *::after": {
28 | boxSizing: "border-box",
29 | },
30 | body: {
31 | margin: 0,
32 | padding: 0,
33 | },
34 | "#app": {
35 | display: "flex",
36 | minHeight: "100vh",
37 | },
38 | };
39 |
--------------------------------------------------------------------------------
/packages/renderer/src/theme/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "./global-styles";
18 | export * from "./override";
19 |
--------------------------------------------------------------------------------
/packages/renderer/src/types/index.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export * from "../../../main/src/types/store";
18 |
--------------------------------------------------------------------------------
/packages/renderer/src/utils/getIpcError.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | const REGEX = /\[\[(.+)\]\]/;
18 |
19 | export function getIpcError(err: Error, fallback?: string) {
20 | const message = err?.message;
21 | if (message && REGEX.test(message)) {
22 | const matches = message.match(REGEX);
23 | if (matches && matches[1] && matches[1].length) {
24 | return matches[1];
25 | }
26 | const index = message.lastIndexOf("Error:");
27 | return index !== -1
28 | ? message.slice(index + 6)
29 | : fallback ?? "Something went wrong";
30 | }
31 | return fallback ?? "Something went wrong";
32 | }
33 |
--------------------------------------------------------------------------------
/packages/renderer/src/utils/math.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export const fractionToPercent = (value: number) => {
18 | return value * 100;
19 | };
20 |
--------------------------------------------------------------------------------
/packages/renderer/src/utils/session.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | const SESSION_KEY = "AUTH_TOKEN";
18 |
19 | export async function createSession(authToken: string) {
20 | window.sessionStorage.setItem(SESSION_KEY, authToken);
21 | }
22 |
23 | export async function validateSession(): Promise {
24 | const token = window.sessionStorage.getItem(SESSION_KEY);
25 | if (!token) {
26 | return false;
27 | }
28 | return window.electronStore.verifyAuthToken(token);
29 | }
30 |
31 | export async function deleteSession() {
32 | window.sessionStorage.removeItem(SESSION_KEY);
33 | }
34 |
--------------------------------------------------------------------------------
/packages/renderer/tests/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haveno-dex/haveno-ui/1cd1ecfe6b65ece5462383de6ebf4b51cb92b830/packages/renderer/tests/.gitkeep
--------------------------------------------------------------------------------
/packages/renderer/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "esnext",
4 | "target": "esnext",
5 | "sourceMap": false,
6 | "moduleResolution": "Node",
7 | "skipLibCheck": true,
8 | "strict": true,
9 | "isolatedModules": true,
10 | "types": ["node", "vite-plugin-svgr/client"],
11 | "jsx": "react-jsx",
12 | "allowSyntheticDefaultImports": true,
13 | "esModuleInterop": true,
14 | "baseUrl": "./src",
15 | "paths": {
16 | "@assets/*": ["../assets/*"],
17 | "@atoms/*": ["components/atoms/*"],
18 | "@constants/*": ["constants/*"],
19 | "@hooks/*": ["hooks/*"],
20 | "@molecules/*": ["components/molecules/*"],
21 | "@organisms/*": ["components/organisms/*"],
22 | "@pages/*": ["pages/*"],
23 | "@src/*": ["./*"],
24 | "@templates/*": ["components/templates/*"],
25 | "@utils/*": ["utils/*"]
26 | },
27 | "lib": ["ESNext", "dom", "dom.iterable"]
28 | },
29 |
30 | "include": [
31 | "src/**/*.ts",
32 | "src/**/*.tsx",
33 | "types/**/*.d.ts",
34 | "../../types/**/*.d.ts",
35 | "../preload/contracts.d.ts",
36 | "../../tests/setup-tests.ts",
37 | "../../tests/global-setup.ts"
38 | ],
39 | "exclude": ["**/*.spec.ts", "**/*.test.ts"]
40 | }
41 |
--------------------------------------------------------------------------------
/packages/renderer/types/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/haveno-dex/haveno-ui/1cd1ecfe6b65ece5462383de6ebf4b51cb92b830/packages/renderer/types/.gitkeep
--------------------------------------------------------------------------------
/tests/global-setup.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | export default function () {
18 | process.env.TZ = "UTC";
19 | }
20 |
--------------------------------------------------------------------------------
/tests/setup-tests.ts:
--------------------------------------------------------------------------------
1 | // =============================================================================
2 | // Copyright 2022 Haveno
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | // =============================================================================
16 |
17 | /* eslint-disable @typescript-eslint/no-namespace,@typescript-eslint/no-explicit-any */
18 | import { expect } from "vitest";
19 | import matchers from "@testing-library/jest-dom/matchers";
20 | import type { TestingLibraryMatchers } from "@testing-library/jest-dom/matchers";
21 |
22 | declare global {
23 | namespace Vi {
24 | interface JestAssertion
25 | extends jest.Matchers,
26 | TestingLibraryMatchers {}
27 | }
28 | }
29 |
30 | expect.extend(matchers);
31 |
--------------------------------------------------------------------------------