Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 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
19 changes: 11 additions & 8 deletions frontend/src/components/RecentReleases.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,24 @@ const RecentReleases: React.FC<RecentReleasesProps> = ({
<div key={index} className="mb-4 w-full rounded-lg bg-gray-200 p-4 dark:bg-gray-700">
<div className="flex w-full flex-col justify-between">
<div className="flex w-full items-center">
{showAvatar && (
{showAvatar && item?.author && (
<Tooltip
closeDelay={100}
content={item?.author?.name || item?.author?.login}
content={item?.author?.name ?? item?.author?.login}
id={`avatar-tooltip-${index}`}
delay={100}
placement="bottom"
showArrow
>
<Link
className="flex-shrink-0 text-blue-400 hover:underline"
href={`/members/${item?.author?.login}`}
href={item?.author?.login ? `/members/${item?.author?.login}` : '#'}
>
<Image
alt={item?.author?.name || 'author'}
alt={item?.author?.name ?? 'author'}
className="mr-2 h-6 w-6 rounded-full"
height={24}
src={item?.author?.avatarUrl || ''}
src={item?.author?.avatarUrl ?? ''}
width={24}
/>
</Link>
Expand All @@ -67,11 +67,14 @@ const RecentReleases: React.FC<RecentReleasesProps> = ({
<h3 className="flex-1 overflow-hidden text-ellipsis whitespace-nowrap font-semibold">
<Link
className="text-blue-400 hover:underline"
href={item?.url || '/'}
href={
item.url ??
`https://github.com/${item.organizationName}/${item.repositoryName}/releases/tag/${item.tagName}`
}
target="_blank"
rel="noopener noreferrer"
>
<TruncatedText text={item?.name} />
<TruncatedText text={item?.name || item?.tagName} />
</Link>
</h3>
</div>
Expand All @@ -86,7 +89,7 @@ const RecentReleases: React.FC<RecentReleasesProps> = ({
className="cursor-pointer overflow-hidden text-ellipsis whitespace-nowrap text-gray-600 hover:underline dark:text-gray-400"
onClick={() =>
router.push(
`/organizations/${item?.organizationName}/repositories/${item.repositoryName || ''}`
`/organizations/${item?.organizationName}/repositories/${item.repositoryName ?? ''}`
)
}
>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/server/queries/repositoryQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const GET_REPOSITORY_DATA = gql`
name
login
}
url
isPreRelease
name
organizationName
Expand Down