-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* improve download button menu * some context * add button to download fabrication files
- Loading branch information
Showing
7 changed files
with
289 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
import { saveAs } from "file-saver" | ||
import { createBlobURL } from "./createBlobURL" | ||
export const downloadCircuitJson = (content: any, fileName: string) => { | ||
const circuitJson = JSON.stringify(content, null, 2) | ||
const blob = new Blob([circuitJson], { type: "application/json" }) | ||
import { AnyCircuitElement } from "circuit-json" | ||
|
||
export const downloadCircuitJson = ( | ||
circuitJson: AnyCircuitElement[], | ||
fileName: string, | ||
) => { | ||
const stringifiedCircuitJson = JSON.stringify(circuitJson, null, 2) | ||
const blob = new Blob([stringifiedCircuitJson], { type: "application/json" }) | ||
saveAs(blob, fileName) | ||
} |
Oops, something went wrong.