Skip to content

Commit

Permalink
fix: use src directory
Browse files Browse the repository at this point in the history
  • Loading branch information
RyukTheCoder committed Dec 22, 2024
1 parent 061d518 commit 2ddf996
Show file tree
Hide file tree
Showing 155 changed files with 134 additions and 373 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import { ChartProps } from './Chart.type';
import isMobile from 'is-mobile';

import { LinearGradient } from '@visx/gradient';
import { AmountConverter } from 'utils/amountConverter';
import { getDayOfMonth } from 'utils/common';
import { AmountConverter } from 'src/utils/amountConverter';
import { getDayOfMonth } from 'src/utils/common';
import dayjs from 'dayjs';
import utc from 'dayjs/plugin/utc';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DailyIntervalType } from 'types';
import { DailyIntervalType } from 'src/types';

import { TickRendererProps } from '@visx/axis';

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Table from 'components/common/Table';
import { getLastSwaps } from 'services';
import Table from 'src/components/common/Table';
import { getLastSwaps } from 'src/services';
import { Timer } from '../Timer';

const RecentSwaps = async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SummaryType } from 'types';
import { SummaryType } from 'src/types';

export interface SummaryProps {
summary: SummaryType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { SummaryItemProps } from './Summary.type';
import { AmountConverter } from 'utils/amountConverter';
import { AmountConverter } from 'src/utils/amountConverter';

function SummaryItem(props: SummaryItemProps) {
const { value, title, prefix } = props;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import refreshLatestSwaps from 'app/actions';
import RefreshButton from 'components/common/RefreshButton';
import refreshLatestSwaps from 'src/app/actions';
import RefreshButton from 'src/components/common/RefreshButton';
import { useEffect, useState } from 'react';

const REFRESH_TIME = 30;
Expand Down
4 changes: 2 additions & 2 deletions app/(home)/page.tsx → src/app/(home)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import SearchBox from 'components/common/SearchBox';
import SearchBox from 'src/components/common/SearchBox';
import { Metadata } from 'next';
import { getSummary } from 'services';
import { getSummary } from 'src/services';
import Summary from './_components/Summary';
import ChartBox from './_components/ChartBox';
import RecentSwaps from './_components/RecentSwaps';
Expand Down
2 changes: 1 addition & 1 deletion app/actions.ts → src/app/actions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use server';

import { revalidateTag } from 'next/cache';
import { GET_LAST_SWAPS_TAG } from 'services';
import { GET_LAST_SWAPS_TAG } from 'src/services';

export default async function refreshLatestSwaps() {
revalidateTag(GET_LAST_SWAPS_TAG);
Expand Down
9 changes: 6 additions & 3 deletions app/error.tsx → src/app/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ import dynamic from 'next/dynamic';
import Image from 'next/image';
import errorImage from 'public/img/error.png';

const ReloadButton = dynamic(() => import('components/common/ReloadButton'), {
ssr: false,
});
const ReloadButton = dynamic(
() => import('src/components/common/ReloadButton'),
{
ssr: false,
},
);

const Error = () => {
return (
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions app/layout.tsx → src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Footer } from 'components/common/Footer';
import { Footer } from 'src/components/common/Footer';
import './globals.css';
import Header from 'components/common/Header';
import Header from 'src/components/common/Header';
import { Metadata } from 'next';

const description = 'Track all transactions on Rango Exchange';
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { SEARCH_RESULT_OFFSET as offsetPage } from 'constant';
import { SEARCH_RESULT_OFFSET as offsetPage } from 'src/constant';
import { PropsType } from './Pagination.type';
import {
FirstPageIcon,
LastPageIcon,
NextPageIcon,
PrevPageIcon,
} from 'components/icons';
} from 'src/components/icons';
import Link from 'next/link';

function Pagination(props: PropsType) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SwapType } from 'types';
import { SwapType } from 'src/types';

export interface PropsType {
data: SwapType[];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PropsType } from './Result.type';
import Pagination from '../Pagination';
import Table from 'components/common/Table';
import Table from 'src/components/common/Table';

function Result(props: PropsType) {
const { data, query, total, page } = props;
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions app/search/page.tsx → src/app/search/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MATCH_TYPE } from 'constant';
import { MATCH_TYPE } from 'src/constant';
import { notFound, redirect } from 'next/navigation';
import { getSearchResult, getWalletSwaps } from 'services';
import { getSearchResult, getWalletSwaps } from 'src/services';
import Result from './_components/Result';

export async function generateMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ import {
BarStackDataType,
TooltipDataType,
} from './ChartBarBox.type';
import { getDayOfMonth } from 'utils/common';
import { getDayOfMonth } from 'src/utils/common';
import {
DEFAULT_MARGIN,
DesktopBottomAxisData,
barChartColors,
getTotalValueDates,
mobileBottomAxisData,
} from './ChartBarBox.helper';
import { AmountConverter, compactNumberFormat } from 'utils/amountConverter';
import {
AmountConverter,
compactNumberFormat,
} from 'src/utils/amountConverter';
import dayjs from 'dayjs';
import utc from 'dayjs/plugin/utc';
import React, { Fragment, useEffect, useRef } from 'react';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { Fragment, useState } from 'react';
import { BlockchainFilterProps } from './ChartBarBox.type';
import Image from 'next/image';
import { CheckIcon, SearchIcon } from 'components/icons';
import { containsText } from 'utils/common';
import { CheckIcon, SearchIcon } from 'src/components/icons';
import { containsText } from 'src/utils/common';

function BlockchainFilter(props: BlockchainFilterProps) {
const { blockchains, selectedBlockchain, onSelect } = props;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
ChartType,
ColorBlockchainMapType,
} from './ChartBarBox.type';
import { DailySummaryType } from 'types';
import { DailySummaryType } from 'src/types';

export const BAR_CHART_BLOCKCHAIN_NUMBER = 10;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DailySummaryType, StatisticDaysFilter } from 'types';
import { BlockchainMeta } from 'types/meta';
import { DailySummaryType, StatisticDaysFilter } from 'src/types';
import { BlockchainMeta } from 'src/types/meta';
import { SeriesPoint } from '@visx/shape/lib/types';

export type ChartType = 'transaction' | 'volume';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import {
ModalFilterType,
BlockchainFilterType,
} from './ChartBarBox.type';
import { Modal } from 'components/common/Modal';
import { Modal } from 'src/components/common/Modal';
import Image from 'next/image';
import { ChevronRightIcon, CloseIcon } from 'components/icons';
import { BreakDownList } from 'types';
import { Button } from 'components/common/Button';
import { ChevronRightIcon, CloseIcon } from 'src/components/icons';
import { BreakDownList } from 'src/types';
import { Button } from 'src/components/common/Button';
import BlockchainFilter from './BlockchainFilter';
import { DEFAULT_STATISTIC_BREAK_DOWN_FILTER } from 'constant';
import { DEFAULT_STATISTIC_BREAK_DOWN_FILTER } from 'src/constant';

function ModalFilter(props: ModalFilterType) {
const { blockchains, selectedFilter, open, onClose, onApply } = props;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
import React, { useEffect, useMemo, useState } from 'react';
import { FilterBarChart, PropsType } from './ChartBarBox.type';
import { numberWithCommas } from 'utils/amountConverter';
import { SelectBlockchain } from 'components/common/SelectBlockchain';
import { numberWithCommas } from 'src/utils/amountConverter';
import { SelectBlockchain } from 'src/components/common/SelectBlockchain';
import {
BreakDownList,
DailySummaryOption,
DailySummaryType,
StatisticDaysFilter,
} from 'types';
import { getDailySummary } from 'services';
import { Select } from 'components/common/Select';
import { OptionType } from 'components/common/Select/Select.types';
} from 'src/types';
import { getDailySummary } from 'src/services';
import { Select } from 'src/components/common/Select';
import { OptionType } from 'src/components/common/Select/Select.types';
import { getBarChartData } from './ChartBarBox.helper';
import { ActiveFilterIcon, FilterIcon, LoadingIcon } from 'components/icons';
import {
ActiveFilterIcon,
FilterIcon,
LoadingIcon,
} from 'src/components/icons';
import ModalFilter from './ModalFilter';
import ParentSize from '@visx/responsive/lib/components/ParentSize';
import {
DEFAULT_STATISTIC_BREAK_DOWN_FILTER,
DEFAULT_STATISTIC_DAYS,
} from 'constant';
} from 'src/constant';
import BarChart from './BarChart';

function ChartBarBox(props: PropsType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
DEFAULT_BLOCKCHAIN_COLOR,
SPLIT_SOURCE_DESTINATION,
} from './SankeyChartBox.helper';
import { compactNumberFormat } from 'utils/amountConverter';
import { compactNumberFormat } from 'src/utils/amountConverter';

Chart.register(SankeyController, Flow, ...registerables);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { BlockchainPathMap } from 'types';
import { BlockchainPathMap } from 'src/types';
import {
SankeyDataType,
SankeyLabelsType,
SankeyPriorityType,
} from './SankeyChartBox.type';
import { BlockchainMeta } from 'types/meta';
import { BlockchainMeta } from 'src/types/meta';

const MAX_NUMBER_OF_SOURCE = 10;
const MAX_NUMBER_OF_DESTINATION = 10;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BlockchainPathMap } from 'types';
import { BlockchainMeta } from 'types/meta';
import { BlockchainPathMap } from 'src/types';
import { BlockchainMeta } from 'src/types/meta';

export type PropsType = {
blockchainDataMap: Map<string, BlockchainMeta>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
'use client';

import { getTopListSummary } from 'services';
import { getTopListSummary } from 'src/services';

import { BlockchainMeta } from 'types/meta';
import { BlockchainMeta } from 'src/types/meta';
import {
DailySummaryType,
StatisticDaysFilter,
TopListSummaryType,
} from 'types';
} from 'src/types';
import Link from 'next/link';
import { ChevronRightIcon, LoadingIcon } from 'components/icons';
import { ChevronRightIcon, LoadingIcon } from 'src/components/icons';
import { useEffect, useState } from 'react';
import { DEFAULT_STATISTIC_DAYS } from 'constant';
import { DEFAULT_STATISTIC_DAYS } from 'src/constant';

import TopList from '../TopList';
import ChartBarBox from '../ChartBarBox';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BlockchainMap, BlockchainPathMap } from 'types';
import { BlockchainMeta } from 'types/meta';
import { BlockchainMap, BlockchainPathMap } from 'src/types';
import { BlockchainMeta } from 'src/types/meta';

export type TopListItemProps = {
title: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable @next/next/no-img-element */
import { compactNumberFormat } from 'utils/amountConverter';
import { compactNumberFormat } from 'src/utils/amountConverter';
import { TopListItemProps } from './TopList.type';
import React from 'react';
import { NextIcon } from 'components/icons';
import { NextIcon } from 'src/components/icons';
import { TOP_LIST_NUMBER_TO_SHOW } from './TopList.helper';

function TopList(props: TopListItemProps) {
Expand Down
8 changes: 6 additions & 2 deletions app/statistics/page.tsx → src/app/statistics/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { getBlockchains, getDailySummary, getTopListSummary } from 'services';
import {
getBlockchains,
getDailySummary,
getTopListSummary,
} from 'src/services';

import {
DEFAULT_STATISTIC_BREAK_DOWN_FILTER,
DEFAULT_STATISTIC_DAYS,
} from 'constant';
} from 'src/constant';
import StatisticsPageContent from './_components/StatisticsPageContent';
import { Metadata } from 'next';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DetailsType } from 'types';
import { DetailsType } from 'src/types';

export interface PropsType {
details: DetailsType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import Link from 'next/link';
import { SwapDetailItem } from './SwapDetail.type';
import ButtonCopyIcon from 'components/common/ButtonCopyIcon';
import { SearchIcon } from 'components/icons';
import ButtonCopyIcon from 'src/components/common/ButtonCopyIcon';
import { SearchIcon } from 'src/components/icons';
import Image from 'next/image';
import logo from 'public/logo.png';
import Tooltip from 'components/common/Tooltip';
import Tooltip from 'src/components/common/Tooltip';

function SwapDetailAddress(props: SwapDetailItem) {
const { details, column } = props;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @next/next/no-img-element */
import { DEFAULT_TOKEN_LOGO } from 'constant';
import { DEFAULT_TOKEN_LOGO } from 'src/constant';
import { SwapDetailItem } from './SwapDetail.type';

function SwapDetailChain(props: SwapDetailItem) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* eslint-disable @next/next/no-img-element */
import ButtonCopyIcon from 'components/common/ButtonCopyIcon';
import ButtonCopyIcon from 'src/components/common/ButtonCopyIcon';
import { SwapDetailItem } from './SwapDetail.type';
import Link from 'next/link';
import { DEFAULT_TOKEN_LOGO } from 'constant';
import { DEFAULT_TOKEN_LOGO } from 'src/constant';
import Image from 'next/image';
import { SearchIcon } from 'components/icons';
import { SearchIcon } from 'src/components/icons';
import rango from 'public/logo.png';

function SwapDetailMobileToken(props: SwapDetailItem) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-disable @next/next/no-img-element */
import { SecondsTohms } from 'utils/secondsTohms';
import { SecondsTohms } from 'src/utils/secondsTohms';
import { SwapDetailItem } from './SwapDetail.type';
import dayjs from 'dayjs';
import utc from 'dayjs/plugin/utc';
import IconStatus from 'components/common/IconStatus';
import { StepsIcon } from 'components/icons';
import Tooltip from 'components/common/Tooltip';
import IconStatus from 'src/components/common/IconStatus';
import { StepsIcon } from 'src/components/icons';
import Tooltip from 'src/components/common/Tooltip';

dayjs.extend(utc);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-disable @next/next/no-img-element */
import { SecondsTohms } from 'utils/secondsTohms';
import { SecondsTohms } from 'src/utils/secondsTohms';
import { SwapDetailItem } from './SwapDetail.type';
import dayjs from 'dayjs';
import utc from 'dayjs/plugin/utc';
import IconStatus from 'components/common/IconStatus';
import { StepsIcon } from 'components/icons';
import Tooltip from 'components/common/Tooltip';
import IconStatus from 'src/components/common/IconStatus';
import { StepsIcon } from 'src/components/icons';
import Tooltip from 'src/components/common/Tooltip';

dayjs.extend(utc);

Expand Down
Loading

0 comments on commit 2ddf996

Please sign in to comment.