diff --git a/batcher-ui/Dockerfile.ghostnet b/batcher-ui/Dockerfile.ghostnet index 990fbf10..cbdefdbf 100644 --- a/batcher-ui/Dockerfile.ghostnet +++ b/batcher-ui/Dockerfile.ghostnet @@ -9,14 +9,10 @@ COPY ./package.json ./ RUN npm install COPY ./tsconfig.json ./jsconfig.json ./ -COPY ./components ./components COPY ./pages ./pages -COPY ./contexts ./contexts -COPY ./utils ./utils COPY ./src ./src COPY ./styles ./styles COPY ./public ./public -COPY ./config ./config COPY ./postcss.config.js ./postcss.config.js COPY ./next.config.js ./next.config.js COPY ./tailwind.config.js ./tailwind.config.js diff --git a/batcher-ui/next.config.js b/batcher-ui/next.config.js index 5db0a35d..c2e43fff 100644 --- a/batcher-ui/next.config.js +++ b/batcher-ui/next.config.js @@ -1,9 +1,10 @@ /** @type {import('next').NextConfig} */ -const config = require('./config/env.ts'); +const config = require('./src/config/env.ts'); const env = process.env.ENV; // 'mainnet' | 'ghostnet' -console.log('🚀 ~ file: next.config.js:6 ~ env:', env); + +console.info('🚀 Current env:', env); const nextConfig = { reactStrictMode: false, diff --git a/batcher-ui/pages/_app.tsx b/batcher-ui/pages/_app.tsx index 8bc24bdd..584a92bc 100644 --- a/batcher-ui/pages/_app.tsx +++ b/batcher-ui/pages/_app.tsx @@ -1,13 +1,13 @@ -import Footer from '../components/Footer'; +import Footer from '../src/components/Footer'; import React, { useEffect, useState } from 'react'; import { AppProps } from 'next/app'; -import { TezosToolkitProvider } from '../contexts/tezos-toolkit'; -import { WalletProvider } from '../contexts/wallet'; -import { EventsProvider } from '../contexts/events'; +import { TezosToolkitProvider } from '../src/contexts/tezos-toolkit'; +import { WalletProvider } from '../src/contexts/wallet'; +import { EventsProvider } from '../src/contexts/events'; import '../styles/globals.css'; import { Provider } from 'react-redux'; import { store } from '../src/store'; -import NavBar from '../components/NavBar'; +import NavBar from '../src/components/NavBar'; import ReactGA from 'react-ga4'; import * as api from '@tzkt/sdk-api'; import Head from 'next/head'; @@ -59,4 +59,4 @@ const App = ({ Component }: AppProps) => { ); }; -export default App; \ No newline at end of file +export default App; diff --git a/batcher-ui/pages/holdings.tsx b/batcher-ui/pages/holdings.tsx index 156e3a96..f70dc545 100644 --- a/batcher-ui/pages/holdings.tsx +++ b/batcher-ui/pages/holdings.tsx @@ -1,5 +1,5 @@ import React, { useCallback, useContext, useEffect } from 'react'; -import { TezosToolkitContext } from 'contexts/tezos-toolkit'; +import { TezosToolkitContext } from 'src/contexts/tezos-toolkit'; import { useDispatch, useSelector } from 'react-redux'; import { getHoldings, userAddressSelector } from 'src/reducers'; import { getHoldings as getHoldingsAction } from 'src/actions'; diff --git a/batcher-ui/pages/index.tsx b/batcher-ui/pages/index.tsx index 585f82fe..cb31db4f 100644 --- a/batcher-ui/pages/index.tsx +++ b/batcher-ui/pages/index.tsx @@ -1,7 +1,7 @@ import React, { useEffect } from 'react'; -import Exchange from '../components/Exchange'; -import BatcherInfo from '../components/BatcherInfo'; -import PriceStrategy from '../components/PriceStrategy'; +import Exchange from '../src/components/Exchange'; +import BatcherInfo from '../src/components/BatcherInfo'; +import PriceStrategy from '../src/components/PriceStrategy'; import { useSelector, useDispatch } from 'react-redux'; import { userAddressSelector } from '../src/reducers'; diff --git a/batcher-ui/src/actions/wallet.ts b/batcher-ui/src/actions/wallet.ts index 0bcad226..c4aa9f95 100644 --- a/batcher-ui/src/actions/wallet.ts +++ b/batcher-ui/src/actions/wallet.ts @@ -1,5 +1,5 @@ // import { Option } from 'fp-ts/Option'; -import { Balances } from 'utils/utils'; +import { Balances } from 'src/utils/utils'; const connectedWallet = ({ userAddress }: { userAddress: string }) => ({ diff --git a/batcher-ui/src/commands/events.ts b/batcher-ui/src/commands/events.ts index 005d457a..bb26cabb 100644 --- a/batcher-ui/src/commands/events.ts +++ b/batcher-ui/src/commands/events.ts @@ -8,7 +8,7 @@ import { import { getHoldings } from 'src/actions/holdings'; import { currentSwapSelector, userAddressSelector } from 'src/reducers'; import { Batch, BigMapEvent, UpdateRateEvent } from 'src/types/events'; -import { computeOraclePrice, toVolumes } from 'utils/utils'; +import { computeOraclePrice, toVolumes } from 'src/utils/utils'; export const newEventCmd = (event: BigMapEvent) => { return Cmd.run( diff --git a/batcher-ui/src/commands/exchange.ts b/batcher-ui/src/commands/exchange.ts index bcad6810..fe7e5597 100644 --- a/batcher-ui/src/commands/exchange.ts +++ b/batcher-ui/src/commands/exchange.ts @@ -6,7 +6,7 @@ import { getCurrentRates, getPairsInformations, getVolumes, -} from '../../utils/utils'; +} from '../utils/utils'; import { updateBatchNumber, updateBatcherStatus, diff --git a/batcher-ui/src/commands/holdings.ts b/batcher-ui/src/commands/holdings.ts index ad5b78ac..5b225d0a 100644 --- a/batcher-ui/src/commands/holdings.ts +++ b/batcher-ui/src/commands/holdings.ts @@ -1,5 +1,5 @@ import { Cmd } from 'redux-loop'; -import { getOrdersBook } from '../../utils/utils'; +import { getOrdersBook } from '../utils/utils'; import { updateHoldings } from 'src/actions/holdings'; const fetchHoldingsCmd = (userAddress?: string) => { diff --git a/batcher-ui/src/commands/wallet.ts b/batcher-ui/src/commands/wallet.ts index 8a4ef079..dab5dcd1 100644 --- a/batcher-ui/src/commands/wallet.ts +++ b/batcher-ui/src/commands/wallet.ts @@ -1,5 +1,5 @@ import { Cmd } from 'redux-loop'; -import { scaleAmountDown, storeBalances } from '../../utils/utils'; +import { scaleAmountDown, storeBalances } from '../utils/utils'; import { gotUserBalances } from '../actions'; import * as api from '@tzkt/sdk-api'; diff --git a/batcher-ui/components/BatcherInfo.tsx b/batcher-ui/src/components/BatcherInfo.tsx similarity index 96% rename from batcher-ui/components/BatcherInfo.tsx rename to batcher-ui/src/components/BatcherInfo.tsx index 11d9420d..2adc7770 100644 --- a/batcher-ui/components/BatcherInfo.tsx +++ b/batcher-ui/src/components/BatcherInfo.tsx @@ -7,8 +7,8 @@ import { currentPairSelector, oraclePriceSelector, remainingTimeSelector, -} from '../src/reducers'; -import { BatcherStatus } from '../src/types'; +} from '../reducers'; +import { BatcherStatus } from '../types'; const BatcherInfo = () => { const tokenPair = useSelector(currentPairSelector); diff --git a/batcher-ui/components/BatcherStepper.tsx b/batcher-ui/src/components/BatcherStepper.tsx similarity index 94% rename from batcher-ui/components/BatcherStepper.tsx rename to batcher-ui/src/components/BatcherStepper.tsx index 58014e25..2e22853b 100644 --- a/batcher-ui/components/BatcherStepper.tsx +++ b/batcher-ui/src/components/BatcherStepper.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { useSelector } from 'react-redux'; -import { batcherStatusSelector } from '../src/reducers'; -import { BatcherStatus } from '../src/types'; +import { batcherStatusSelector } from '../reducers'; +import { BatcherStatus } from '../types'; const Square = ({ isActive }: { isActive: boolean }) => (