Skip to content

Commit

Permalink
removed github contributions
Browse files Browse the repository at this point in the history
  • Loading branch information
abereghici committed Feb 12, 2023
1 parent 5c77661 commit c7d6bd2
Showing 1 changed file with 8 additions and 48 deletions.
56 changes: 8 additions & 48 deletions app/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,28 @@ import {getAllPosts} from '~/utils/blog.server'

import type {Timings} from '~/utils/metrics.server'
import {getServerTimeHeader} from '~/utils/metrics.server'
import {getFeaturedGithubContributions} from '~/utils/homepage.server'
import GithubRepoCard from '~/components/github-repo-card'
import ResponsiveContainer from '~/components/responsive-container'
import Hero from '~/components/hero'
import BlogPostCard from '~/components/blog-post-card'
import {H2} from '~/components/typography'
import Link from '~/components/link'
import {ServerError} from '~/components/errors'
import type {GitHubRepo, PostItem} from '~/types'
import type {PostItem} from '~/types'

type LoaderData = {
posts: PostItem[]
contributedRepos: GitHubRepo[]
}

export const loader: LoaderFunction = async ({request}) => {
const timings: Timings = {}

const [posts, contributedRepos] = await Promise.all([
getAllPosts({
limit: 3,
request,
timings,
}),
getFeaturedGithubContributions({
request,
timings,
}),
])
const posts = await getAllPosts({
limit: 3,
request,
timings,
})

const data: LoaderData = {posts, contributedRepos}
const data: LoaderData = {posts}
return json(data, {
headers: {
'Server-Timing': getServerTimeHeader(timings),
Expand All @@ -51,7 +42,7 @@ const gradients = [
]

export default function IndexRoute() {
const {posts, contributedRepos} = useLoaderData() as unknown as LoaderData
const {posts} = useLoaderData() as unknown as LoaderData

return (
<ResponsiveContainer>
Expand All @@ -78,37 +69,6 @@ export default function IndexRoute() {
👉
</span>
</Link>

{contributedRepos.length > 0 ? (
<>
<H2 className="mb-5 tracking-tight">GitHub Contributions</H2>
<ul>
{contributedRepos.map((repo: GitHubRepo) => (
<motion.li
whileHover={{scale: 1.02}}
whileTap={{scale: 0.99}}
key={repo.id}
className="w-full"
>
<GithubRepoCard repo={repo} />
</motion.li>
))}
</ul>
<Link
to="/github-activity"
className="flex items-center mb-8 mt-8 h-6 leading-7 rounded-lg transition-all"
>
View all activity
<span
role="img"
aria-label="read-all-posts"
className="ml-2 text-2xl"
>
👉
</span>
</Link>
</>
) : null}
</ResponsiveContainer>
)
}
Expand Down

0 comments on commit c7d6bd2

Please sign in to comment.