Skip to content

Commit

Permalink
thisyahlen/chore: separate folder structure for Cashier (deriv-com#10617
Browse files Browse the repository at this point in the history
)

* chore: separate folder structure

* chore: restructure v2

* chore: restructure v3

* chore: update index.ts

* fix: ci
  • Loading branch information
thisyahlen-deriv authored Oct 12, 2023
1 parent 0e42c26 commit 74cf504
Show file tree
Hide file tree
Showing 72 changed files with 63 additions and 54 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useMemo } from 'react';
import useDevice from '../../hooks/useDevice';
import AlertAnnounce from '../../public/images/alert-annouce.svg';
import AlertDanger from '../../public/images/alert-danger.svg';
import AlertInfo from '../../public/images/alert-info.svg';
import Warning from '../../public/images/warning.svg';
import useDevice from '../../../hooks/useDevice';
import AlertAnnounce from '../../../public/images/alert-annouce.svg';
import AlertDanger from '../../../public/images/alert-danger.svg';
import AlertInfo from '../../../public/images/alert-info.svg';
import Warning from '../../../public/images/warning.svg';
import './InlineMessage.scss';

const typeIconMapper = {
Expand Down
1 change: 1 addition & 0 deletions packages/wallets/src/components/Base/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './InlineMessage';
1 change: 0 additions & 1 deletion packages/wallets/src/components/WalletCashier/index.ts

This file was deleted.

15 changes: 1 addition & 14 deletions packages/wallets/src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export * from './AccountsList';
export * from './Base';
export * from './CreatePassword';
export * from './DesktopWalletsList';
export * from './DxtradeEnterPasswordModal';
export * from './EnterPassword';
export * from './ExternalTradingPlatforms';
export * from './InlineMessage';
export * from './Loader';
export * from './MT5AccountTypeModal';
export * from './MT5PasswordModal';
Expand All @@ -15,15 +15,7 @@ export * from './SecondaryActionButton';
export * from './TradingAccountCard';
export * from './WalletCard';
export * from './WalletCardIcon';
export * from './WalletCashier';
export * from './WalletCashierContent';
export * from './WalletCashierHeader';
export * from './WalletClipboard';
export * from './WalletDepositCrypto';
export * from './WalletDepositCryptoAddress';
export * from './WalletDepositCryptoCurrencyDetails';
export * from './WalletDepositCryptoDisclaimers';
export * from './WalletDepositFiat';
export * from './WalletListCard';
export * from './WalletListCardActions';
export * from './WalletListCardBadge';
Expand All @@ -34,8 +26,3 @@ export * from './WalletsAccordion';
export * from './WalletsAddMoreCarousel';
export * from './WalletsCarousel';
export * from './WalletsCarouselContent';
export * from './WalletTransfer';
export * from './WalletTransferFormAccountCard';
export * from './WalletTransferFormAccountSelection';
export * from './WalletTransferFormDropdown';
export * from './WalletTransferFormInputField';
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { useActiveWalletAccount } from '@deriv/api';
import WalletCashierContent from '../WalletCashierContent/WalletCashierContent';
import WalletCashierHeader from '../WalletCashierHeader/WalletCashierHeader';
import { WalletCashierContent, WalletCashierHeader } from './components';
import './WalletCashier.scss';

const WalletCashier = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useEffect } from 'react';
import { useHistory, useRouteMatch } from 'react-router-dom';
import { WalletDeposit } from '../WalletDeposit';
import { WalletTransactions } from '../WalletTransactions';
import { WalletTransfer } from '../WalletTransfer';
import { WalletDeposit } from '../../flows/WalletDeposit';
import { WalletTransactions } from '../../flows/WalletTransactions';
import { WalletTransfer } from '../../flows/WalletTransfer';

const WalletCashierContent = () => {
const history = useHistory();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';
import { useHistory, useLocation } from 'react-router-dom';
import { useActiveWalletAccount } from '@deriv/api';
import useDevice from '../../hooks/useDevice';
import CloseIcon from '../../public/images/close-icon.svg';
import { WalletCardIcon } from '../WalletCardIcon';
import { WalletGradientBackground } from '../WalletGradientBackground';
import { WalletListCardBadge } from '../WalletListCardBadge';
import { WalletCardIcon } from '../../../../components/WalletCardIcon';
import { WalletGradientBackground } from '../../../../components/WalletGradientBackground';
import { WalletListCardBadge } from '../../../../components/WalletListCardBadge';
import useDevice from '../../../../hooks/useDevice';
import CloseIcon from '../../../../public/images/close-icon.svg';
import './WalletCashierHeader.scss';

const tabs = ['deposit', 'withdraw', 'transfer', 'transactions'] as const;
Expand Down
2 changes: 2 additions & 0 deletions packages/wallets/src/features/cashier/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './WalletCashierContent';
export * from './WalletCashierHeader';
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { useActiveWalletAccount } from '@deriv/api';
import { WalletDepositCrypto } from '../WalletDepositCrypto';
import { WalletDepositFiat } from '../WalletDepositFiat';
import { WalletDepositCrypto, WalletDepositFiat } from '../../screens';

const WalletDeposit = () => {
const { data } = useActiveWalletAccount();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { ComponentProps, useState } from 'react';
import { WalletTransactionsCrypto } from '../WalletTransactionsCrypto';
import { WalletTransactionsFilter } from '../WalletTransactionsFilter';
import { WalletTransactionsCrypto, WalletTransactionsFilter } from '../../screens/WalletTransactionsScreens';
import './WalletTransactions.scss';

const WalletTransactions = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import { Formik } from 'formik';
import { useActiveWalletAccount, useTransferBetweenAccounts } from '@deriv/api';
import WalletTransferFormDropdown from '../WalletTransferFormDropdown/WalletTransferFormDropdown';
import WalletTransferFormInputField from '../WalletTransferFormInputField/WalletTransferFormInputField';
import { WalletTransferFormDropdown, WalletTransferFormInputField } from '../../screens/WalletTransferScreens';
import './WalletTransfer.scss';

type TInitialValues = {
Expand Down
3 changes: 3 additions & 0 deletions packages/wallets/src/features/cashier/flows/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from './WalletDeposit';
export * from './WalletTransactions';
export * from './WalletTransfer';
3 changes: 3 additions & 0 deletions packages/wallets/src/features/cashier/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from './components';
export * from './flows';
export * from './screens';
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useEffect } from 'react';
import QRCode from 'qrcode.react';
import { useAuthorize, useDepositCryptoAddress } from '@deriv/api';
import useDevice from '../../hooks/useDevice';
import { Loader } from '../Loader';
import WalletClipboard from '../WalletClipboard/WalletClipboard';
import { Loader } from '../../../../../components/Loader';
import { WalletClipboard } from '../../../../../components/WalletClipboard';
import useDevice from '../../../../../hooks/useDevice';
import './WalletDepositCryptoAddress.scss';

const WalletDepositCryptoAddress = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { useActiveWalletAccount } from '@deriv/api';
import useDevice from '../../hooks/useDevice';
import { InlineMessage } from '../InlineMessage';
import { InlineMessage } from '../../../../../components/Base';
import useDevice from '../../../../../hooks/useDevice';
import './WalletDepositCryptoDisclaimers.scss';

// Check with BE to see if we can get the network name from the API.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export * from './WalletDepositCrypto';
export * from './WalletDepositCryptoAddress';
export * from './WalletDepositCryptoCurrencyDetails';
export * from './WalletDepositCryptoDisclaimers';
export * from './WalletDepositFiat';
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect } from 'react';
import moment from 'moment';
import { useCryptoTransactions } from '@deriv/api';
import { Loader } from '../Loader';
import { Loader } from '../../../../../components/Loader';
import { WalletTransactionsCryptoRow } from '../WalletTransactionsCryptoRow';
import { WalletTransactionsNoDataState } from '../WalletTransactionsNoDataState';
import { WalletTransactionsTable } from '../WalletTransactionsTable';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useMemo } from 'react';
import { useActiveWalletAccount, useCryptoTransactions } from '@deriv/api';
import { WalletCurrencyCard } from '../WalletCurrencyCard';
import { WalletCurrencyCard } from '../../../../../components/WalletCurrencyCard';
import './WalletTransactionsCryptoRow.scss';

const statusCodeMapper = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { useHistory } from 'react-router-dom';
import NoRecentTransactions from '../../public/images/no-recent-transactions.svg';
import NoRecentTransactions from '../../../../../public/images/no-recent-transactions.svg';
import './WalletTransactionsNoDataState.scss';

const WalletTransactionsNoDataState = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export * from './WalletTransactionsCrypto';
export * from './WalletTransactionsCryptoRow';
export * from './WalletTransactionsFilter';
export * from './WalletTransactionsNoDataState';
export * from './WalletTransactionsTable';
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { useAccountsList } from '@deriv/api';
import { WalletCurrencyCard } from '../WalletCurrencyCard';
import { WalletListCardBadge } from '../WalletListCardBadge';
import { WalletCurrencyCard } from '../../../../../components/WalletCurrencyCard';
import { WalletListCardBadge } from '../../../../../components/WalletListCardBadge';
import './WalletTransferFormAccountCard.scss';

type TProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import { useAccountsList } from '@deriv/api';
import CloseIcon from '../../public/images/close-icon.svg';
import { Loader } from '../Loader';
import { useModal } from '../ModalProvider';
import { Loader } from '../../../../../components/Loader';
import { useModal } from '../../../../../components/ModalProvider';
import CloseIcon from '../../../../../public/images/close-icon.svg';
import WalletTransferFromAccountCard from '../WalletTransferFormAccountCard/WalletTransferFormAccountCard';
import './WalletTransferFormAccountSelection.scss';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useState } from 'react';
import { useFormikContext } from 'formik';
import { useAccountsList } from '@deriv/api';
import IcDropdown from '../../public/images/ic-dropdown.svg';
import { useModal } from '../ModalProvider';
import { WalletListCardBadge } from '../WalletListCardBadge';
import { useModal } from '../../../../../components/ModalProvider';
import { WalletListCardBadge } from '../../../../../components/WalletListCardBadge';
import IcDropdown from '../../../../../public/images/ic-dropdown.svg';
import WalletTransferFromAccountCard from '../WalletTransferFormAccountCard/WalletTransferFormAccountCard';
import WalletTransferFormAccountSelection from '../WalletTransferFormAccountSelection/WalletTransferFormAccountSelection';
import './WalletTransferFormDropdown.scss';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect } from 'react';
import { useFormikContext } from 'formik';
import useInputATMFormatter from '../../hooks/useInputATMFormatter';
import useInputATMFormatter from '../../../../../hooks/useInputATMFormatter';
import './WalletTransferFormInputField.scss';

type TProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from './WalletTransferFormAccountCard';
export * from './WalletTransferFormAccountSelection';
export * from './WalletTransferFormDropdown';
export * from './WalletTransferFormInputField';
3 changes: 3 additions & 0 deletions packages/wallets/src/features/cashier/screens/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from './WalletDepositScreens';
export * from './WalletTransactionsScreens';
export * from './WalletTransferScreens';
1 change: 1 addition & 0 deletions packages/wallets/src/features/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as WalletCashier } from './cashier/WalletCashier';
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { WalletCashier } from '../../components';
import { WalletCashier } from '../../features';
import './CashierModalRoute.scss';

const CashierModalRoute: React.FC = () => (
Expand Down

0 comments on commit 74cf504

Please sign in to comment.