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: コミットデータが0の時の表示を追加 #23

Merged
merged 1 commit into from
Dec 29, 2024
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
4 changes: 3 additions & 1 deletion app/recap/components/graph/languages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ export const LanguagesUsageGraph: FC<Props> = ({ data }) => {
<CardHeader className="items-start pb-0">
<CardTitle>言語の使用率</CardTitle>
<CardDescription>
あなたが最も使用した言語は <b>{limitedData[0].language}</b> です。
{limitedData.length === 0
? "データがありません。"
: `あなたが最も使用した言語は <b>${limitedData[0].language}</b> です。`}
</CardDescription>
</CardHeader>
<CardContent className="flex-1 pb-0">
Expand Down
8 changes: 5 additions & 3 deletions app/recap/components/overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const OverView: FC<Props> = async ({ data }) => {
</CardHeader>
<CardContent className="pr-24 space-y-1">
<div className="text-sm text-muted-foreground font-bold italic truncate">
"{data.userProfile.bio}"
{data.userProfile.bio && "{data.userProfile.bio}"}
Copy link
Preview

Copilot AI Dec 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The string interpolation is incorrect. It should be {data.userProfile.bio} instead of "{data.userProfile.bio}".

Suggested change
{data.userProfile.bio && "{data.userProfile.bio}"}
{data.userProfile.bio && `${data.userProfile.bio}`}

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
</div>
<div className="flex items-center gap-2 text-sm text-muted-foreground truncate">
<UsersRound className="h-4 w-4" />
Expand Down Expand Up @@ -188,8 +188,10 @@ export const OverView: FC<Props> = async ({ data }) => {
<CardHeader>
<CardTitle>リポジトリごとの統計</CardTitle>
<CardDescription>
あなたが最もコミットしたリポジトリは{" "}
<b>{data.repositoriesByCommitCount[0].nameWithOwner}</b> です。
{data.repositoriesByCommitCount.length === 0
? "データがありません。"
: `あなたが最もコミットしたリポジトリは{" "}
<b>${data.repositoriesByCommitCount[0].nameWithOwner}</b> です。`}
</CardDescription>
</CardHeader>
<CardContent>
Expand Down
Loading