chore: updated all site base urls
This commit is contained in:
@ -5,8 +5,8 @@ import {
|
||||
BillingRemaining,
|
||||
BillingRemainingMode,
|
||||
} from '@src/components/BillingRemaining'
|
||||
|
||||
import { type BillingActor } from '@src/machines/billingMachine'
|
||||
import { withSiteBaseURL } from '@src/lib/withBaseURL'
|
||||
|
||||
export const BillingDialog = (props: { billingActor: BillingActor }) => {
|
||||
const billingContext = useSelector(
|
||||
@ -42,7 +42,7 @@ export const BillingDialog = (props: { billingActor: BillingActor }) => {
|
||||
{!hasUnlimited && (
|
||||
<a
|
||||
className="bg-ml-black text-ml-white rounded-lg text-center p-1 cursor-pointer"
|
||||
href="https://zoo.dev/design-studio-pricing"
|
||||
href={withSiteBaseURL('/design-studio-pricing')}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
data-testid="billing-upgrade-button"
|
||||
|
@ -15,6 +15,7 @@ import {
|
||||
import { onboardingStartPath } from '@src/lib/onboardingPaths'
|
||||
import { reportRejection } from '@src/lib/trap'
|
||||
import { isDesktop } from '@src/lib/isDesktop'
|
||||
import { withSiteBaseURL } from '@src/lib/withBaseURL'
|
||||
|
||||
const HelpMenuDivider = () => (
|
||||
<div className="h-[1px] bg-chalkboard-110 dark:bg-chalkboard-80" />
|
||||
@ -89,7 +90,7 @@ export function HelpMenu() {
|
||||
<HelpMenuDivider />
|
||||
<HelpMenuItem
|
||||
as="a"
|
||||
href="https://zoo.dev/docs/kcl-samples"
|
||||
href={withSiteBaseURL('/docs/kcl-samples')}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
@ -97,7 +98,7 @@ export function HelpMenu() {
|
||||
</HelpMenuItem>
|
||||
<HelpMenuItem
|
||||
as="a"
|
||||
href="https://zoo.dev/docs/kcl-lang"
|
||||
href={withSiteBaseURL('/docs/kcl-lang')}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
|
@ -12,6 +12,7 @@ import { reportRejection } from '@src/lib/trap'
|
||||
import { commandBarActor, settingsActor } from '@src/lib/singletons'
|
||||
|
||||
import styles from './KclEditorMenu.module.css'
|
||||
import { withSiteBaseURL } from '@src/lib/withBaseURL'
|
||||
|
||||
export const KclEditorMenu = ({ children }: PropsWithChildren) => {
|
||||
const { enable: convertToVarEnabled, handleClick: handleConvertToVarClick } =
|
||||
@ -67,7 +68,7 @@ export const KclEditorMenu = ({ children }: PropsWithChildren) => {
|
||||
<Menu.Item>
|
||||
<a
|
||||
className={styles.button}
|
||||
href="https://zoo.dev/docs/kcl-lang"
|
||||
href={withSiteBaseURL('/docs/kcl-lang')}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
onClick={openExternalBrowserIfDesktop()}
|
||||
@ -108,7 +109,7 @@ export const KclEditorMenu = ({ children }: PropsWithChildren) => {
|
||||
<Menu.Item>
|
||||
<a
|
||||
className={styles.button}
|
||||
href="https://zoo.dev/docs/kcl-samples"
|
||||
href={withSiteBaseURL('/docs/kcl-samples')}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
onClick={openExternalBrowserIfDesktop()}
|
||||
|
@ -13,6 +13,7 @@ import { isDesktop } from '@src/lib/isDesktop'
|
||||
import { PATHS } from '@src/lib/paths'
|
||||
import { authActor } from '@src/lib/singletons'
|
||||
import { reportRejection } from '@src/lib/trap'
|
||||
import { withSiteBaseURL } from '@src/lib/withBaseURL'
|
||||
|
||||
type User = Models['User_type']
|
||||
|
||||
@ -62,7 +63,7 @@ const UserSidebarMenu = ({ user }: { user?: User }) => {
|
||||
{
|
||||
id: 'account',
|
||||
Element: 'externalLink',
|
||||
to: 'https://zoo.dev/account',
|
||||
to: withSiteBaseURL('/account'),
|
||||
children: (
|
||||
<>
|
||||
<span className="flex-1">Manage account</span>
|
||||
|
@ -11,6 +11,7 @@ import {
|
||||
pipeHasCircle,
|
||||
} from '@src/machines/modelingMachine'
|
||||
import { IS_ML_EXPERIMENTAL } from '@src/lib/constants'
|
||||
import { withSiteBaseURL } from '@src/lib/withBaseURL'
|
||||
|
||||
export type ToolbarModeName = 'modeling' | 'sketching'
|
||||
|
||||
@ -105,7 +106,9 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
||||
links: [
|
||||
{
|
||||
label: 'KCL docs',
|
||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-sketch-startSketchOn',
|
||||
url: withSiteBaseURL(
|
||||
'/docs/kcl-std/functions/std-sketch-startSketchOn'
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
@ -125,7 +128,7 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
||||
links: [
|
||||
{
|
||||
label: 'KCL docs',
|
||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-sketch-extrude',
|
||||
url: withSiteBaseURL('/docs/kcl-std/functions/std-sketch-extrude'),
|
||||
},
|
||||
],
|
||||
},
|
||||
@ -145,7 +148,7 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
||||
links: [
|
||||
{
|
||||
label: 'KCL docs',
|
||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-sketch-sweep',
|
||||
url: withSiteBaseURL('/docs/kcl-std/functions/std-sketch-sweep'),
|
||||
},
|
||||
],
|
||||
},
|
||||
@ -165,7 +168,7 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
||||
links: [
|
||||
{
|
||||
label: 'KCL docs',
|
||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-sketch-loft',
|
||||
url: withSiteBaseURL('/docs/kcl-std/functions/std-sketch-loft'),
|
||||
},
|
||||
],
|
||||
},
|
||||
@ -185,11 +188,11 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
||||
links: [
|
||||
{
|
||||
label: 'KCL docs',
|
||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-sketch-revolve',
|
||||
url: withSiteBaseURL('/docs/kcl-std/functions/std-sketch-revolve'),
|
||||
},
|
||||
{
|
||||
label: 'KCL example',
|
||||
url: 'https://zoo.dev/docs/kcl-samples/ball-bearing',
|
||||
url: withSiteBaseURL('/docs/kcl-samples/ball-bearing'),
|
||||
},
|
||||
],
|
||||
},
|
||||
@ -209,7 +212,7 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
||||
links: [
|
||||
{
|
||||
label: 'KCL docs',
|
||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-solid-fillet',
|
||||
url: withSiteBaseURL('/docs/kcl-std/functions/std-solid-fillet'),
|
||||
},
|
||||
],
|
||||
},
|
||||
@ -234,7 +237,7 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
||||
},
|
||||
{
|
||||
label: 'KCL docs',
|
||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-solid-chamfer',
|
||||
url: withSiteBaseURL('/docs/kcl-std/functions/std-solid-chamfer'),
|
||||
},
|
||||
],
|
||||
},
|
||||
@ -253,7 +256,7 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
||||
links: [
|
||||
{
|
||||
label: 'KCL docs',
|
||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-solid-shell',
|
||||
url: withSiteBaseURL('/docs/kcl-std/functions/std-solid-shell'),
|
||||
},
|
||||
],
|
||||
},
|
||||
@ -275,7 +278,7 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
||||
links: [
|
||||
{
|
||||
label: 'KCL docs',
|
||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-solid-union',
|
||||
url: withSiteBaseURL('/docs/kcl-std/functions/std-solid-union'),
|
||||
},
|
||||
],
|
||||
},
|
||||
@ -293,7 +296,9 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
||||
links: [
|
||||
{
|
||||
label: 'KCL docs',
|
||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-solid-subtract',
|
||||
url: withSiteBaseURL(
|
||||
'/docs/kcl-std/functions/std-solid-subtract'
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
@ -311,7 +316,9 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
||||
links: [
|
||||
{
|
||||
label: 'KCL docs',
|
||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-solid-intersect',
|
||||
url: withSiteBaseURL(
|
||||
'/docs/kcl-std/functions/std-solid-intersect'
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
@ -337,7 +344,7 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
||||
links: [
|
||||
{
|
||||
label: 'KCL docs',
|
||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-offsetPlane',
|
||||
url: withSiteBaseURL('/docs/kcl-std/functions/std-offsetPlane'),
|
||||
},
|
||||
],
|
||||
},
|
||||
@ -368,7 +375,7 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
||||
links: [
|
||||
{
|
||||
label: 'KCL docs',
|
||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-helix',
|
||||
url: withSiteBaseURL('/docs/kcl-std/functions/std-helix'),
|
||||
},
|
||||
],
|
||||
},
|
||||
@ -389,7 +396,7 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
||||
links: [
|
||||
{
|
||||
label: 'API docs',
|
||||
url: 'https://zoo.dev/docs/kcl-lang/modules',
|
||||
url: withSiteBaseURL('/docs/kcl-lang/modules'),
|
||||
},
|
||||
],
|
||||
},
|
||||
@ -410,7 +417,9 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
||||
links: [
|
||||
{
|
||||
label: 'API docs',
|
||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-transform-translate',
|
||||
url: withSiteBaseURL(
|
||||
'/docs/kcl-std/functions/std-transform-translate'
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
@ -428,7 +437,9 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
||||
links: [
|
||||
{
|
||||
label: 'API docs',
|
||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-transform-rotate',
|
||||
url: withSiteBaseURL(
|
||||
'/docs/kcl-std/functions/std-transform-rotate'
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
@ -446,7 +457,7 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
||||
links: [
|
||||
{
|
||||
label: 'API docs',
|
||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-clone',
|
||||
url: withSiteBaseURL('/docs/kcl-std/functions/std-clone'),
|
||||
},
|
||||
],
|
||||
},
|
||||
@ -482,7 +493,9 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
||||
links: [
|
||||
{
|
||||
label: 'API docs',
|
||||
url: 'https://zoo.dev/docs/api/ml/generate-a-cad-model-from-text',
|
||||
url: withSiteBaseURL(
|
||||
'/docs/api/ml/generate-a-cad-model-from-text'
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
@ -739,7 +752,7 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
||||
links: [
|
||||
{
|
||||
label: 'KCL docs',
|
||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-sketch-polygon',
|
||||
url: withSiteBaseURL('/docs/kcl-std/functions/std-sketch-polygon'),
|
||||
},
|
||||
],
|
||||
},
|
||||
@ -755,7 +768,9 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
|
||||
links: [
|
||||
{
|
||||
label: 'KCL docs',
|
||||
url: 'https://zoo.dev/docs/kcl-std/functions/std-transform-mirror2d',
|
||||
url: withSiteBaseURL(
|
||||
'/docs/kcl-std/functions/std-transform-mirror2d'
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
|
6
src/lib/withBaseURLNode.ts
Normal file
6
src/lib/withBaseURLNode.ts
Normal file
@ -0,0 +1,6 @@
|
||||
/**
|
||||
* This will not run in the browser, look at withBaseURL
|
||||
*/
|
||||
export function withSiteBaseURLNode(path: string): string {
|
||||
return process.env.VITE_KC_SITE_BASE_URL + path
|
||||
}
|
@ -5,6 +5,7 @@ import { reportRejection } from '@src/lib/trap'
|
||||
import { typeSafeWebContentsSend } from '@src/menu/channels'
|
||||
import type { ZooMenuItemConstructorOptions } from '@src/menu/roles'
|
||||
import { getAutoUpdater } from '@src/updater'
|
||||
import { withSiteBaseURLNode } from '@src/lib/withBaseURLNode'
|
||||
|
||||
export const helpRole = (
|
||||
mainWindow: BrowserWindow
|
||||
@ -26,14 +27,16 @@ export const helpRole = (
|
||||
id: 'Help.KCL code samples',
|
||||
click: () => {
|
||||
shell
|
||||
.openExternal('https://zoo.dev/docs/kcl-samples')
|
||||
.openExternal(withSiteBaseURLNode('/docs/kcl-samples'))
|
||||
.catch(reportRejection)
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'KCL Docs',
|
||||
click: () => {
|
||||
shell.openExternal('https://zoo.dev/docs/kcl').catch(reportRejection)
|
||||
shell
|
||||
.openExternal(withSiteBaseURLNode('/docs/kcl'))
|
||||
.catch(reportRejection)
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -116,7 +119,9 @@ export const helpRole = (
|
||||
{
|
||||
label: 'Manage Account',
|
||||
click: () => {
|
||||
shell.openExternal('https://zoo.dev/account').catch(reportRejection)
|
||||
shell
|
||||
.openExternal(withSiteBaseURLNode('/account'))
|
||||
.catch(reportRejection)
|
||||
},
|
||||
},
|
||||
],
|
||||
|
Reference in New Issue
Block a user