Skip to content

Commit

Permalink
Merge branch 'next' into fix/reflections-not-displaying
Browse files Browse the repository at this point in the history
  • Loading branch information
themonster2015 committed May 20, 2024
2 parents 6c072fe + 749d7db commit 4e1ae27
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ const ConnectWallet: React.FC = () => {
{authenticationError && (
<ConnectErrorCard
title={t('Request Rejected!')}
message={authenticationError.message}
message={t('You have rejected the request. Please try again!')}
action={{ onClick: handleSignInRetry, label: t('Retry Request') }}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ const SidebarComponent: React.FC<unknown> = () => {
});
};

const handleAvatarClick = function (did: string) {
if (!did) {
const handleAvatarClick = (id: string) => {
if (!id) {
return;
}
routing?.navigateTo({
appName: '@akashaorg/app-profile',
getNavigationUrl: navRoutes => `${navRoutes.rootRoute}/${did}`,
getNavigationUrl: routes => `${routes.rootRoute}/${id}`,
});

if (isMobile) {
Expand Down
24 changes: 14 additions & 10 deletions libs/design-system-core/src/components/Avatar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
getImageFromSeed,
} from '../../utils';
import { type Image } from '@akashaorg/typings/lib/ui';
import Card from '../Card';

export type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';

Expand All @@ -29,12 +30,12 @@ type AvatarContentProps = {
profileId?: string | null;
publicImgPath?: string;
customStyle?: string;
onClick?: React.MouseEventHandler;
};

export type AvatarProps = AvatarContentProps & {
dataTestId?: string;
href?: string;
onClick?: React.MouseEventHandler<HTMLAnchorElement>;
};

const AvatarContent: React.FC<AvatarContentProps> = props => {
Expand All @@ -51,6 +52,7 @@ const AvatarContent: React.FC<AvatarContentProps> = props => {
profileId = '0x0000000000000000000000000000000',
publicImgPath = '/images',
customStyle = '',
onClick,
} = props;

const seed = getImageFromSeed(profileId, 7);
Expand All @@ -68,14 +70,16 @@ const AvatarContent: React.FC<AvatarContentProps> = props => {
const activeOverlayClass = generateActiveOverlayClass();

return (
<Stack customStyle={containerStyle}>
{(avatar || avatarFallback) && (
<React.Suspense fallback={<></>}>
<AvatarImage url={avatar?.src} alt={alt} fallbackUrl={avatarFallback} faded={faded} />
</React.Suspense>
)}
{active && <Stack customStyle={activeOverlayClass} />}
</Stack>
<Card type="plain" onClick={onClick}>
<Stack customStyle={containerStyle}>
{(avatar || avatarFallback) && (
<React.Suspense fallback={<></>}>
<AvatarImage url={avatar?.src} alt={alt} fallbackUrl={avatarFallback} faded={faded} />
</React.Suspense>
)}
{active && <Stack customStyle={activeOverlayClass} />}
</Stack>
</Card>
);
};

Expand All @@ -96,7 +100,7 @@ const Avatar: React.FC<AvatarProps> = props => {
);
}

return <AvatarContent {...rest} />;
return <AvatarContent onClick={onClick} {...rest} />;
};

export default Avatar;

0 comments on commit 4e1ae27

Please sign in to comment.