-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sponsor): update sponsor page and buttons
- Loading branch information
Showing
6 changed files
with
127 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export const Individual = [ | ||
{ | ||
name: "rds_agi - rudrodip", | ||
url: "https://github.com/rudrodip", | ||
avatar: "https://github.com/rudrodip.png", | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
"use client"; | ||
|
||
import { useCallback } from "react"; | ||
|
||
export default function StarButtonClient({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
const handleClick = useCallback(() => { | ||
window.open("https://github.com/ruru-m07/ruru-ui", "_blank"); | ||
}, []); | ||
|
||
return <div onClick={handleClick}>{children}</div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { cn } from "@/utils/utils"; | ||
import { Star } from "lucide-react"; | ||
import React from "react"; | ||
|
||
const stargazers_count = async (): Promise<number> => { | ||
return fetch("https://api.github.com/repos/ruru-m07/ruru-ui") | ||
.then((response) => response.json()) | ||
.then((data) => { | ||
return data.stargazers_count; | ||
}); | ||
}; | ||
|
||
const StarButton = async () => { | ||
let stargazersCount: number = await stargazers_count(); | ||
|
||
return ( | ||
<button | ||
className={cn( | ||
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", | ||
"border bg-gradient-to-t from-primary/10 shadow-inner shadow-primary/10 hover:bg-accent/50 hover:text-accent-foreground", | ||
"h-10 px-4 py-2", | ||
)} | ||
> | ||
<Star | ||
className="-ms-1 me-2 opacity-60" | ||
size={16} | ||
strokeWidth={2} | ||
aria-hidden="true" | ||
/> | ||
<span className="flex items-baseline gap-2"> | ||
Star | ||
<span className="text-xs text-primary/60">{stargazersCount}</span> | ||
</span> | ||
</button> | ||
); | ||
}; | ||
|
||
export default StarButton; |