Skip to content

Commit

Permalink
🔥 move folders into src
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin Burg committed Sep 4, 2023
1 parent 7276f8a commit 224b6b2
Show file tree
Hide file tree
Showing 31 changed files with 36 additions and 44 deletions.
4 changes: 0 additions & 4 deletions batcher-ui/Dockerfile.ghostnet
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions batcher-ui/next.config.js
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
12 changes: 6 additions & 6 deletions batcher-ui/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -59,4 +59,4 @@ const App = ({ Component }: AppProps) => {
);
};

export default App;
export default App;
2 changes: 1 addition & 1 deletion batcher-ui/pages/holdings.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
6 changes: 3 additions & 3 deletions batcher-ui/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion batcher-ui/src/actions/wallet.ts
Original file line number Diff line number Diff line change
@@ -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 }) =>
({
Expand Down
2 changes: 1 addition & 1 deletion batcher-ui/src/commands/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion batcher-ui/src/commands/exchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
getCurrentRates,
getPairsInformations,
getVolumes,
} from '../../utils/utils';
} from '../utils/utils';
import {
updateBatchNumber,
updateBatcherStatus,
Expand Down
2 changes: 1 addition & 1 deletion batcher-ui/src/commands/holdings.ts
Original file line number Diff line number Diff line change
@@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion batcher-ui/src/commands/wallet.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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 }) => (
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import {
priceStrategySelector,
userAddressSelector,
userBalancesSelector,
} from '../src/reducers';
import { BatcherStatus, PriceStrategy } from '../src/types';
} from '../reducers';
import { BatcherStatus, PriceStrategy } from '../types';
import { useDispatch } from 'react-redux';
import { fetchUserBalances, reverseSwap } from 'src/actions';
import { fetchUserBalances, reverseSwap } from '../actions';
import * as Form from '@radix-ui/react-form';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faArrowRightArrowLeft } from '@fortawesome/free-solid-svg-icons';
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import LinkComponent from './Link';
import { useWallet } from 'contexts/wallet';
import { useWallet } from 'src/contexts/wallet';

interface MenuProps {
setIsMenuOpen(arg: boolean): void;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useEffect } from 'react';
import { useDispatch } from 'react-redux';
import Image from 'next/image';
import { connectedWallet, disconnectedWallet } from '.././src/actions';
import { useWallet } from '.././contexts/wallet';
import { connectedWallet, disconnectedWallet } from '../actions';
import { useWallet } from '../contexts/wallet';
import Menu from './Menu';
import LinkComponent from './Link';
import { faBars } from '@fortawesome/free-solid-svg-icons';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, { createContext, useEffect } from 'react';
import { useDispatch } from 'react-redux';
import { newEvent } from 'src/actions/events';
// import { userAddressSelector } from 'src/reducers';
import { setup /* subscribeTokenBalances */ } from 'utils/webSocketUtils';
import { setup /* subscribeTokenBalances */ } from 'src/utils/webSocketUtils';

export const EventsContext = createContext<{}>({});

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { createContext, useEffect, useReducer } from 'react';
import { BeaconWallet } from '@taquito/beacon-wallet';
import { AccountInfo, NetworkType } from '@airgap/beacon-sdk';
import { useTezosToolkit } from './tezos-toolkit';
import { getByKey, setByKey } from 'utils/local-storage';
import { getByKey, setByKey } from 'src/utils/local-storage';

type WalletState = {
wallet: BeaconWallet | undefined;
Expand Down
2 changes: 1 addition & 1 deletion batcher-ui/src/reducers/exchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
getOraclePriceCmd,
setupBatcherCmd,
} from '../../src/commands/exchange';
import { getTimeDifference } from 'utils/utils';
import { getTimeDifference } from 'src/utils/utils';

const initialSwap: CurrentSwap = {
swap: {
Expand Down
2 changes: 1 addition & 1 deletion batcher-ui/src/reducers/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { WalletActions } from 'src/actions';
import { Loop, liftState, loop } from 'redux-loop';
import { fetchUserBalancesCmd } from '../commands/wallet';
import { WalletState } from 'src/types';
import { TOKENS } from 'utils/utils';
import { TOKENS } from 'src/utils/utils';

// TODO: fp-ts

Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions batcher-ui/utils/utils.ts → batcher-ui/src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
VolumesState,
VolumesStorage,
batchIsCleared,
} from '../src/types';
} from '../types';
import { Batch } from 'src/types/events';
import { NetworkType } from '@airgap/beacon-sdk';

Expand Down Expand Up @@ -83,7 +83,6 @@ export const getNetworkType = () => {
}
};


// ----- BALANCES ------

export type Balances = {
Expand Down
File renamed without changes.
6 changes: 1 addition & 5 deletions batcher-ui/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
'./components/**/*.{js,ts,jsx,tsx}',
'./src/**/*.{js,ts,jsx,tsx}',
],
content: ['./pages/**/*.{js,ts,jsx,tsx}', './src/**/*.{js,ts,jsx,tsx}'],
theme: {
extend: {
colors: {
Expand Down
4 changes: 2 additions & 2 deletions batcher-ui/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
"module": "esnext"
},
"include": [
"utils/**/*",
"src/utils/**/*",
"src/**/*",
"tests/**/*",
"test/**/*",
"__test__/**/*",
"config/**/*",
"src/config/**/*",
".eslintrc.json",
".prettierrc.json",
"jest.config.js",
Expand Down

0 comments on commit 224b6b2

Please sign in to comment.