diff --git a/src/components/DefaultMenu.astro b/src/components/DefaultMenu.astro new file mode 100644 index 0000000..7c1ea5f --- /dev/null +++ b/src/components/DefaultMenu.astro @@ -0,0 +1,93 @@ +--- +import { isPathActive } from "../lib/utils.js"; +--- + +
+ +
+
+ +
diff --git a/src/components/DefaultMobileMenu.astro b/src/components/DefaultMobileMenu.astro new file mode 100644 index 0000000..0c161ee --- /dev/null +++ b/src/components/DefaultMobileMenu.astro @@ -0,0 +1,58 @@ +--- +import { isPathActive } from "../lib/utils.js"; +--- + + +
+ diff --git a/src/components/TeamsMenu.astro b/src/components/TeamsMenu.astro new file mode 100644 index 0000000..b036fca --- /dev/null +++ b/src/components/TeamsMenu.astro @@ -0,0 +1,49 @@ +--- +import { isPathActive } from "../lib/utils.js"; +--- + +
+ +
+
+ +
diff --git a/src/components/TeamsMobileMenu.astro b/src/components/TeamsMobileMenu.astro new file mode 100644 index 0000000..c3406c6 --- /dev/null +++ b/src/components/TeamsMobileMenu.astro @@ -0,0 +1,43 @@ +--- +import { isPathActive } from "../lib/utils.js"; +--- + + +
+ diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index f4e5d7b..13a1063 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -9,6 +9,10 @@ import hfLogoWithText from "../images/hf-logo-with-text.svg"; import tigrisLogo from "../images/tigris-logo.svg"; import Icon from "../components/Icon.astro"; +import DefaultMenu from "../components/DefaultMenu.astro"; +import TeamsMenu from "../components/TeamsMenu.astro"; +import DefaultMobileMenu from "../components/DefaultMobileMenu.astro"; +import TeamsMobileMenu from "../components/TeamsMobileMenu.astro"; export interface Props { title: string; @@ -23,10 +27,6 @@ const { displaySponsors = true, variant = "default", } = Astro.props; - -function isPathActive(path) { - return Astro.url.pathname.startsWith(path); -} --- @@ -77,6 +77,22 @@ function isPathActive(path) { > + { + variant === "teams" && ( +
+
+ +

+ + + Switch to Livebook OSS +

+
+
+ ) + } @@ -197,59 +137,8 @@ function isPathActive(path) { data-on-menu="show" class="h-full mt-12 flex flex-col items-center space-y-12" > - -
- + {variant === "default" && } + {variant === "teams" && }
@@ -403,6 +292,8 @@ function isPathActive(path) { ) } + {variant === "default" && ( + <> + + ) + } + diff --git a/src/lib/utils.js b/src/lib/utils.js index 73fc04d..c369aac 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -37,3 +37,15 @@ export function firstSuccess(list, toPromise) { ) .catch(() => Promise.reject(new Error("No success"))); } + +/** + * Checks if the given URL's pathname starts with the specified path. + * Used to determine if a navigation path is active in the current URL. + * + * @param {String} path - The path to check against + * @param {URL} url - The URL object to check + * @returns {Boolean} - True if the URL pathname starts with the given path + */ +export function isPathActive(path, url) { + return url.pathname.startsWith(path); +} diff --git a/src/pages/teams.astro b/src/pages/teams.astro index 65a73f0..672201e 100644 --- a/src/pages/teams.astro +++ b/src/pages/teams.astro @@ -61,11 +61,11 @@ import deployWithTeams from "../images/teams/how-to-deploy-livebook-app-with-liv
- I want FREE early access + Try it free for 30 days @@ -653,11 +653,11 @@ import deployWithTeams from "../images/teams/how-to-deploy-livebook-app-with-liv Get started building internal tools in minutes - I want FREE early access + Try it free for 30 days
diff --git a/src/pages/teams/pricing.astro b/src/pages/teams/pricing.astro index a42488f..e632238 100644 --- a/src/pages/teams/pricing.astro +++ b/src/pages/teams/pricing.astro @@ -60,6 +60,11 @@ import TeamsPricingFaq from "../../components/TeamsPricingFaq.astro"; ]} /> +
+

+ * all prices shown exclude applicable taxes +

+