Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make avatars clickable #3198

Merged
merged 3 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/components/frame/v5/pages/TeamsPage/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ export const useTeams = () => {
]
: []),
],
searchParams: {
team: `?${TEAM_SEARCH_PARAM}=${nativeId}`,
},
},
];
}, []) || [];
Expand Down
17 changes: 14 additions & 3 deletions src/components/v5/common/TeamCard/TeamCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { Cardholder } from '@phosphor-icons/react';
import clsx from 'clsx';
import React, { type FC } from 'react';

import { useColonyContext } from '~context/ColonyContext/ColonyContext.ts';
import { useMobile } from '~hooks/index.ts';
import { COLONY_CONTRIBUTORS_ROUTE } from '~routes';
import Tooltip from '~shared/Extensions/Tooltip/index.ts';
import { SpinnerLoader } from '~shared/Preloaders/index.ts';
import Card from '~v5/shared/Card/index.ts';
Expand All @@ -25,9 +27,13 @@ const TeamCard: FC<TeamCardProps> = ({
meatBallMenuProps,
links,
balance,
searchParams,
className,
}) => {
const isMobile = useMobile();
const {
colony: { name: colonyName },
} = useColonyContext();

return (
<Card
Expand Down Expand Up @@ -70,9 +76,14 @@ const TeamCard: FC<TeamCardProps> = ({
/>
</div>
) : (
<>
<Link
to={{
pathname: `/${colonyName}/${COLONY_CONTRIBUTORS_ROUTE}`,
search: `${searchParams?.team}`,
}}
>
{!!members?.length && (
<div className="ml-auto flex-shrink-0">
<div className="group ml-auto flex-shrink-0">
<UserAvatars
maxAvatarsToShow={4}
className="[&_.placeholder]:bg-gray-200 [&_.placeholder]:text-gray-900"
Expand All @@ -81,7 +92,7 @@ const TeamCard: FC<TeamCardProps> = ({
/>
</div>
)}
</>
</Link>
)}
</div>
{description ? (
Expand Down
3 changes: 3 additions & 0 deletions src/components/v5/common/TeamCard/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@ export interface TeamCardProps {
links?: (LinkProps & {
key: string;
})[];
searchParams?: {
team: string;
};
className?: string;
}
4 changes: 2 additions & 2 deletions src/components/v5/shared/UserAvatars/UserAvatars.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const UserAvatars: FC<UserAvatarsProps> = ({
userName={slicedAvatar.profile?.displayName ?? undefined}
size={size}
className={clsx(
'rounded-full border border-base-white bg-base-white',
'rounded-full border border-base-white bg-base-white group-hover:border-blue-400',
{
'border-2': withThickerBorder,
},
Expand All @@ -52,7 +52,7 @@ const UserAvatars: FC<UserAvatarsProps> = ({
userAddress={ADDRESS_ZERO}
size={size}
className={clsx(
'rounded-full border border-base-white bg-base-white',
'rounded-full border border-base-white bg-base-white group-hover:border-blue-400',
{
'border-2': withThickerBorder,
},
Expand Down
Loading