Skip to content
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
12 changes: 7 additions & 5 deletions apps/dashboard/src/components/repo/repo-activity-cards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,15 @@ function ActivityCard<T>({
<div className="flex flex-col">
{!items ? (
<ActivityCardSkeleton />
) : items.length === 0 ? (
<p className="px-4 pb-3 text-xs text-muted-foreground">
No open {title.toLowerCase()}
</p>
) : (
<>
{items.map(renderItem)}
{items.length === 0 ? (
<p className="px-4 pb-3 text-xs text-muted-foreground">
No open {title.toLowerCase()}
</p>
) : (
items.map(renderItem)
)}
<Link
to={viewAllHref}
className="border-t px-4 py-2.5 text-center text-xs font-medium text-muted-foreground transition-colors hover:text-foreground"
Expand Down
111 changes: 63 additions & 48 deletions apps/dashboard/src/routes/_protected/$owner/$repo/issues.index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import {
} from "#/components/filters";
import { IssueRow } from "#/components/issues/issue-row";
import { DashboardContentLoading } from "#/components/layouts/dashboard-content-loading";
import { SidePanelPortal } from "#/components/layouts/dashboard-side-panel";
import { Pagination } from "#/components/pagination";
import { RepoActivityCards } from "#/components/repo/repo-activity-cards";
import {
githubIssuesFromRepoQueryOptions,
githubRepoOverviewQueryOptions,
Expand Down Expand Up @@ -100,59 +102,72 @@ function RepoIssuesPage() {
);

const totalLabel = overviewQuery.data?.openIssueCount;
const repoData = overviewQuery.data;

return (
<div className="h-full overflow-auto py-10">
<div className="mx-auto flex min-h-full max-w-4xl flex-col gap-6 px-3 md:px-6">
<div className="flex flex-col gap-2">
<h1 className="text-2xl font-semibold tracking-tight">Issues</h1>
<p className="text-sm text-muted-foreground">
{totalLabel != null ? (
<span className="tabular-nums">{totalLabel} open · </span>
) : null}
<Link
to="/$owner/$repo"
params={{ owner, repo }}
className="text-muted-foreground underline-offset-2 hover:underline"
>
{owner}/{repo}
</Link>
</p>
</div>

<FilterBar state={filterState} />

{query.isLoading ? (
<div className="flex flex-1 items-center justify-center">
<DashboardContentLoading />
</div>
) : (
<div className="flex flex-col gap-1">
{filtered.length === 0 && (
<p className="py-12 text-center text-sm text-muted-foreground">
No issues found.
</p>
)}
{filtered.map((issue) => (
<div
key={issue.id}
style={{
contentVisibility: "auto",
containIntrinsicSize: "auto 52px",
}}
<>
<div className="h-full overflow-auto py-10">
<div className="mx-auto flex min-h-full max-w-4xl flex-col gap-6 px-3 md:px-6">
<div className="flex flex-col gap-2">
<h1 className="text-2xl font-semibold tracking-tight">Issues</h1>
<p className="text-sm text-muted-foreground">
{totalLabel != null ? (
<span className="tabular-nums">{totalLabel} open · </span>
) : null}
<Link
to="/$owner/$repo"
params={{ owner, repo }}
className="text-muted-foreground underline-offset-2 hover:underline"
>
<IssueRow issue={issue} />
</div>
))}
{owner}/{repo}
</Link>
</p>
</div>
)}

<Pagination
page={filterState.page}
hasNextPage={hasNextPage}
onPageChange={filterState.setPage}
/>
<FilterBar state={filterState} />

{query.isLoading ? (
<div className="flex flex-1 items-center justify-center">
<DashboardContentLoading />
</div>
) : (
<div className="flex flex-col gap-1">
{filtered.length === 0 && (
<p className="py-12 text-center text-sm text-muted-foreground">
No issues found.
</p>
)}
{filtered.map((issue) => (
<div
key={issue.id}
style={{
contentVisibility: "auto",
containIntrinsicSize: "auto 52px",
}}
>
<IssueRow issue={issue} />
</div>
))}
</div>
)}

<Pagination
page={filterState.page}
hasNextPage={hasNextPage}
onPageChange={filterState.setPage}
/>
</div>
</div>
</div>
{repoData && (
<SidePanelPortal>
<RepoActivityCards
owner={owner}
repo={repo}
scope={scope}
repoData={repoData}
/>
</SidePanelPortal>
)}
</>
);
}
115 changes: 65 additions & 50 deletions apps/dashboard/src/routes/_protected/$owner/$repo/pulls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ import {
useRepoListFilters,
} from "#/components/filters";
import { DashboardContentLoading } from "#/components/layouts/dashboard-content-loading";
import { SidePanelPortal } from "#/components/layouts/dashboard-side-panel";
import { Pagination } from "#/components/pagination";
import { PullRequestRow } from "#/components/pulls/pull-request-row";
import { RepoActivityCards } from "#/components/repo/repo-activity-cards";
import {
githubPullsFromRepoQueryOptions,
githubRepoOverviewQueryOptions,
Expand Down Expand Up @@ -99,61 +101,74 @@ function RepoPullsPage() {
);

const totalLabel = overviewQuery.data?.openPullCount;
const repoData = overviewQuery.data;

return (
<div className="h-full overflow-auto py-10">
<div className="mx-auto flex min-h-full max-w-4xl flex-col gap-6 px-3 md:px-6">
<div className="flex flex-col gap-2">
<h1 className="text-2xl font-semibold tracking-tight">
Pull Requests
</h1>
<p className="text-sm text-muted-foreground">
{totalLabel != null ? (
<span className="tabular-nums">{totalLabel} open · </span>
) : null}
<Link
to="/$owner/$repo"
params={{ owner, repo }}
className="text-muted-foreground underline-offset-2 hover:underline"
>
{owner}/{repo}
</Link>
</p>
</div>

<FilterBar state={filterState} />

{query.isLoading ? (
<div className="flex flex-1 items-center justify-center">
<DashboardContentLoading />
</div>
) : (
<div className="flex flex-col gap-1">
{filtered.length === 0 && (
<p className="py-12 text-center text-sm text-muted-foreground">
No pull requests found.
</p>
)}
{filtered.map((pr) => (
<div
key={pr.id}
style={{
contentVisibility: "auto",
containIntrinsicSize: "auto 52px",
}}
<>
<div className="h-full overflow-auto py-10">
<div className="mx-auto flex min-h-full max-w-4xl flex-col gap-6 px-3 md:px-6">
<div className="flex flex-col gap-2">
<h1 className="text-2xl font-semibold tracking-tight">
Pull Requests
</h1>
<p className="text-sm text-muted-foreground">
{totalLabel != null ? (
<span className="tabular-nums">{totalLabel} open · </span>
) : null}
<Link
to="/$owner/$repo"
params={{ owner, repo }}
className="text-muted-foreground underline-offset-2 hover:underline"
>
<PullRequestRow pr={pr} scope={scope} />
</div>
))}
{owner}/{repo}
</Link>
</p>
</div>
)}

<Pagination
page={filterState.page}
hasNextPage={hasNextPage}
onPageChange={filterState.setPage}
/>
<FilterBar state={filterState} />

{query.isLoading ? (
<div className="flex flex-1 items-center justify-center">
<DashboardContentLoading />
</div>
) : (
<div className="flex flex-col gap-1">
{filtered.length === 0 && (
<p className="py-12 text-center text-sm text-muted-foreground">
No pull requests found.
</p>
)}
{filtered.map((pr) => (
<div
key={pr.id}
style={{
contentVisibility: "auto",
containIntrinsicSize: "auto 52px",
}}
>
<PullRequestRow pr={pr} scope={scope} />
</div>
))}
</div>
)}

<Pagination
page={filterState.page}
hasNextPage={hasNextPage}
onPageChange={filterState.setPage}
/>
</div>
</div>
</div>
{repoData && (
<SidePanelPortal>
<RepoActivityCards
owner={owner}
repo={repo}
scope={scope}
repoData={repoData}
/>
</SidePanelPortal>
)}
</>
);
}
Loading