Skip to content

Commit 678b8a9

Browse files
committed
refactor: fetch collabydraw repo start count via github api
1 parent aa4ff9d commit 678b8a9

File tree

5 files changed

+23
-6
lines changed

5 files changed

+23
-6
lines changed

apps/collabydraw/app/(auth-layout)/auth/signin/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ export default function SignInPage() {
88
return (
99
<Card className="border-0 shadow-none lg:shadow-2xl rounded-3xl m-0 mx-auto px-6 py-8 lg:p-16 relative z-10 max-w-[480px] bg-yellow-light">
1010
<CardHeader className="p-0">
11-
<CardTitle className="text-2xl font-bold text-center">Hi there!</CardTitle>
12-
<CardDescription className="text-sm pb-4 text-primary text-center">Enter your email to sign in to your account</CardDescription>
11+
<CardTitle className="text-2xl font-bold text-center text-[#0a0a0a]">Hi there!</CardTitle>
12+
<CardDescription className="text-sm pb-4 text-primary text-center text-[#171717]">Enter your email to sign in to your account</CardDescription>
1313
</CardHeader>
1414
<CardContent className="p-0 !my-0">
1515
<Suspense fallback={<ScreenLoading />}>

apps/collabydraw/app/(auth-layout)/auth/signup/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ export default function SignUpPage() {
66
return (
77
<Card className="border-0 shadow-none lg:shadow-2xl rounded-3xl m-0 mx-auto px-6 py-8 lg:p-16 relative z-10 max-w-[480px] bg-yellow-light">
88
<CardHeader className="p-0">
9-
<CardTitle className="text-2xl font-bold text-center">Create an account</CardTitle>
10-
<CardDescription className="text-sm pb-4 text-primary text-center">Enter your email below to create your account</CardDescription>
9+
<CardTitle className="text-2xl font-bold text-center text-[#0a0a0a]">Create an account</CardTitle>
10+
<CardDescription className="text-sm pb-4 text-primary text-center text-[#171717]">Enter your email below to create your account</CardDescription>
1111
</CardHeader>
1212
<CardContent className="p-0 !my-0">
1313
<SignUpForm />

apps/collabydraw/app/globals.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@ h6 {
236236

237237
--form-input: #121212;
238238
--form-input-hover: #141414;
239+
--form-input: #fff;
240+
--form-input-hover: #f1f3f5;
239241
--color-border-input: #212121;
240242
--form-color-text: #ced4da;
241243
--color-primary: #a8a5ff;

apps/collabydraw/components/AppSidebar.tsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ interface SidebarProps {
4949
}
5050

5151
export function AppSidebar({ isOpen, onClose, canvasColor, setCanvasColor, isMobile, roomName, isStandalone, onClearCanvas, onExportCanvas, onImportCanvas }: SidebarProps) {
52+
const [stars, setStars] = useState<number | null>(null);
5253
const [clearDialogOpen, setClearDialogOpen] = useState(false);
5354
const { theme, setTheme } = useTheme();
5455
const { data: session } = useSession();
@@ -83,6 +84,19 @@ export function AppSidebar({ isOpen, onClose, canvasColor, setCanvasColor, isMob
8384
return () => document.body.classList.remove("overflow-hidden")
8485
}, [isOpen])
8586

87+
useEffect(() => {
88+
const fetchRepoMetaData = async () => {
89+
try {
90+
const res = await fetch('https://api.github.com/repos/coderomm/CollabyDraw');
91+
const data = await res.json();
92+
setStars(data.stargazers_count);
93+
} catch (error) {
94+
console.error('Error fetching GitHub repo data:', error);
95+
}
96+
}
97+
fetchRepoMetaData();
98+
}, [])
99+
86100
return (
87101
<>
88102
<ClearCanvasDialog
@@ -136,14 +150,14 @@ export function AppSidebar({ isOpen, onClose, canvasColor, setCanvasColor, isMob
136150
<Link
137151
className={cn(
138152
buttonVariants({ variant: "ghost" }),
139-
"flex flex-row items-center justify-start gap-2 h-10 w-auto rounded-md px-3 text-sm font-medium transition-colors text-color-on-surface hover:text-color-on-surface bg-transparent hover:bg-button-hover-bg focus-visible:shadow-brand-color-shadow focus-visible:outline-none focus-visible:ring-0 active:bg-button-hover-bg active:border active:border-brand-active dark:hover:bg-w-button-hover-bg border border-[#705400] bg-[#FFE599]"
153+
"flex flex-row items-center justify-start gap-2 h-10 w-auto rounded-md px-3 text-sm font-medium transition-colors text-white dark:text-black hover:text-color-on-surface bg-transparent hover:bg-button-hover-bg focus-visible:shadow-brand-color-shadow focus-visible:outline-none focus-visible:ring-0 active:bg-button-hover-bg active:border active:border-brand-active dark:hover:bg-w-button-hover-bg border border-[#705400] bg-[#FFE599]"
140154
)}
141155
href="https://github.com/coderomm/CollabyDraw"
142156
target="_blank"
143157
rel="noopener noreferrer"
144158
title="GitHub"
145159
>
146-
<Github className="h-4 w-4" />GitHub - <span className="flex items-center justify-start gap-1">7<Star className="h-4 w-4" /></span>
160+
<Github className="h-4 w-4" />GitHub - <span className="flex items-center justify-start gap-1">{stars}<Star className="h-4 w-4" /></span>
147161
</Link>
148162
<SidebarLinkItem icon={Twitter} label="Twitter / X" url="https://x.com/1omsharma" />
149163
<SidebarLinkItem icon={Linkedin} label="Linkedin" url="https://www.linkedin.com/in/1omsharma" />

apps/collabydraw/components/canvas/CanvasBoard.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export default function CanvasBoard() {
115115

116116
useEffect(() => {
117117
setCanvasEngineState(prev => ({ ...prev, canvasColor: canvasBgLight[0] }));
118+
console.log('Theme = ', theme)
118119
}, [theme])
119120

120121
useEffect(() => {

0 commit comments

Comments
 (0)