Skip to content

Commit

Permalink
feat(TransactionsImport): add funds
Browse files Browse the repository at this point in the history
  • Loading branch information
Betree committed Jun 20, 2024
1 parent 4b5613f commit 63d21a8
Show file tree
Hide file tree
Showing 28 changed files with 1,081 additions and 624 deletions.
33 changes: 19 additions & 14 deletions components/CollectivePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { groupBy, intersection, isEqual, last, sortBy, truncate } from 'lodash';
import memoizeOne from 'memoize-one';
import ReactDOM from 'react-dom';
import { defineMessages, injectIntl } from 'react-intl';
import { defineMessages, FormattedMessage, injectIntl } from 'react-intl';
import { Manager, Popper, Reference } from 'react-popper';
import styled from 'styled-components';
import { isEmail } from 'validator';
Expand Down Expand Up @@ -62,19 +62,24 @@ const CollectiveLabelTextContainer = styled.div`
* Default label builder used to render a collective. For sections titles and custom options,
* this will just return the default label.
*/
export const DefaultCollectiveLabel = ({ value: collective }) => (
<Flex alignItems="center">
<Avatar collective={collective} radius={16} />
<CollectiveLabelTextContainer>
<Span fontSize="12px" fontWeight="500" lineHeight="18px" color="black.700">
{truncate(collective.name, { length: 40 })}
</Span>
<Span fontSize="11px" lineHeight="13px" color="black.500">
{collective.slug && collective.type !== 'VENDOR' ? `@${collective.slug}` : collective.email || ''}
</Span>
</CollectiveLabelTextContainer>
</Flex>
);
export const DefaultCollectiveLabel = ({ value: collective }) =>
!collective ? (
<Span fontSize="12px" lineHeight="18px" color="black.500">
<FormattedMessage defaultMessage="No collective" id="159cQ8" />
</Span>
) : (
<Flex alignItems="center">
<Avatar collective={collective} radius={16} />
<CollectiveLabelTextContainer>
<Span fontSize="12px" fontWeight="500" lineHeight="18px" color="black.700">
{truncate(collective.name, { length: 40 })}
</Span>
<Span fontSize="11px" lineHeight="13px" color="black.500">
{collective.slug && collective.type !== 'VENDOR' ? `@${collective.slug}` : collective.email || ''}
</Span>
</CollectiveLabelTextContainer>
</Flex>
);

DefaultCollectiveLabel.propTypes = {
value: PropTypes.shape({
Expand Down
Loading

0 comments on commit 63d21a8

Please sign in to comment.