diff --git a/src/pages/repo/code.tsx b/src/pages/repo/code.tsx index e5263e2..b758f63 100644 --- a/src/pages/repo/code.tsx +++ b/src/pages/repo/code.tsx @@ -2,8 +2,8 @@ import clsx from 'clsx'; import { File, Folder, GitBranch, GitCommitHorizontal, List } from 'lucide-solid'; import { A, useNavigate, useParams } from '@solidjs/router'; import { createQuery, keepPreviousData, useQueryClient } from '@tanstack/solid-query'; -import { For, Match, Show, Switch, createEffect, createMemo, createSignal, type Component } from 'solid-js'; -import { buildBlobDataUrl, decodeBlobText, getRepoBlob, getRepoBranches, getRepoDefaultBranch, getRepoLanguages, getRepoLog, getRepoTags, getRepoTree } from '../../lib/api/repos'; +import { For, Match, Show, Switch, createEffect, createMemo, createSignal, type Accessor, type Component } from 'solid-js'; +import { buildBlobDataUrl, decodeBlobText, getRepoBlob, getRepoBranches, getRepoDefaultBranch, getRepoLanguages, getRepoLog, getRepoTags, getRepoTree, type CommitHeadline } from '../../lib/api/repos'; import { Avatar, ErrorState, PlaceholderAvatar, buttonStyles, cardStyles } from '../../components/common'; import { CloneDropdown, CodeView, FileRow, MarkdownBlock, OverviewFileRow, ReadmeCard, RepoBlobSkeleton, RepoLanguageBarSkeleton, RepoTreeSkeleton } from '../../components/repo'; import { RepoFrame, useRepoQuery } from './shared'; @@ -893,10 +893,11 @@ export const BlobPage: Component = () => { const isSvg = createMemo(() => svgLike(path(), blob.mimeType)); const isVideo = createMemo(() => videoLike(path(), blob.mimeType)); const isImage = createMemo(() => imageLike(path(), blob.mimeType)); - const showingText = createMemo( - () => blob.content !== undefined && !blob.fileTooLarge && (!blob.isBinary || isSvg()), - ); - const lineCount = createMemo(() => countLines(text())); + const showingText = createMemo( + () => blob.content !== undefined && !blob.fileTooLarge && (!blob.isBinary || isSvg()), + ); + const lineCount = createMemo(() => countLines(text())); + const commitLink = (commit: Accessor) => `/${repo.owner.handle}/${repo.slug}/commit/${commit().hash}`; return (
@@ -957,12 +958,12 @@ export const BlobPage: Component = () => { {commit().author?.name || 'unknown author'} · - {commit().message.trim().split('\n')[0]} + {commit().message.trim().split('\n')[0]} · - {formatRelativeTime(commit().when)} + {formatRelativeTime(commit().when)}
{commit().hash.slice(0, 8)}