Skip to content

Commit

Permalink
remove unused counter component
Browse files Browse the repository at this point in the history
  • Loading branch information
erquhart committed Nov 28, 2024
1 parent 11fbab1 commit 531074b
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions app/routes/_libraries/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ import {
} from '@tanstack/react-router'
import { useSuspenseQuery } from '@tanstack/react-query'
import { convexQuery } from '@convex-dev/react-query'
import {
useNpmDownloadCounter,
useGithubDependentCounter,
} from '@erquhart/convex-oss-stats/react'
import { useNpmDownloadCounter } from '@erquhart/convex-oss-stats/react'
import NumberFlow from '@number-flow/react'
import { api } from '../../convex/_generated/api'
import { api } from '../../../convex/_generated/api'
import { Carbon } from '~/components/Carbon'
import { twMerge } from 'tailwind-merge'
import { CgSpinner } from 'react-icons/cg'
Expand All @@ -30,7 +27,6 @@ import bytesImage from '~/images/bytes.svg'
// import background from '~/images/background.jpg'
import { partners } from '../../utils/partners'
import { FaCube, FaDownload, FaStar, FaUsers } from 'react-icons/fa'
import { PropsWithChildren } from 'react'

export const textColors = [
`text-rose-500`,
Expand Down Expand Up @@ -82,6 +78,8 @@ async function bytesSignupServerFn({ email }: { email: string }) {

const librariesRouteApi = getRouteApi('/_libraries')

// Will also be used for GitHub dependent count once
// useGithubDependentCounter is fixed upstream
const StableCounter = ({ value }: { value?: number }) => {
const dummyString = Number(
Array(value?.toString().length ?? 1)
Expand Down Expand Up @@ -119,17 +117,6 @@ const NpmDownloadCounter = ({
return <StableCounter value={liveNpmDownloadCount} />
}

// TODO: Use this once useGithubDependentCounter is fixed upstream
const GitHubDependentCounter = ({
githubData,
}: {
githubData: Parameters<typeof useGithubDependentCounter>[0]
}) => {
const liveGitHubDependentCount = useGithubDependentCounter(githubData)
console.log('liveGitHubDependentCount', liveGitHubDependentCount)
return <StableCounter value={liveGitHubDependentCount} />
}

const OssStats = () => {
const { data: github } = useSuspenseQuery(
convexQuery(api.stats.getGithubOwner, {
Expand Down

0 comments on commit 531074b

Please sign in to comment.