Skip to content

Commit c422156

Browse files
committed
avoid_gview loading
1 parent 62824de commit c422156

2 files changed

Lines changed: 43 additions & 20 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { render, screen } from "@testing-library/react";
2+
import { describe, expect, it } from "vitest";
3+
4+
import QuickStart from "./QuickStart";
5+
6+
describe("QuickStart", () => {
7+
it("does not auto-load the Google Docs viewer for the tutorial", () => {
8+
render(<QuickStart />);
9+
10+
expect(
11+
document.querySelector('iframe[src*="docs.google.com/gview"]')
12+
).not.toBeInTheDocument();
13+
14+
expect(screen.getByRole("link", { name: /open tutorial/i })).toHaveAttribute(
15+
"href",
16+
"https://github.com/Power-Agent/PowerMCP/blob/main/PowerMCP_Tutorial.pdf"
17+
);
18+
});
19+
});

src/components/sections/QuickStart.tsx

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1-
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
1+
import {
2+
Card,
3+
CardDescription,
4+
CardHeader,
5+
CardTitle,
6+
} from "@/components/ui/card";
27
import { FileText, ExternalLink } from "lucide-react";
38
import { Button } from "@/components/ui/button";
49
import SectionHeader from "./SectionHeader";
510

11+
const tutorialUrl =
12+
"https://github.com/Power-Agent/PowerMCP/blob/main/PowerMCP_Tutorial.pdf";
13+
614
const QuickStart = () => {
715
return (
816
<section id="quick-start" className="py-16 md:py-24 bg-card">
@@ -15,32 +23,28 @@ const QuickStart = () => {
1523
/>
1624

1725
<Card className="overflow-hidden">
18-
<CardHeader className="bg-primary/5 border-b border-border">
19-
<div className="flex items-center justify-between">
26+
<CardHeader className="bg-primary/5">
27+
<div className="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
2028
<div className="flex items-center gap-3">
2129
<FileText className="h-5 w-5 text-primary" />
22-
<CardTitle className="text-lg">PowerMCP Tutorial</CardTitle>
30+
<div>
31+
<CardTitle className="text-lg">PowerMCP Tutorial</CardTitle>
32+
<CardDescription>PowerMCP_Tutorial.pdf</CardDescription>
33+
</div>
2334
</div>
24-
<a
25-
href="https://raw.githubusercontent.com/Power-Agent/PowerMCP/main/PowerMCP_Tutorial.pdf"
26-
target="_blank"
27-
rel="noopener noreferrer"
35+
<Button
36+
asChild
37+
variant="outline"
38+
size="sm"
39+
className="gap-2 self-start sm:self-auto"
2840
>
29-
<Button variant="outline" size="sm" className="gap-2">
41+
<a href={tutorialUrl} target="_blank" rel="noopener noreferrer">
3042
<ExternalLink className="h-4 w-4" />
31-
Open PDF
32-
</Button>
33-
</a>
43+
Open tutorial
44+
</a>
45+
</Button>
3446
</div>
3547
</CardHeader>
36-
<CardContent className="p-0">
37-
<iframe
38-
className="w-full border-0"
39-
style={{ height: "70vh" }}
40-
src="https://docs.google.com/gview?url=https://raw.githubusercontent.com/Power-Agent/PowerMCP/main/PowerMCP_Tutorial.pdf&embedded=true"
41-
title="PowerMCP Tutorial"
42-
/>
43-
</CardContent>
4448
</Card>
4549
</div>
4650
</div>

0 commit comments

Comments
 (0)