From db240471ede155f0470115023c4101c5d0bfb2fc Mon Sep 17 00:00:00 2001 From: Jonathan Sick Date: Fri, 12 Apr 2024 12:31:58 -0400 Subject: [PATCH] Add a link to download the notebook --- .../TimesSquareGitHubPagePanel/IpynbDownloadLink.js | 12 ++++++++++++ .../TimesSquareGitHubPagePanel.js | 6 ++++++ 2 files changed, 18 insertions(+) create mode 100644 apps/squareone/src/components/TimesSquareGitHubPagePanel/IpynbDownloadLink.js diff --git a/apps/squareone/src/components/TimesSquareGitHubPagePanel/IpynbDownloadLink.js b/apps/squareone/src/components/TimesSquareGitHubPagePanel/IpynbDownloadLink.js new file mode 100644 index 00000000..3dc44b44 --- /dev/null +++ b/apps/squareone/src/components/TimesSquareGitHubPagePanel/IpynbDownloadLink.js @@ -0,0 +1,12 @@ +export default function IpynbDownloadLink({ url, sourcePath }) { + // get the filename from the sourcePath + const filename = sourcePath.split('/').pop(); + + return ( +

+ + Download notebook + +

+ ); +} diff --git a/apps/squareone/src/components/TimesSquareGitHubPagePanel/TimesSquareGitHubPagePanel.js b/apps/squareone/src/components/TimesSquareGitHubPagePanel/TimesSquareGitHubPagePanel.js index d7722093..25654b9c 100644 --- a/apps/squareone/src/components/TimesSquareGitHubPagePanel/TimesSquareGitHubPagePanel.js +++ b/apps/squareone/src/components/TimesSquareGitHubPagePanel/TimesSquareGitHubPagePanel.js @@ -14,6 +14,7 @@ import useTimesSquarePage from '../../hooks/useTimesSquarePage'; import TimesSquareParameters from '../TimesSquareParameters'; import ExecStats from './ExecStats'; import GitHubEditLink from './GitHubEditLink'; +import IpynbDownloadLink from './IpynbDownloadLink'; export default function TimesSquareGitHubPagePanel({}) { const { publicRuntimeConfig } = getConfig(); @@ -46,6 +47,11 @@ export default function TimesSquareGitHubPagePanel({}) { + +