Update company board card link to opportunity show page (#3557)

Update board link to opportunity show page

Co-authored-by: Thomas Trompette <thomast@twenty.com>
This commit is contained in:
Thomas Trompette
2024-01-19 17:01:24 +01:00
committed by GitHub
parent 2cf4bd746a
commit e6f985c681
3 changed files with 13 additions and 13 deletions

View File

@ -15,16 +15,16 @@ type Story = StoryObj<typeof CompanyChip>;
export const SmallName: Story = {
args: {
id: 'airbnb',
name: 'Airbnb',
opportunityId: 'airbnb',
companyName: 'Airbnb',
avatarUrl: 'https://api.faviconkit.com/airbnb.com/144',
},
};
export const BigName: Story = {
args: {
id: 'google',
name: 'Google with a real big name to overflow the cell',
opportunityId: 'google',
companyName: 'Google with a real big name to overflow the cell',
avatarUrl: 'https://api.faviconkit.com/google.com/144',
},
};

View File

@ -197,8 +197,8 @@ export const CompanyBoardCard = () => {
>
<StyledBoardCardHeader showCompactView={showCompactView}>
<CompanyChip
id={company.id}
name={company.name}
opportunityId={opportunity.id}
companyName={company.name}
avatarUrl={getLogoUrlFromDomainName(company.domainName)}
variant={EntityChipVariant.Transparent}
/>

View File

@ -4,22 +4,22 @@ import {
} from '@/ui/display/chip/components/EntityChip';
type CompanyChipProps = {
id: string;
name: string;
opportunityId: string;
companyName: string;
avatarUrl?: string;
variant?: EntityChipVariant;
};
export const CompanyChip = ({
id,
name,
opportunityId,
companyName,
avatarUrl,
variant = EntityChipVariant.Regular,
}: CompanyChipProps) => (
<EntityChip
entityId={id}
linkToEntity={`/object/company/${id}`}
name={name}
entityId={opportunityId}
linkToEntity={`/object/opportunity/${opportunityId}`}
name={companyName}
avatarType="squared"
avatarUrl={avatarUrl}
variant={variant}