Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Image service's default Vendor avatar #10396

Merged
merged 1 commit into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions components/Avatar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { themeGet } from '@styled-system/theme-get';
import { Calendar, Store, TestTube2 } from 'lucide-react';
import { Calendar, TestTube2 } from 'lucide-react';
import styled from 'styled-components';
import { border, BorderProps, color, layout, space } from 'styled-system';

Expand Down Expand Up @@ -84,14 +84,6 @@ const Avatar = ({
src = defaultImage.ANONYMOUS;
} else if (collective.isGuest && shouldUseDefaultGuestAvatar(collective.name)) {
src = defaultImage.GUEST;
} else if (type === 'VENDOR' && collective.hasImage !== true) {
const iconSize = 2 * Math.round((radius * 0.6) / 2);
const padding = (radius - iconSize) / 2;
child = (
<div className="rounded-sm bg-slate-100 text-slate-300" style={{ padding }}>
<Store size={iconSize} />
</div>
);
} else if (useIcon) {
const Icon = COLLECTIVE_TYPE_ICON[type];
if (Icon) {
Expand Down Expand Up @@ -159,15 +151,6 @@ export const ContributorAvatar = ({ contributor, radius, ...styleProps }) => {
image = defaultImage.ANONYMOUS;
} else if (contributor.isGuest && shouldUseDefaultGuestAvatar(contributor.name)) {
image = defaultImage.GUEST;
} else if (contributor.type === 'VENDOR') {
image = undefined;
const iconSize = 2 * Math.round((radius * 0.6) / 2);
const padding = (radius - iconSize) / 2;
styleProps.children = (
<div className="rounded-sm bg-slate-100 text-slate-300" style={{ padding }}>
<Store size={iconSize} />
</div>
);
} else {
image = getCollectiveImage({ slug: contributor.collectiveSlug, imageUrl: contributor.image });
}
Expand Down
2 changes: 0 additions & 2 deletions components/ContributionConfirmationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export const confirmContributionFieldsFragment = gql`
name
type
imageUrl
hasImage
isIncognito
... on Individual {
isGuest
Expand All @@ -58,7 +57,6 @@ export const confirmContributionFieldsFragment = gql`
name
type
imageUrl
hasImage
... on AccountWithHost {
bankTransfersHostFeePercent: hostFeePercent(paymentMethodType: MANUAL)
host {
Expand Down
3 changes: 0 additions & 3 deletions components/expenses/graphql/fragments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ export const expensePageExpenseFieldsFragment = gql`
name
legalName
imageUrl
hasImage
type
isAdmin
isActive
Expand Down Expand Up @@ -387,7 +386,6 @@ export const expensePageExpenseFieldsFragment = gql`
name
type
imageUrl
hasImage
backgroundImageUrl
isActive
description
Expand Down Expand Up @@ -724,7 +722,6 @@ export const expensesListFieldsFragment = gql`
slug
name
imageUrl
hasImage
isAdmin
# For Collectives, Funds, Events and Projects
... on AccountWithHost {
Expand Down
1 change: 0 additions & 1 deletion components/recurring-contributions/graphql/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export const managedOrderFragment = gql`
description
tags
imageUrl
hasImage
backgroundImageUrl(height: 256)
settings
... on AccountWithHost {
Expand Down
2 changes: 0 additions & 2 deletions components/transactions/graphql/fragments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export const transactionsQueryCollectionFragment = gql`
slug
type
imageUrl
hasImage
isIncognito
... on AccountWithParent {
parent {
Expand Down Expand Up @@ -83,7 +82,6 @@ export const transactionsQueryCollectionFragment = gql`
slug
type
imageUrl
hasImage
isIncognito
... on Event {
parent {
Expand Down
3 changes: 0 additions & 3 deletions components/vendors/VendorForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,6 @@ const VendorForm = ({ vendor, host, onSuccess, onCancel, isModal, supportsTaxFor
{ label: <FormattedMessage id="taxType.Other" defaultMessage="Other" />, value: 'OTHER' },
];
const initialValues = cloneDeep(pick(vendor, EDITABLE_FIELDS));
if (vendor?.hasImage !== true) {
initialValues.imageUrl = null;
}
if (initialValues.vendorInfo?.taxType && !['EIN', 'VAT', 'GST'].includes(initialValues.vendorInfo?.taxType)) {
initialValues.vendorInfo['otherTaxType'] = initialValues.vendorInfo?.taxType;
initialValues.vendorInfo.taxType = 'OTHER';
Expand Down
1 change: 0 additions & 1 deletion components/vendors/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const vendorFieldFragment = gql`
description
tags
imageUrl(height: 96)
hasImage
isArchived
createdAt

Expand Down
Loading