Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/app/cypress/component/footer.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ describe('Footer', () => {
it('shows the GitHub star CTA linking to GitHub repo', () => {
cy.get('[data-testid="footer-star-cta"]').should('be.visible');
cy.get('[data-testid="footer-star-cta"]')
.find('a')
.should('have.attr', 'href')
.and('include', 'github.com/SemiAnalysisAI/InferenceX');
});

it('footer star CTA opens in new tab', () => {
cy.get('[data-testid="footer-star-cta"] a').should('have.attr', 'target', '_blank');
cy.get('[data-testid="footer-star-cta"]').should('have.attr', 'target', '_blank');
});

it('shows social share buttons', () => {
Expand Down
24 changes: 11 additions & 13 deletions packages/app/src/components/footer/footer-star-cta.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import { Button } from '@/components/ui/button';
import { track } from '@/lib/analytics';
import { Star } from 'lucide-react';
import Link from 'next/link';
Expand All @@ -8,33 +9,30 @@ import { useGitHubStars } from '@/hooks/api/use-github-stars';

const GITHUB_REPO_URL = 'https://github.com/SemiAnalysisAI/InferenceX';

export function FooterStarCta() {
export function FooterStarButton() {
const { data } = useGitHubStars();
const stars = data?.stars ?? null;

return (
<div
<Button
variant="outline"
size="sm"
className="h-7 gap-1.5 text-xs"
asChild
data-testid="footer-star-cta"
className="flex flex-col items-center gap-3 mb-6 pb-6 border-b border-border/40"
>
<p className="text-sm text-muted-foreground text-center max-w-md">
InferenceX is open source. If this data helps your work, a star on GitHub goes a long way.
</p>
<Link
href={GITHUB_REPO_URL}
target="_blank"
rel="noopener noreferrer"
className="group flex items-center gap-2 px-4 py-2 rounded-md border border-gray-300 dark:border-gray-600 hover:border-primary/50 dark:hover:border-primary/50 hover:bg-primary/5 dark:hover:bg-primary/10 transition-all"
onClick={() => track('footer_star_cta_clicked', { stars: stars ?? 0 })}
>
<Star className="h-4 w-4 text-yellow-500 fill-yellow-500 group-hover:scale-110 transition-transform" />
<span className="text-sm font-medium">Star on GitHub</span>
<Star className="h-3.5 w-3.5 text-yellow-500 fill-yellow-500" />
<span>Star</span>
{stars !== null && (
<span className="text-xs font-semibold text-muted-foreground ml-1">
{stars.toLocaleString()}
</span>
<span className="font-semibold text-muted-foreground">{stars.toLocaleString()}</span>
)}
</Link>
</div>
</Button>
);
}
19 changes: 11 additions & 8 deletions packages/app/src/components/footer/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Link from 'next/link';
import { SocialShareButtons } from '@/components/social-share-buttons';
import { cn } from '@/lib/utils';

import { FooterStarCta } from './footer-star-cta';
import { FooterStarButton } from './footer-star-cta';

export const Footer = () => {
return (
Expand All @@ -30,13 +30,16 @@ export const Footer = () => {
)}
>
<div className="container mx-auto py-8 px-4 flex flex-col items-center justify-center">
{/* GitHub Star CTA */}
<FooterStarCta />

{/* Social Share */}
<div className="flex flex-col items-center gap-2 mb-6 pb-6 border-b border-border/40">
<p className="text-xs text-muted-foreground">Share InferenceX with your network</p>
<SocialShareButtons compact />
{/* Open Source CTA */}
<div className="flex flex-col items-center gap-3 mb-6 pb-6 border-b border-border/40">
<p className="text-sm text-muted-foreground text-center max-w-md">
InferenceX is open source. If this data helps your work, star us or share with your
network.
</p>
<div className="flex items-center gap-1.5">
<FooterStarButton />
<SocialShareButtons compact />
</div>
</div>

{/* Policy Links */}
Expand Down