Skip to content

Commit bca4ba0

Browse files
committed
Use absolute import in Explorer
This is allowed by configuring them in the `jsconfig.json` file.
1 parent 9c7cc1d commit bca4ba0

File tree

33 files changed

+121
-113
lines changed

33 files changed

+121
-113
lines changed

mithril-explorer/__tests__/AggregatorSetter.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { render, screen } from "@testing-library/react";
22
import "@testing-library/jest-dom";
3-
import AggregatorSetter from "../src/components/AggregatorSetter";
43
import { initStore } from "./helpers";
54
import { Provider } from "react-redux";
6-
import default_available_aggregators from "../src/aggregators-list";
7-
import { settingsSlice } from "../src/store/settingsSlice";
5+
import AggregatorSetter from "#/AggregatorSetter";
6+
import default_available_aggregators from "@/aggregators-list";
7+
import { settingsSlice } from "@/store/settingsSlice";
88

99
function renderAggregatorSetter(default_state = undefined) {
1010
const store = initStore(default_state);

mithril-explorer/__tests__/CardanoTransactionsFormInput.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { fireEvent, render, screen } from "@testing-library/react";
22
import "@testing-library/jest-dom";
3-
import CardanoTransactionsFormInput from "../src/components/CardanoTransactionsFormInput";
3+
import CardanoTransactionsFormInput from "#/CardanoTransactionsFormInput";
44

55
function setup() {
66
const utils = [render(<CardanoTransactionsFormInput />)];

mithril-explorer/__tests__/PoolTicker.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { render, screen } from "@testing-library/react";
22
import "@testing-library/jest-dom";
33
import { initStore } from "./helpers";
44
import { Provider } from "react-redux";
5-
import { poolsSlice } from "../src/store/poolsSlice";
6-
import PoolTicker from "../src/components/PoolTicker";
7-
import { getCExplorerUrl } from "../src/utils";
8-
import { settingsSlice } from "../src/store/settingsSlice";
5+
import PoolTicker from "#/PoolTicker";
6+
import { settingsSlice } from "@/store/settingsSlice";
7+
import { poolsSlice } from "@/store/poolsSlice";
8+
import { getCExplorerUrl } from "@/utils";
99

1010
function renderPoolTickerComponent(partyId, default_state = undefined) {
1111
const store = initStore(default_state);

mithril-explorer/__tests__/TransactionCertificationBreadcrumb.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { render, screen } from "@testing-library/react";
22
import "@testing-library/jest-dom";
3-
import TransactionCertificationBreadcrumb from "../src/components/CertifyCardanoTransactionsModal/TransactionCertificationBreadcrumb";
4-
import { validationSteps } from "../src/components/CertifyCardanoTransactionsModal";
3+
import TransactionCertificationBreadcrumb from "#/CertifyCardanoTransactionsModal/TransactionCertificationBreadcrumb";
4+
import { validationSteps } from "#/CertifyCardanoTransactionsModal";
55

66
function setup(currentStep, isProofValid, isCertificateChainValid) {
77
const utils = [

mithril-explorer/__tests__/helpers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { saveToLocalStorage, storeBuilder } from "../src/store/store";
1+
import { saveToLocalStorage, storeBuilder } from "@/store/store";
22
import * as mockRouter from "next-router-mock";
33

44
const baseLocation = "http://localhost";

mithril-explorer/__tests__/partyIdFormat.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { formatPartyId } from "../src/utils";
1+
import { formatPartyId } from "@/utils";
22

33
describe("Stake formatting", () => {
44
it.each([

mithril-explorer/__tests__/stakeFormat.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { formatStake } from "../src/utils";
1+
import { formatStake } from "@/utils";
22

33
const toLovelace = (ada) => ada * 1000000;
44

mithril-explorer/__tests__/store.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import default_available_aggregators from "../src/aggregators-list";
2-
import { signedEntityType } from "../src/constants";
3-
import { poolsSlice } from "../src/store/poolsSlice";
1+
import default_available_aggregators from "@/aggregators-list";
2+
import { signedEntityType } from "@/constants";
3+
import { poolsSlice } from "@/store/poolsSlice";
44
import {
55
removeSelectedAggregator,
66
selectAggregator,
77
settingsSlice,
88
setUpdateInterval,
99
toggleAutoUpdate,
10-
} from "../src/store/settingsSlice";
11-
import { saveToLocalStorage, storeBuilder } from "../src/store/store";
10+
} from "@/store/settingsSlice";
11+
import { saveToLocalStorage, storeBuilder } from "@/store/store";
1212
import { waitFor } from "@testing-library/react";
1313
import { initStore } from "./helpers";
1414

mithril-explorer/jsconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"compilerOptions": {
3+
"paths": {
4+
"@/*": ["./src/*"],
5+
"#/*": ["./src/components/*"]
6+
}
7+
}
8+
}

mithril-explorer/src/app/layout.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import Image from "next/image";
2-
import { Providers } from "../store/provider";
2+
import Link from "next/link";
33
import React, { Suspense } from "react";
4-
import styles from "./explorer.module.css";
4+
import { Providers } from "@/store/provider";
55

66
// These styles apply to every route in the application
77
import "bootstrap/dist/css/bootstrap.min.css";
88
import "bootstrap-icons/font/bootstrap-icons.css";
99
import "./global.css";
1010
import "./mithril-icons.css";
11-
import Link from "next/link";
11+
12+
import styles from "./explorer.module.css";
1213

1314
export const metadata = {
1415
title: "Mithril Explorer",

0 commit comments

Comments
 (0)