Skip to content
This repository was archived by the owner on Aug 2, 2025. It is now read-only.

Commit 5f49cc6

Browse files
committed
fix: add open pdf button fallback
1 parent a2e5270 commit 5f49cc6

File tree

2 files changed

+32
-20
lines changed

2 files changed

+32
-20
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "timetabl-app",
3-
"version": "1.3.2-beta",
3+
"version": "1.3.3-beta",
44
"description": "",
55
"main": "index.js",
66
"scripts": {
Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
1-
import { chakra, Heading, Link } from "@chakra-ui/react";
1+
import { Button, chakra, Heading } from "@chakra-ui/react";
2+
import { useState } from "react";
23

3-
export default () => (
4-
<>
5-
<Heading fontFamily="Poppins, sans-serif" size="md">
6-
Latest High Notes
7-
</Heading>
8-
<chakra.object
9-
data="https://sbhs.co/hnpdf"
10-
type="application/pdf"
11-
width="100%"
12-
height="100%"
13-
p={8}
14-
>
15-
<Link isExternal href="https://sbhs.co/hnpdf">
16-
Find PDF here
17-
</Link>
18-
</chakra.object>
19-
</>
20-
);
4+
export default () => {
5+
const [isLoading, setIsLoading] = useState(false);
6+
7+
return (
8+
<>
9+
<Heading fontFamily="Poppins, sans-serif" size="md">
10+
Latest High Notes
11+
</Heading>
12+
<chakra.object
13+
data="https://sbhs.co/hnpdf"
14+
type="application/pdf"
15+
width="100%"
16+
height="100%"
17+
p={8}
18+
>
19+
<Button
20+
as="a"
21+
mt={5}
22+
href="https://sbhs.co/hnpdf"
23+
isLoading={isLoading}
24+
loadingText="Opening PDF..."
25+
onClick={() => setIsLoading(true)}
26+
>
27+
Open PDF
28+
</Button>
29+
</chakra.object>
30+
</>
31+
);
32+
};

0 commit comments

Comments
 (0)