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

fix: add max-w-fit classname to avatar components #2982

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const AchievementAvatar: FC<AchievementAvatarProps> = ({
return (
<a
href={route('achievement.show', { achievement: id })}
className="flex items-center gap-2"
className="flex max-w-fit items-center gap-2"
{...(hasTooltip ? cardTooltipProps : undefined)}
>
{showImage ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ export const ActivePlayerFeedList: FC<ActivePlayerFeedListProps> = ({ onLoadMore
</div>

<div className="flex flex-col">
<div className="max-w-fit">
<GameAvatar {...player.game} showImage={false} />
</div>
<GameAvatar {...player.game} showImage={false} />

<p className="line-clamp-1 text-2xs" style={{ wordBreak: 'break-word' }}>
<RichPresenceMessage
Expand Down
2 changes: 1 addition & 1 deletion resources/js/common/components/GameAvatar/GameAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const GameAvatar: FC<GameAvatarProps> = ({
return (
<Wrapper
href={shouldLink ? route('game.show', { game: id }) : undefined}
className="flex items-center gap-2"
className="flex max-w-fit items-center gap-2"
{...(hasTooltip && shouldLink ? cardTooltipProps : undefined)}
>
{showImage ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const MultilineGameAvatar: FC<MultilineGameAvatarProps> = ({
});

return (
<div className="relative flex items-center gap-x-2">
<div className="relative flex max-w-fit items-center gap-x-2">
{/* Keep the image and game title in a single tooltipped container. Do not tooltip the system name. */}
<a href={route('game.show', { game: id })} {...(hasTooltip ? cardTooltipProps : undefined)}>
<img
Expand Down
2 changes: 1 addition & 1 deletion resources/js/common/components/UserAvatar/UserAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const UserAvatar: FC<UserAvatarProps> = ({
return (
<Wrapper
href={canLinkToUser ? route('user.show', [displayName]) : undefined}
className="flex items-center gap-2"
className="flex max-w-fit items-center gap-2"
{...(hasTooltip && canLinkToUser ? cardTooltipProps : undefined)}
>
{showImage ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function buildTitleColumnDef({

cell: ({ row }) => {
return (
<div className="min-w-[180px] max-w-fit">
<div className="min-w-[180px]">
<div className="max-w-[400px]">
<GameAvatar
{...row.original.game}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ export const TopAchieversList: FC = () => {
<BaseTableCell>{formatNumber(achiever.rank)}</BaseTableCell>

<BaseTableCell>
<div className="max-w-fit">
<UserAvatar {...achiever.user} size={32} />
</div>
<UserAvatar {...achiever.user} size={32} />
</BaseTableCell>

<BaseTableCell>
Expand Down