Skip to content

Commit 0c3412f

Browse files
committed
replace SocialShareButtons with individual ShareTwitterButton and ShareLinkedInButton
1 parent 855c30f commit 0c3412f

10 files changed

Lines changed: 42 additions & 94 deletions

File tree

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,29 @@
1-
import { SocialShareButtons } from '@/components/social-share-buttons';
1+
import { ShareTwitterButton, ShareLinkedInButton } from '@/components/share-buttons';
22

3-
describe('Social Share Buttons', () => {
4-
beforeEach(() => {
5-
cy.mount(<SocialShareButtons />);
6-
});
7-
8-
it('social share buttons container is visible', () => {
9-
cy.get('[data-testid="social-share-buttons"]').should('be.visible');
10-
});
11-
12-
it('Twitter share button is present and is a button element', () => {
3+
describe('Share Buttons', () => {
4+
it('Twitter share button renders and is a button element', () => {
5+
cy.mount(<ShareTwitterButton />);
136
cy.get('[data-testid="share-twitter"]').should('exist');
147
cy.get('[data-testid="share-twitter"]').should('have.prop', 'tagName', 'BUTTON');
158
});
169

17-
it('LinkedIn share button is present and is a button element', () => {
18-
cy.get('[data-testid="share-linkedin"]').should('exist');
19-
cy.get('[data-testid="share-linkedin"]').should('have.prop', 'tagName', 'BUTTON');
20-
});
21-
2210
it('Twitter share button has a descriptive title referencing Twitter or X', () => {
11+
cy.mount(<ShareTwitterButton />);
2312
cy.get('[data-testid="share-twitter"]')
2413
.should('have.attr', 'title')
2514
.and('match', /Twitter|X/i);
2615
});
2716

17+
it('LinkedIn share button renders and is a button element', () => {
18+
cy.mount(<ShareLinkedInButton />);
19+
cy.get('[data-testid="share-linkedin"]').should('exist');
20+
cy.get('[data-testid="share-linkedin"]').should('have.prop', 'tagName', 'BUTTON');
21+
});
22+
2823
it('LinkedIn share button has a descriptive title referencing LinkedIn', () => {
24+
cy.mount(<ShareLinkedInButton />);
2925
cy.get('[data-testid="share-linkedin"]')
3026
.should('have.attr', 'title')
3127
.and('include', 'LinkedIn');
3228
});
3329
});
34-
35-
describe('Social Share Buttons (compact)', () => {
36-
it('renders in compact mode', () => {
37-
cy.mount(<SocialShareButtons compact />);
38-
cy.get('[data-testid="social-share-buttons"]').should('be.visible');
39-
cy.get('[data-testid="share-twitter"]').should('exist');
40-
cy.get('[data-testid="share-linkedin"]').should('exist');
41-
});
42-
});

packages/app/src/components/calculator/ThroughputCalculatorDisplay.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { ExternalLinkIcon } from '@/components/ui/external-link-icon';
2020
import { Input } from '@/components/ui/input';
2121
import { LabelWithTooltip } from '@/components/ui/label-with-tooltip';
2222
import { ShareButton } from '@/components/ui/share-button';
23-
import { SocialShareButtons } from '@/components/social-share-buttons';
23+
import { ShareTwitterButton, ShareLinkedInButton } from '@/components/share-buttons';
2424
import { TooltipProvider } from '@/components/ui/tooltip';
2525
import {
2626
Select,
@@ -501,7 +501,10 @@ export default function ThroughputCalculatorDisplay() {
501501
</div>
502502
<div className="flex items-center gap-1.5">
503503
<ShareButton />
504-
<SocialShareButtons compact className="hidden sm:flex" />
504+
<div className="hidden sm:flex items-center gap-1.5">
505+
<ShareTwitterButton />
506+
<ShareLinkedInButton />
507+
</div>
505508
</div>
506509
</div>
507510

packages/app/src/components/evaluation/ui/ChartDisplay.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { useEvaluation } from '@/components/evaluation/EvaluationContext';
66
import { Card } from '@/components/ui/card';
77
import { ChartSection } from '@/components/ui/chart-section';
88
import { ShareButton } from '@/components/ui/share-button';
9-
import { SocialShareButtons } from '@/components/social-share-buttons';
9+
import { ShareTwitterButton, ShareLinkedInButton } from '@/components/share-buttons';
1010
import { isModelExperimental, Model } from '@/lib/data-mappings';
1111
import { exportToCsv } from '@/lib/csv-export';
1212
import { evaluationChartToCsv } from '@/lib/csv-export-helpers';
@@ -39,7 +39,10 @@ export default function EvaluationChartDisplay() {
3939
</div>
4040
<div className="flex items-center gap-1.5">
4141
<ShareButton />
42-
<SocialShareButtons compact className="hidden sm:flex" />
42+
<div className="hidden sm:flex items-center gap-1.5">
43+
<ShareTwitterButton />
44+
<ShareLinkedInButton />
45+
</div>
4346
</div>
4447
</div>
4548
<EvaluationChartControls />

packages/app/src/components/footer/footer-star-cta.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,3 @@ export function StarButton() {
3131
</Button>
3232
);
3333
}
34-
35-
/** @deprecated Use StarButton instead */
36-
export const FooterStarButton = StarButton;

packages/app/src/components/gpu-specs/gpu-specs-content.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { BarChart3, Radar, Table2 } from 'lucide-react';
66

77
import { Card } from '@/components/ui/card';
88
import { ShareButton } from '@/components/ui/share-button';
9-
import { SocialShareButtons } from '@/components/social-share-buttons';
9+
import { ShareTwitterButton, ShareLinkedInButton } from '@/components/share-buttons';
1010
import {
1111
formatTflops,
1212
getScaleUpDomainMemory,
@@ -293,7 +293,10 @@ export function GpuSpecsContent() {
293293
</div>
294294
<div className="flex items-center gap-1.5">
295295
<ShareButton />
296-
<SocialShareButtons compact className="hidden sm:flex" />
296+
<div className="hidden sm:flex items-center gap-1.5">
297+
<ShareTwitterButton />
298+
<ShareLinkedInButton />
299+
</div>
297300
</div>
298301
</div>
299302
</Card>

packages/app/src/components/inference/ui/ChartDisplay.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
} from '@/components/ui/dialog';
2323
import { ExternalLinkIcon } from '@/components/ui/external-link-icon';
2424
import { ShareButton } from '@/components/ui/share-button';
25-
import { SocialShareButtons } from '@/components/social-share-buttons';
25+
import { ShareTwitterButton, ShareLinkedInButton } from '@/components/share-buttons';
2626
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
2727
import { Skeleton } from '@/components/ui/skeleton';
2828
import { useUnofficialRun } from '@/components/unofficial-run-provider';
@@ -666,7 +666,10 @@ export default function ChartDisplay() {
666666
</div>
667667
<div className="flex items-center gap-1.5">
668668
<ShareButton />
669-
<SocialShareButtons compact className="hidden sm:flex" />
669+
<div className="hidden sm:flex items-center gap-1.5">
670+
<ShareTwitterButton />
671+
<ShareLinkedInButton />
672+
</div>
670673
</div>
671674
</div>
672675
<ChartControls intermediateDates={intermediateDates} />

packages/app/src/components/reliability/ui/ChartDisplay.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { useReliabilityContext } from '@/components/reliability/ReliabilityConte
66
import { Card } from '@/components/ui/card';
77
import { ChartSection } from '@/components/ui/chart-section';
88
import { ShareButton } from '@/components/ui/share-button';
9-
import { SocialShareButtons } from '@/components/social-share-buttons';
9+
import { ShareTwitterButton, ShareLinkedInButton } from '@/components/share-buttons';
1010
import { exportToCsv } from '@/lib/csv-export';
1111
import { reliabilityChartToCsv } from '@/lib/csv-export-helpers';
1212

@@ -37,7 +37,10 @@ export default function ReliabilityChartDisplay() {
3737
</div>
3838
<div className="flex items-center gap-1.5">
3939
<ShareButton />
40-
<SocialShareButtons compact className="hidden sm:flex" />
40+
<div className="hidden sm:flex items-center gap-1.5">
41+
<ShareTwitterButton />
42+
<ShareLinkedInButton />
43+
</div>
4144
</div>
4245
</div>
4346
<ReliabilityChartControls />

packages/app/src/components/social-share-buttons.test.ts

Lines changed: 0 additions & 34 deletions
This file was deleted.

packages/app/src/components/social-share-buttons.tsx

Lines changed: 0 additions & 20 deletions
This file was deleted.

packages/app/src/components/trends/HistoricalTrendsDisplay.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { ExternalLinkIcon } from '@/components/ui/external-link-icon';
1919
import { Input } from '@/components/ui/input';
2020
import { LabelWithTooltip } from '@/components/ui/label-with-tooltip';
2121
import { ShareButton } from '@/components/ui/share-button';
22-
import { SocialShareButtons } from '@/components/social-share-buttons';
22+
import { ShareTwitterButton, ShareLinkedInButton } from '@/components/share-buttons';
2323
import { TooltipProvider } from '@/components/ui/tooltip';
2424
import { Skeleton } from '@/components/ui/skeleton';
2525
import { getModelSortIndex, GPU_SPECS } from '@/lib/constants';
@@ -202,7 +202,10 @@ export default function HistoricalTrendsDisplay() {
202202
</div>
203203
<div className="flex items-center gap-1.5">
204204
<ShareButton />
205-
<SocialShareButtons compact className="hidden sm:flex" />
205+
<div className="hidden sm:flex items-center gap-1.5">
206+
<ShareTwitterButton />
207+
<ShareLinkedInButton />
208+
</div>
206209
</div>
207210
</div>
208211
<ChartControls hideGpuComparison />

0 commit comments

Comments
 (0)