Skip to content

Commit ba2a606

Browse files
committed
chore: review comments
1 parent d98dd83 commit ba2a606

File tree

4 files changed

+18
-20
lines changed

4 files changed

+18
-20
lines changed

web-components/src/components/cards/MemberCard/MemberCard.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ export const MemberCard = ({
2121
editText,
2222
linkComponent: LinkComponent,
2323
}: Props) => (
24-
<article className="bg-grey-0 flex flex-col items-center relative px-20 py-40 border border-solid border-sc-card-standard-stroke rounded-[10px] shadow-[0_0_4px_0_rgba(0,0,0,0.05)]">
24+
<article
25+
aria-label={name}
26+
className="bg-grey-0 flex flex-col items-center relative px-20 py-40 border border-solid border-sc-card-standard-stroke rounded-[10px] shadow-[0_0_4px_0_rgba(0,0,0,0.05)]"
27+
>
2528
<UserAvatar src={imageSrc} alt={name} className="w-[120px] h-[120px]" />
2629
<Title className="py-10" variant="h6">
2730
{name}

web-marketplace/src/components/atoms/Link.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,15 @@ const createMuiLink = (
5151
({ href, children, target, ...linkProps }, ref) => {
5252
const locale = useCurrentLocale();
5353
if (!href || typeof href !== 'string') {
54-
// @ts-expect-error
55-
return <Box {...linkProps}>{children}</Box>;
54+
return (
55+
<Box {...linkProps} component="span">
56+
{children}
57+
</Box>
58+
);
5659
}
5760

5861
const isInternalLink = (href: string): boolean =>
5962
!!href && href.startsWith('/');
60-
// const hasAnchor = href?.includes('#');
6163

6264
const internalHref =
6365
applyLocalePrefix && isInternalLink(href)

web-marketplace/src/components/organisms/RegistryLayout/RegistryLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const RegistryLayout = () => {
66
<ScrollRestoration
77
getKey={(location, matches) => {
88
const profileMatch = matches.find(match =>
9-
match.pathname.includes('/profiles/'),
9+
match.pathname.startsWith('/profiles/'),
1010
);
1111
return profileMatch ? profileMatch.pathname : location.key;
1212
}}

web-marketplace/src/legacy-pages/Profile/Profile.tsx

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
import { useMemo, useState } from 'react';
2-
import {
3-
Outlet,
4-
ScrollRestoration,
5-
useLocation,
6-
useNavigate,
7-
useParams,
8-
} from 'react-router-dom';
2+
import { Outlet, useLocation, useParams } from 'react-router-dom';
93
import { msg } from '@lingui/core/macro';
104
import { useLingui } from '@lingui/react';
115
import { Box } from '@mui/material';
@@ -231,7 +225,12 @@ export const Profile = (): JSX.Element => {
231225
description: account?.description?.trimEnd() ?? '',
232226
socialsLinks,
233227
};
234-
const navigate = useNavigate();
228+
229+
const editLink = isOwnProfile
230+
? organization
231+
? '/dashboard/organization/profile'
232+
: '/dashboard/profile'
233+
: '';
235234

236235
return (
237236
<WithLoader
@@ -257,13 +256,7 @@ export const Profile = (): JSX.Element => {
257256
backgroundImage={backgroundImage}
258257
avatar={avatarImage}
259258
infos={infos}
260-
editLink={
261-
isOwnProfile
262-
? organization
263-
? '/dashboard/organization/profile'
264-
: '/dashboard/profile'
265-
: ''
266-
}
259+
editLink={editLink}
267260
profileLink={profileLink}
268261
variant={
269262
account?.type

0 commit comments

Comments
 (0)