Skip to content

Commit ee3fa5e

Browse files
authored
Merge pull request #796 from sudhanshutech/feature/catalog
Enhance catalog details
2 parents 7a98100 + f709b5b commit ee3fa5e

File tree

5 files changed

+34
-7
lines changed

5 files changed

+34
-7
lines changed

src/custom/CatalogDetail/LeftPanel.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const LeftPanel: React.FC<LeftPanelProps> = ({
7070
imgURL={details?.catalog_data?.imageURL}
7171
height={'100%'}
7272
width={'100%'}
73-
zoomEffect={false}
73+
zoomEffect={true}
7474
type={{ type: type }}
7575
/>
7676
</CustomCatalogCard>

src/custom/CatalogDetail/RelatedDesigns.tsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ interface RelatedDesignsProps {
1616
userProfile?: UserProfile;
1717
technologySVGPath: string;
1818
technologySVGSubpath: string;
19+
orgName: string;
20+
fetchingOrgError: boolean;
1921
}
2022

2123
const RelatedDesigns: React.FC<RelatedDesignsProps> = ({
@@ -25,7 +27,9 @@ const RelatedDesigns: React.FC<RelatedDesignsProps> = ({
2527
onSuggestedPatternClick,
2628
userProfile,
2729
technologySVGPath,
28-
technologySVGSubpath
30+
technologySVGSubpath,
31+
orgName,
32+
fetchingOrgError
2933
}) => {
3034
const filteredPatternsPerUser = patternsPerUser?.patterns?.filter(
3135
(pattern) => pattern.id !== details.id
@@ -37,7 +41,8 @@ const RelatedDesigns: React.FC<RelatedDesignsProps> = ({
3741
<AdditionalContainer>
3842
<ContentHeading>
3943
<h2 style={{ margin: '0', textTransform: 'uppercase' }}>
40-
Other published design by {formatToTitleCase(userProfile?.first_name ?? '')}
44+
Other published design by {formatToTitleCase(userProfile?.first_name ?? '')}{' '}
45+
{fetchingOrgError ? '' : `under ${orgName}`}
4146
</h2>
4247
</ContentHeading>
4348
<DesignCardContainer>

src/custom/CatalogDetail/RightPanel.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ interface RightPanelProps {
2424
fontFamily?: string;
2525
technologySVGPath: string;
2626
technologySVGSubpath: string;
27+
orgName: string;
28+
fetchingOrgError: boolean;
2729
}
2830

2931
const RightPanel: React.FC<RightPanelProps> = ({
@@ -43,7 +45,9 @@ const RightPanel: React.FC<RightPanelProps> = ({
4345
fontFamily,
4446
useGetUserProfileByIdQuery,
4547
technologySVGPath,
46-
technologySVGSubpath
48+
technologySVGSubpath,
49+
orgName,
50+
fetchingOrgError
4751
}) => {
4852
const cleanedType = type.replace('my-', '').replace(/s$/, '');
4953
const { data: userProfile } = useGetUserProfileByIdQuery({
@@ -69,6 +73,8 @@ const RightPanel: React.FC<RightPanelProps> = ({
6973
{showCaveats && <CaveatsSection details={details} />}
7074
<RelatedDesigns
7175
details={details}
76+
orgName={orgName}
77+
fetchingOrgError={fetchingOrgError}
7278
type={type}
7379
patternsPerUser={patternsPerUser}
7480
onSuggestedPatternClick={onSuggestedPatternClick}

src/custom/CatalogDetail/UserInfo.tsx

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Avatar } from '../../base';
12
import { Pattern } from '../CustomCatalog/CustomCard';
23
import { getVersion } from '../CustomCatalog/Helper';
34
import { formatDate } from './helper';
@@ -15,7 +16,21 @@ const UserInfo: React.FC<UserInfoProps> = ({ details, showVersion = true, userPr
1516
<>
1617
<ContentRow>
1718
<ContentDetailsPoints>CREATED BY</ContentDetailsPoints>
18-
<ContentDetailsText>
19+
<ContentDetailsText
20+
style={{
21+
display: 'flex',
22+
alignItems: 'center',
23+
gap: '7px'
24+
}}
25+
>
26+
<Avatar
27+
src={userProfile?.avatar_url}
28+
alt={`${userProfile?.first_name} ${userProfile?.last_name}`}
29+
style={{
30+
height: '28px',
31+
width: '28px'
32+
}}
33+
/>
1934
<RedirectLink
2035
href={`https://meshery.layer5.io/user/${details?.user_id}`}
2136
target="_blank"

src/custom/CatalogDetail/style.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,14 @@ export const UnpublishAction = styled('div')<ActionButtonProps>(({ disabled = fa
5555
flex: '1'
5656
}));
5757

58-
export const ContentDetailsText = styled(Typography)(({ theme }) => ({
58+
export const ContentDetailsText = styled(Typography)(({ theme, style }) => ({
5959
fontFamily: 'inherit',
6060
fontSize: '1rem',
6161
color: theme.palette.text.default,
6262
['@media (min-width:1200px)']: {
6363
fontSize: '1'
64-
}
64+
},
65+
...style
6566
}));
6667

6768
export const ContentHeading = styled('div')(() => ({

0 commit comments

Comments
 (0)