Skip to content

Commit 75a9310

Browse files
committed
feat(gitlab): implement support for GitLab PrivateToken
1 parent 5925124 commit 75a9310

File tree

11 files changed

+244
-91
lines changed

11 files changed

+244
-91
lines changed

src/app/about/page.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,20 @@ const AboutPage = () => {
2424

2525
<div className="p-6 space-y-4 transition-colors duration-300">
2626
<p>
27-
RepoTree is a simple tool to visualize GitHub repositories. It helps
27+
RepoTree is a simple tool to visualize GitHub & GitLab repositories. It helps
2828
developers and teams easily explore and understand their project
2929
structures.
3030
</p>
3131

32-
<h2 className="text-xl font-semibold">Our Vision</h2>
33-
<p>
34-
We want every developer to quickly see the structure of any project,
35-
making it easier to collaborate and build efficiently.
36-
</p>
37-
3832
<h2 className="text-xl font-semibold">Features</h2>
3933
<ul className="list-disc pl-6 space-y-2">
40-
<li>Clean ASCII view of GitHub repository structure</li>
34+
<li>Clean ASCII view of GitHub & GitLab repository structure</li>
4135
<li>Interactive tree view for easy navigation</li>
4236
<li>Download options in various formats</li>
4337
<li>Real-time search to find files or folders quickly</li>
38+
<li>Easy to use and no installation required</li>
4439
</ul>
45-
40+
4641
<p>
4742
Whether documenting a project or getting a quick overview, RepoTree
4843
makes it simple to understand your codebase.

src/app/generator/repo-tree-generator.tsx

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type React from "react"
44

55
import { useCallback, useEffect, useMemo, useRef, useState } from "react"
66

7-
import AIFeedback from "@/components/ai-feedback"
7+
// import AIFeedback from "@/components/ai-feedback"
88
import InteractiveTreeView from "@/components/interactive-tree-view"
99
import PrivateReposDialog from "@/components/private-repos-dialog"
1010
import { RepoGraphs } from "@/components/repo-graphs"
@@ -119,7 +119,8 @@ export default function RepoProjectStructure() {
119119

120120
const [fileTypeData, setFileTypeData] = useState<FileTypeData[]>([])
121121
const [languageData, setLanguageData] = useState<LanguageData[]>([])
122-
const [hasPrivateToken, setHasPrivateToken] = useState(false)
122+
const [hasGitHubToken, setHasGitHubToken] = useState(false)
123+
const [hasGitLabToken, setHasGitLabToken] = useState(false)
123124

124125
const handleUrlChange = useCallback(
125126
(e: React.ChangeEvent<HTMLInputElement>) => {
@@ -194,20 +195,24 @@ export default function RepoProjectStructure() {
194195
}, [])
195196

196197
useEffect(() => {
197-
const checkToken = () => {
198-
const token = localStorage.getItem("github_personal_token")
199-
setHasPrivateToken(!!token)
198+
const checkTokens = () => {
199+
const githubToken = localStorage.getItem("github_personal_token")
200+
const gitlabToken = localStorage.getItem("gitlab_personal_token")
201+
setHasGitHubToken(!!githubToken)
202+
setHasGitLabToken(!!gitlabToken)
200203
}
201204

202-
checkToken()
205+
checkTokens()
203206

204207
const handleTokenUpdate = () => {
205-
checkToken()
208+
checkTokens()
206209
}
207210

208211
window.addEventListener("github-token-updated", handleTokenUpdate)
212+
window.addEventListener("gitlab-token-updated", handleTokenUpdate)
209213
return () => {
210214
window.removeEventListener("github-token-updated", handleTokenUpdate)
215+
window.removeEventListener("gitlab-token-updated", handleTokenUpdate)
211216
}
212217
}, [])
213218

@@ -345,15 +350,13 @@ export default function RepoProjectStructure() {
345350
<SelectValue placeholder="Select repo type" />
346351
</SelectTrigger>
347352
<SelectContent>
348-
<SelectItem value="github">GitHub {hasPrivateToken && "(Private)"}</SelectItem>
349-
<SelectItem value="gitlab">GitLab</SelectItem>
353+
<SelectItem value="github">GitHub {hasGitHubToken && "(Private)"}</SelectItem>
354+
<SelectItem value="gitlab">GitLab {hasGitLabToken && "(Private)"}</SelectItem>
350355
</SelectContent>
351356
</Select>
352-
{repoType === "github" && (
353-
<div className="flex items-center gap-2">
354-
<PrivateReposDialog />
355-
</div>
356-
)}
357+
<div className="flex items-center gap-2">
358+
<PrivateReposDialog repoType={repoType} />
359+
</div>
357360
<div className="relative flex-grow">
358361
<Input
359362
placeholder={`Enter ${repoType === "github" ? "GitHub" : "GitLab"} repository URL`}
@@ -518,7 +521,7 @@ export default function RepoProjectStructure() {
518521
<RepoGraphs fileTypeData={fileTypeData} languageData={languageData} />
519522
</div>
520523
)}
521-
<AIFeedback structureMap={structureMap} />
524+
{/* <AIFeedback structureMap={structureMap} /> */}
522525
</div>
523526
</div>
524527
</CardContent>

src/components/about.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ const About = () => {
4343
{
4444
icon: FolderTreeIcon,
4545
title: 'Preview Structure',
46-
description: 'Enter GitHub repo URL to preview structure instantly.',
46+
description: 'Enter a GitHub or GitLab repo URL to instantly preview its structure.',
4747
},
4848
{
4949
icon: DownloadIcon,
5050
title: 'Quick Download',
51-
description: 'Download as README.md with just one click.',
51+
description: 'Download in your chosen format with one click.',
5252
},
5353
{
5454
icon: BookOpenIcon,

src/components/faq.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,17 @@ const FAQ = () => {
5959
{
6060
question: 'How does RepoTree work?',
6161
answer:
62-
'RepoTree fetches the structure of your GitHub repository and generates it into a clean ASCII tree format, making it easy to visualize and share.',
62+
'RepoTree fetches the structure of your GitHub & GitLab repository and generates it into a clean ASCII tree format, making it easy to visualize and share.',
6363
},
6464
{
6565
question: 'Is RepoTree free to use?',
6666
answer:
67-
'Yes, RepoTree is completely free to use for public GitHub repositories.',
67+
'Yes, RepoTree is completely free to use for public GitHub & GitLab repositories.',
6868
},
6969
{
7070
question: 'Can I use RepoTree for private repositories?',
7171
answer:
72-
"Yes, RepoTree now supports private GitHub repositories! You can access them by providing a GitHub Personal Access Token (PAT). Your token is securely stored locally in your browser and never sent to any server.",
72+
"Yes, RepoTree now supports private GitHub & GitLab repositories! You can access them by providing a GitHub Personal Access Token (PAT). Your token is securely stored locally in your browser and never sent to any server.",
7373
},
7474
];
7575

src/components/hero.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,20 @@ const Hero = () => {
2323
variants={fadeIn}
2424
className="text-center"
2525
>
26-
<h1 className="text-4xl sm:text-5xl md:text-6xl lg:text-7xl text-gray-900 dark:text-white font-bold mb-6">
27-
Visualize Your <Highlight>GitHub Repos</Highlight>
26+
<h1 className="text-3xl sm:text-5xl md:text-6xl lg:text-7xl xl:text-7xl text-gray-900 dark:text-white font-bold mb-6 leading-tight">
27+
Visualize Your<br />
28+
<Highlight>GitHub & GitLab Repos</Highlight>
2829
</h1>
29-
<p className="text-xl sm:text-2xl md:text-3xl text-gray-700 dark:text-gray-300 mb-8 sm:mb-10 max-w-3xl mx-auto">
30-
Generate a clean ASCII tree format of any GitHub repository in
30+
<p className="text-base sm:text-lg md:text-xl lg:text-2xl text-gray-700 dark:text-gray-300 mb-8 sm:mb-10 max-w-3xl mx-auto">
31+
Generate a clean ASCII tree format of any GitHub & GitLab repository in
3132
seconds.
3233
</p>
3334
<Link href="/generator">
3435
<Button
3536
size="lg"
3637
className="bg-blue-600 hover:bg-blue-700 text-white text-xl py-5 sm:py-6 px-8 sm:px-10 rounded-full transition-colors duration-300"
3738
>
38-
Get Started
39+
Generate Now
3940
</Button>
4041
</Link>
4142
</motion.div>

src/components/layout/footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const Footer = () => {
1818
</Link>
1919
</div>
2020
<p className="text-sm sm:text-base md:text-lg text-gray-600 dark:text-gray-300">
21-
Simplify your GitHub repository visualization.
21+
Simplify visualization of your GitHub or GitLab repos.
2222
</p>
2323
</div>
2424
<div>

src/components/layout/header.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Link from 'next/link';
22

33
import { FolderTreeIcon, Github } from 'lucide-react';
44

5-
import GitHubHelp from "@/components/github-help"
5+
import RepoHelp from "@/components/repo-help"
66
import ThemeToggle from '../theme-toggle';
77

88
const Header = () => {
@@ -17,7 +17,7 @@ const Header = () => {
1717
</h1>
1818
</Link>
1919
<nav className="flex items-center space-x-4">
20-
<GitHubHelp />
20+
<RepoHelp />
2121
<ThemeToggle />
2222
<a
2323
href="https://github.com/coder-ralph/RepoTree"

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy