Skip to content

Commit

Permalink
Add Star Btn
Browse files Browse the repository at this point in the history
  • Loading branch information
devXprite committed Jun 1, 2024
1 parent fa3db46 commit d0c7b49
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 49 deletions.
32 changes: 0 additions & 32 deletions app/globals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,38 +59,6 @@
}
}

.github-corner {
&:hover {
.octo-arm {
animation: octocat-wave 560ms ease-in-out;
}
}

@media (max-width: 500px) {
&:hover .octo-arm {
animation: none;
}
& .octo-arm {
animation: octocat-wave 560ms ease-in-out;
}
}

@keyframes octocat-wave {
0%,
100% {
transform: rotate(0);
}
20%,
60% {
transform: rotate(-25deg);
}
40%,
80% {
transform: rotate(10deg);
}
}
}

.level {
@apply h-2 w-full cursor-pointer transition-all hover:scale-125 hover:border hover:border-white lg:h-3 lg:rounded-[1px];
&-NONE {
Expand Down
6 changes: 3 additions & 3 deletions app/sitemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import RecentProfiles from '@/models/RecentProfiles';

export default async function sitemap() {
await connectDb();
const recenetProfiles = await RecentProfiles.find({}).sort().limit(250);
const recenetProfiles = await RecentProfiles.find({}).sort().limit(1000);
const baseUrl = process.env.BASE_URL;

const sitemapProfils = recenetProfiles.map(profile => ({
url: `${baseUrl}/${profile.username}`,
changefreq: 'monthly',
priority: 0.7,
changefreq: 'weekly',
priority: 0.9,
}));

const sitemap = [
Expand Down
53 changes: 39 additions & 14 deletions components/Header.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,53 @@
import githubGraphql from '@/utils/githubGraphql';
import { unstable_cache } from 'next/cache';
import Link from 'next/link';
import { FaGithub, FaStar } from 'react-icons/fa';

const getStars = unstable_cache(
async () => {
try {
const response = await githubGraphql({
query: `
query {
repository(owner: "devxprite", name: "gitglance") {
stargazerCount
}
}
`,
});
return response?.repository?.stargazerCount || 50;
} catch (error) {
console.log(error);
return 50;
}
},
['stars'],
{
tags: ['stars'],
revalidate: 60 * 60 * 1,
},
);

const Header = async () => {
const stars = await getStars();

const Header = () => {
return (
<header className=" border-gray-700 bg-gray-900 px-3 py-3">
<div className="mx-auto flex max-w-screen-xl items-center">
<Link href="/" className="text-gradient text-xl font-bold">
Git Glance
</Link>
{/* <img
className="ml-auto h-9"
src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=434915&theme=neutral" alt="" /> */}

<a
href="https://www.producthunt.com/posts/gitglance?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-gitglance"
href="https://github.com/devxprite/gitglance"
target="_blank"
className='ml-auto'
className="ml-auto flex items-center overflow-hidden rounded bg-gray-50 text-sm font-bold text-gray-700 md:text-base "
>
<img
src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=450495&theme=neutral"
alt="GitGlance - Tool&#0032;for&#0032;visualizing&#0032;a&#0032;developer&#0039;s&#0032;GitHub&#0032;profile | Product Hunt"
// style="width: 250px; height: 54px;"
// width="250"
// height="54"
className="h-9"
/>
<span className="flex items-center gap-2 px-2 py-1 md:px-2.5 md:py-1.5">
<FaStar className="md:text-xl" />
<span>Star Us</span>
</span>
<span className="bg-gray-200 px-2 py-1 md:px-2.5 md:py-1.5">{stars}</span>
</a>
</div>
</header>
Expand Down

0 comments on commit d0c7b49

Please sign in to comment.