mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
fix: react intl.
This commit is contained in:
@@ -3,6 +3,7 @@ import { MenuItem, Button } from '@blueprintjs/core';
|
||||
import { omit } from 'lodash';
|
||||
import MultiSelect from 'components/MultiSelect';
|
||||
import { FormattedMessage as T } from 'components';
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
export default function ContactsMultiSelect({
|
||||
contacts,
|
||||
@@ -31,9 +32,10 @@ export default function ContactsMultiSelect({
|
||||
[isContactSelect],
|
||||
);
|
||||
|
||||
const countSelected = useMemo(() => Object.values(selectedContacts).length, [
|
||||
selectedContacts,
|
||||
]);
|
||||
const countSelected = useMemo(
|
||||
() => Object.values(selectedContacts).length,
|
||||
[selectedContacts],
|
||||
);
|
||||
|
||||
const onContactSelect = useCallback(
|
||||
({ id }) => {
|
||||
@@ -50,12 +52,7 @@ export default function ContactsMultiSelect({
|
||||
setSelectedContacts({ ...selected });
|
||||
onContactSelected && onContactSelected(selected);
|
||||
},
|
||||
[
|
||||
setSelectedContacts,
|
||||
selectedContacts,
|
||||
isContactSelect,
|
||||
onContactSelected,
|
||||
],
|
||||
[setSelectedContacts, selectedContacts, isContactSelect, onContactSelected],
|
||||
);
|
||||
|
||||
return (
|
||||
@@ -69,11 +66,9 @@ export default function ContactsMultiSelect({
|
||||
>
|
||||
<Button
|
||||
text={
|
||||
countSelected === 0 ? (
|
||||
defaultText
|
||||
) : (
|
||||
<T id={'selected_customers'} values={{ count: countSelected }} />
|
||||
)
|
||||
countSelected === 0
|
||||
? defaultText
|
||||
: intl.get('selected_customers', { count: countSelected })
|
||||
}
|
||||
{...buttonProps}
|
||||
/>
|
||||
|
||||
@@ -2,6 +2,7 @@ import React, { useReducer, useEffect } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { Button, ButtonGroup, Intent, HTMLSelect } from '@blueprintjs/core';
|
||||
import { FormattedMessage as T } from 'components';
|
||||
import intl from 'react-intl-universal';
|
||||
import PropTypes from 'prop-types';
|
||||
import { range } from 'lodash';
|
||||
import { Icon } from 'components';
|
||||
@@ -204,14 +205,11 @@ function Pagination({
|
||||
</div>
|
||||
|
||||
<div class="pagination__info">
|
||||
<T
|
||||
id={'showing_current_page_to_total'}
|
||||
values={{
|
||||
currentPage: state.currentPage,
|
||||
totalPages: state.totalPages,
|
||||
total: total,
|
||||
}}
|
||||
/>
|
||||
{intl.get('showing_current_page_to_total', {
|
||||
currentPage: state.currentPage,
|
||||
totalPages: state.totalPages,
|
||||
total: total,
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user