Skip to content

Commit 4b5beb1

Browse files
committed
Add Download as Zip button
Co-authored-by: Josh Sandlin <[email protected]> Signed-off-by: Scott Rigby <[email protected]>
1 parent 7813520 commit 4b5beb1

File tree

3 files changed

+63
-1
lines changed

3 files changed

+63
-1
lines changed

chartsmith-app/components/TopNav.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@ import Link from "next/link";
44
import { useTheme } from "@/contexts/ThemeContext";
55
import { StatusDropdown } from "./StatusDropdown";
66
import { TtlshModal } from "./TtlshModal";
7+
import { ZipDownloadModal } from "./ZipDownloadModal";
78

89
// Removed evalItems
910

10-
const exportItems = [{ label: "Push to ttl.sh" }];
11+
const exportItems = [
12+
{ label: "Push to ttl.sh" },
13+
{ label: "Download as Zip" }
14+
];
1115

1216
export function TopNav() {
1317
const [showTtlshModal, setShowTtlshModal] = useState(false);
18+
const [showZipModal, setShowZipModal] = useState(false);
1419
const { resolvedTheme } = useTheme();
1520

1621
return (
@@ -43,13 +48,16 @@ export function TopNav() {
4348
onItemClick={(item) => {
4449
if (item.label === "Push to ttl.sh") {
4550
setShowTtlshModal(true);
51+
} else if (item.label === "Download as Zip") {
52+
setShowZipModal(true);
4653
}
4754
}}
4855
/>
4956
</div>
5057
</nav>
5158

5259
<TtlshModal isOpen={showTtlshModal} onClose={() => setShowTtlshModal(false)} />
60+
<ZipDownloadModal isOpen={showZipModal} onClose={() => setShowZipModal(false)} />
5361
</>
5462
);
5563
}

chartsmith-app/package-lock.json

Lines changed: 52 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chartsmith-app/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"dotenv": "^16.4.7",
3434
"gunzip-maybe": "^1.4.2",
3535
"jotai": "^2.12.1",
36+
"jszip": "^3.10.1",
3637
"jsonwebtoken": "^9.0.2",
3738
"lodash": "^4.17.21",
3839
"lucide-react": "^0.479.0",
@@ -60,6 +61,7 @@
6061
"@types/gunzip-maybe": "^1.4.2",
6162
"@types/jest": "^29.5.12",
6263
"@types/jsonwebtoken": "^9.0.9",
64+
"@types/jszip": "^3.4.1",
6365
"@types/lodash": "^4.17.16",
6466
"@types/node": "^22.13.9",
6567
"@types/pg": "^8.11.11",

0 commit comments

Comments
 (0)