Skip to content

Commit 63b3a06

Browse files
committed
chore: udpate font-family
Signed-off-by: Amit Amrutiya <amitamrutiya2210@gmail.com>
1 parent 4ff52d6 commit 63b3a06

3 files changed

Lines changed: 42 additions & 16 deletions

File tree

src/custom/CatalogDetail/CaveatsSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const CaveatsSection: React.FC<CaveatsSectionProps> = ({ details }) => {
1515
<h2 style={{ margin: '0' }}>CAVEATS AND CONSIDERATIONS</h2>
1616
</ContentHeading>
1717
{details?.catalog_data?.pattern_caveats ? (
18-
<ContentDetailsText style={{ whiteSpace: 'normal' }}>
18+
<ContentDetailsText style={{ whiteSpace: 'normal', fontFamily: 'inherit' }}>
1919
<RenderMarkdown
2020
content={decodeURIComponent(details.catalog_data.pattern_caveats || '')}
2121
/>

src/custom/CatalogDetail/ContentClassInfo.tsx

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,64 @@
11
import React from 'react';
22
import { Box } from '../../base';
3+
import { CommunityClassIcon, OfficialClassIcon, VerificationClassIcon } from '../../icons';
4+
import { KEPPEL, useTheme } from '../../theme';
35
import { InfoTooltip } from '../CustomTooltip';
46
import { ContentDetailsPoints, ContentDetailsText } from '../Typography';
5-
import { CONTENT_CLASS, formatToTitleCase } from './helper';
6-
import { Class } from './types';
7+
import { formatToTitleCase } from './helper';
8+
import { Class, ContentClassType } from './types';
79

810
interface ContentClassInfoProps {
911
contentClass: string;
1012
classes: Class[];
1113
}
1214

13-
const ClassIcon: React.FC<{ className: string }> = ({ className }) => {
14-
const Icon = CONTENT_CLASS[className]?.icon;
15-
return Icon ? <Icon width="25px" height="25px" /> : null;
16-
};
17-
1815
const ContentClassInfo: React.FC<ContentClassInfoProps> = ({ contentClass, classes }) => {
19-
const classDescription = (className: string): string | undefined => {
16+
const _classDescription = (className: string): string | undefined => {
2017
const classObj = classes && classes.find((classObj) => classObj.class === className);
2118
return classObj?.description;
2219
};
2320

21+
const theme = useTheme();
22+
23+
const CONTENT_CLASS: ContentClassType = {
24+
community: {
25+
icon: CommunityClassIcon,
26+
color: theme.palette.icon.secondary
27+
},
28+
official: {
29+
icon: OfficialClassIcon,
30+
color: '#EBC017'
31+
},
32+
verified: {
33+
icon: VerificationClassIcon,
34+
color: theme.palette.primary.brand?.default || KEPPEL
35+
}
36+
} as const;
37+
38+
const ClassIcon: React.FC<{ className: string }> = ({ className }) => {
39+
const Icon = CONTENT_CLASS[className]?.icon;
40+
const fill = CONTENT_CLASS[className]?.color;
41+
return Icon ? <Icon width="25px" height="25px" fill={fill} /> : null;
42+
};
43+
2444
return (
2545
<div>
2646
<Box style={{ display: 'flex', alignItems: 'center', gap: '0.3rem' }}>
27-
<ContentDetailsPoints>CLASS</ContentDetailsPoints>
47+
<ContentDetailsPoints style={{ fontFamily: 'inherit', fontWeight: 'bold' }}>
48+
CLASS
49+
</ContentDetailsPoints>
2850
<InfoTooltip
2951
variant="standard"
30-
helpText={classDescription(contentClass)}
52+
helpText={_classDescription(contentClass)}
3153
style={{ marginBottom: '0.2rem' }}
3254
/>
3355
</Box>
3456
<ContentDetailsText
3557
style={{
3658
display: 'flex',
3759
alignItems: 'center',
38-
gap: '0.4rem'
60+
gap: '0.4rem',
61+
fontFamily: 'inherit'
3962
}}
4063
>
4164
<ClassIcon className={contentClass} />

src/custom/CatalogDetail/style.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ListItemButton, Paper, Typography } from '../../base';
1+
import { Link, ListItemButton, Paper, Typography } from '../../base';
22
import { styled } from '../../theme';
33
import { Theme } from './types';
44

@@ -40,6 +40,7 @@ export const ActionButton = styled('div')<ActionButtonProps>(({ disabled = false
4040
}));
4141

4242
export const ContentDetailsText = styled(Typography)(({ theme }) => ({
43+
fontFamily: 'inherit',
4344
fontSize: '1rem',
4445
color: theme.palette.text.default,
4546
['@media (min-width:1200px)']: {
@@ -122,7 +123,8 @@ export const ContentDetailsPoints = styled(Typography)(() => ({
122123
display: 'flex',
123124
flexDirection: 'row',
124125
alignItems: 'center',
125-
gap: '1rem'
126+
gap: '1rem',
127+
fontFamily: 'inherit'
126128
}));
127129

128130
export const MetricsSection = styled('div')(() => ({
@@ -194,7 +196,8 @@ export const DesignHeading = styled('h1')(({ theme }) => ({
194196

195197
export const ContentRow = styled('div')(() => ({
196198
padding: '0.5rem 0',
197-
overflowWrap: 'anywhere'
199+
overflowWrap: 'anywhere',
200+
fontFamily: 'inherit'
198201
}));
199202

200203
export const ShowToggleBtn = styled('span')(({ theme }) => ({
@@ -245,7 +248,7 @@ export const VisibilityChip = styled('div')(() => ({
245248
width: 'fit-content'
246249
}));
247250

248-
export const RedirectLink = styled('a')(({ theme }) => ({
251+
export const RedirectLink = styled(Link)(({ theme }) => ({
249252
color: theme.palette.background.brand?.default,
250253
textDecoration: 'none',
251254
cursor: 'pointer'

0 commit comments

Comments
 (0)