From 4f038c3757980ace3d710197256132e990d7454a Mon Sep 17 00:00:00 2001 From: Maxwell Barvian Date: Fri, 25 Oct 2024 19:35:27 -0700 Subject: [PATCH] Update Vue sandbox --- site/src/lib/framework.ts | 3 +++ site/src/pages/[...framework]/_Hero.tsx | 8 ++------ site/src/pages/[...framework]/_Home.astro | 5 ++++- site/src/pages/[...framework]/examples/_Examples.astro | 5 ++++- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/site/src/lib/framework.ts b/site/src/lib/framework.ts index dab73d23..cb9a5ebf 100644 --- a/site/src/lib/framework.ts +++ b/site/src/lib/framework.ts @@ -1,5 +1,6 @@ export type FrameworkData = { name: string | undefined + sandbox: string lightColor: string darkColor: string } @@ -7,11 +8,13 @@ export type FrameworkData = { export const FRAMEWORKS = { react: { name: 'React', + sandbox: 'https://codesandbox.io/p/sandbox/r47dcw', lightColor: '#0A7EA4', darkColor: '#58C4DC' }, vue: { name: 'Vue', + sandbox: 'https://codesandbox.io/p/devbox/number-flow-vue-7t7y6y', lightColor: '#42B883', darkColor: '#42B883' } diff --git a/site/src/pages/[...framework]/_Hero.tsx b/site/src/pages/[...framework]/_Hero.tsx index df186b45..797eff5d 100644 --- a/site/src/pages/[...framework]/_Hero.tsx +++ b/site/src/pages/[...framework]/_Hero.tsx @@ -44,7 +44,7 @@ const FORMATS = [ } ] as Format[] -export default function Hero() { +export default function Hero({ sandbox }: { sandbox: string }) { const [value, cycleValue] = useCycle(NUMBERS) const [locale, cycleLocale] = useCycle(LOCALES) const [format, cycleFormat] = useCycle(FORMATS) @@ -106,11 +106,7 @@ export default function Hero() { Shuffle - + Open sandbox diff --git a/site/src/pages/[...framework]/_Home.astro b/site/src/pages/[...framework]/_Home.astro index dc87c3fa..2f65d32b 100644 --- a/site/src/pages/[...framework]/_Home.astro +++ b/site/src/pages/[...framework]/_Home.astro @@ -3,17 +3,20 @@ import DocsLayout from '@/layouts/Docs.astro' import type { MDXLayoutProps } from 'astro' import Hero from './_Hero' import Link from '@/components/Link.astro' +import { FRAMEWORKS, getFramework } from '@/lib/framework' type Props = MDXLayoutProps<{ title: string description: string }> +const { sandbox } = FRAMEWORKS[getFramework(Astro.params)!] + const { frontmatter } = Astro.props --- - +