From 22666529d7a09e5c687bf3e7b12eb32075261707 Mon Sep 17 00:00:00 2001 From: Kayela Claybon <34044644+kayela-c@users.noreply.github.com> Date: Thu, 15 Jan 2026 17:29:27 -0600 Subject: [PATCH] feat: add Gitea support with new widgets and API integration --- .env | 6 +- README.md | 1 + src/App.tsx | 9 +- src/components/GitHubWidget/index.ts | 2 - .../GitHubCommitItem.tsx | 15 +- .../GitHubWidget.tsx | 56 ++- src/components/GitWidget/GiteaCommitItem.tsx | 55 +++ src/components/GitWidget/GiteaWidget.tsx | 200 +++++++++++ src/components/GitWidget/index.ts | 2 + src/styles/{widget.css => GitHubWidget.css} | 40 +-- src/styles/GiteaWidget.css | 324 ++++++++++++++++++ src/styles/index.css | 2 +- src/utils/giteaApi.ts | 77 +++++ src/utils/githubApi.ts | 27 +- 14 files changed, 738 insertions(+), 78 deletions(-) delete mode 100644 src/components/GitHubWidget/index.ts rename src/components/{GitHubWidget => GitWidget}/GitHubCommitItem.tsx (74%) rename src/components/{GitHubWidget => GitWidget}/GitHubWidget.tsx (51%) create mode 100644 src/components/GitWidget/GiteaCommitItem.tsx create mode 100644 src/components/GitWidget/GiteaWidget.tsx create mode 100644 src/components/GitWidget/index.ts rename src/styles/{widget.css => GitHubWidget.css} (79%) create mode 100644 src/styles/GiteaWidget.css create mode 100644 src/utils/giteaApi.ts diff --git a/.env b/.env index e9b5f94..362de50 100644 --- a/.env +++ b/.env @@ -1 +1,5 @@ -REACT_APP_GITHUB_TOKEN=your_github_token_here \ No newline at end of file +REACT_APP_GITHUB_TOKEN=your_github_token_here +REACT_APP_GITEA_TOKEN=your_gitea_token_here +GITEA_API_URL='https://git.konceptkit.com/' +GITHUB_API_URL='https://api.github.com/' +GITEA_ACCESS_TOKEN='de037d3d8b7268acd0dc734a83799e4f3761bad3' \ No newline at end of file diff --git a/README.md b/README.md index c2214f2..4e95718 100644 --- a/README.md +++ b/README.md @@ -78,3 +78,4 @@ npm install recharts # Commit activity charts npm install react-tooltip # Tooltips for commit details +Is there a limit with gitea Api? \ No newline at end of file diff --git a/src/App.tsx b/src/App.tsx index d091f8a..f38fdfa 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,15 +1,20 @@ // In your main app -import GitHubWidget from "./components/GitHubWidget"; +import { GitHubWidget, GiteaWidget } from "./components/GitWidget"; export default function App() { return (
Error: {error}
{giteaUrl} | Repo: {repo} |
+ Branch: {branch}
+
+ Failed to load commits
+ {error} ++ Ensure: +