diff --git a/src/pages/launcher/LauncherSourcePage.tsx b/src/pages/launcher/LauncherSourcePage.tsx index c378732..d085b30 100644 --- a/src/pages/launcher/LauncherSourcePage.tsx +++ b/src/pages/launcher/LauncherSourcePage.tsx @@ -9,7 +9,7 @@ import { LoadingModal, useMinimumLoading } from '../operations/operation-utils'; import { getLauncherSource, getGiteaCommitDiff, - listGiteaCommits, + listGiteaCommitsPage, listLauncherVersions, listPlatformRepos, updateLauncherSource, @@ -130,6 +130,42 @@ function commitRangeSince(range: CommitRange) { return date.toISOString(); } +function diffLineClass(line: string) { + if (line.startsWith('+++') || line.startsWith('---')) { + return 'bg-sky-500/10 text-sky-200'; + } + if (line.startsWith('@@')) { + return 'bg-violet-500/15 text-violet-200'; + } + if (line.startsWith('+')) { + return 'bg-emerald-500/15 text-emerald-100'; + } + if (line.startsWith('-')) { + return 'bg-rose-500/15 text-rose-100'; + } + if (line.startsWith('diff --git') || line.startsWith('index ')) { + return 'bg-muted/40 text-foreground'; + } + return 'text-muted-foreground'; +} + +function DiffViewer({ diff }: { diff: string }) { + const lines = diff ? diff.split(/\r?\n/) : ['표시할 변경 내역이 없습니다.']; + + return ( +
{line || ' '}
+
- {diffContent || '표시할 변경 내역이 없습니다.'}
-
+