Skip to content

Commit

Permalink
fix(ui): fix double formatting of entity count on home page (#3474)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjoyce0510 committed Oct 27, 2021
1 parent 9863e41 commit 9ed0879
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Expand Up @@ -22,6 +22,11 @@ const TermButton = styled(Button)`
padding: 0px;
`;

const StyledBook = styled(BookOutlined)`
margin-left: 2%;
font-size: 20px;
`;

type Props = {
content: Array<RecommendationContent>;
onClick?: (index: number) => void;
Expand Down Expand Up @@ -55,7 +60,7 @@ export const GlossaryTermSearchList = ({ content, onClick }: Props) => {
<TermContainer>
<Tag closable={false}>
{term.name}
<BookOutlined style={{ marginLeft: '2%' }} />
<StyledBook />
</Tag>
</TermContainer>
</TermButton>
Expand Down
4 changes: 1 addition & 3 deletions datahub-web-react/src/app/search/BrowseEntityCard.tsx
Expand Up @@ -4,18 +4,16 @@ import { useEntityRegistry } from '../useEntityRegistry';
import { PageRoutes } from '../../conf/Global';
import { IconStyleType } from '../entity/Entity';
import { EntityType } from '../../types.generated';
import { formatNumber } from '../shared/formatNumber';
import { LogoCountCard } from '../shared/LogoCountCard';

export const BrowseEntityCard = ({ entityType, count }: { entityType: EntityType; count: number }) => {
const entityRegistry = useEntityRegistry();
const formattedCount = formatNumber(count);
return (
<Link to={`${PageRoutes.BROWSE}/${entityRegistry.getPathName(entityType)}`}>
<LogoCountCard
logoComponent={entityRegistry.getIcon(entityType, 18, IconStyleType.HIGHLIGHT)}
name={entityRegistry.getCollectionName(entityType)}
count={formattedCount}
count={count}
/>
</Link>
);
Expand Down

0 comments on commit 9ed0879

Please sign in to comment.