Skip to content

Commit

Permalink
Payouts - remove language modal code
Browse files Browse the repository at this point in the history
  • Loading branch information
Nagesh Pai committed Dec 19, 2024
1 parent 81d8589 commit cc07f50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 29 deletions.
30 changes: 1 addition & 29 deletions client/deposits/list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ import DownloadButton from 'components/download-button';
import { getDepositsCSV } from 'wcpay/data/deposits/resolvers';
import { applyThousandSeparator } from '../../utils/index.js';
import DepositStatusChip from 'components/deposit-status-chip';
import { isExportModalDismissed, isDefaultSiteLanguage } from 'utils';
import CSVExportModal from 'components/csv-export-modal';

import './style.scss';

Expand Down Expand Up @@ -106,8 +104,6 @@ export const DepositsList = (): JSX.Element => {
getQuery()
);

const [ isCSVExportModalOpen, setCSVExportModalOpen ] = useState( false );

const sortByDate = ! getQuery().orderby || 'date' === getQuery().orderby;
const columns = useMemo( () => getColumns( sortByDate ), [ sortByDate ] );
const totalRows = depositsSummary.count || 0;
Expand Down Expand Up @@ -305,11 +301,7 @@ export const DepositsList = (): JSX.Element => {
const downloadType = totalRows > rows.length ? 'endpoint' : 'browser';

if ( 'endpoint' === downloadType ) {
if ( ! isDefaultSiteLanguage() && ! isExportModalDismissed() ) {
setCSVExportModalOpen( true );
} else {
endpointExport();
}
endpointExport();
} else {
const params = getQuery();

Expand Down Expand Up @@ -349,16 +341,6 @@ export const DepositsList = (): JSX.Element => {
setIsDownloading( false );
};

const closeModal = () => {
setCSVExportModalOpen( false );
};

const exportDeposits = () => {
endpointExport();

closeModal();
};

return (
<Page>
<DepositsFilters storeCurrencies={ storeCurrencies } />
Expand All @@ -383,16 +365,6 @@ export const DepositsList = (): JSX.Element => {
),
] }
/>
{ ! isDefaultSiteLanguage() &&
! isExportModalDismissed() &&
isCSVExportModalOpen && (
<CSVExportModal
onClose={ closeModal }
onSubmit={ exportDeposits }
totalItems={ totalRows }
exportType={ 'deposits' }
/>
) }
</Page>
);
};
Expand Down
2 changes: 2 additions & 0 deletions client/deposits/list/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ declare const global: {
reporting?: {
exportModalDismissed: boolean;
};
locale: { code: string };
};
};

Expand Down Expand Up @@ -153,6 +154,7 @@ describe( 'Deposits list', () => {
reporting: {
exportModalDismissed: true,
},
locale: { code: 'en' },
};
} );

Expand Down

0 comments on commit cc07f50

Please sign in to comment.