Skip to content

Commit 48a6ef4

Browse files
committed
Add VibeTemplate to app.mjs
1 parent 386ca8d commit 48a6ef4

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

MyApp/wwwroot/mjs/app.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { PagingNav, FileLayout } from './components/Docs.mjs'
1010
import Typesense from "./components/Typesense.mjs"
1111
import ProjectTemplate from "./components/ProjectTemplate.mjs"
1212
import ProjectCreator from "./components/ProjectCreator.mjs"
13+
import VibeTemplate from "../pages/components/VibeTemplate.mjs"
1314

1415
let client = null, Apps = []
1516
let AppData = {
@@ -57,6 +58,7 @@ const Components = {
5758
Typesense,
5859
ProjectTemplate,
5960
ProjectCreator,
61+
VibeTemplate,
6062
}
6163
const CustomElements = [
6264
'lite-youtube'

MyApp/wwwroot/pages/components/VibeTemplate.mjs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ export default {
5757
</a>
5858
</div>
5959
<div class="mt-6 not-prose flex flex-col items-center gap-3">
60-
<span class="text-sm text-muted-foreground font-mono">{{ template }}.react-templates.net</span>
60+
<a :href="liveDemoHref" class="text-sm text-muted-foreground font-mono">{{ liveDemoHref.substring(8) }}</a>
6161
<div class="flex flex-wrap justify-center gap-4">
62-
<a :href="'https://' + template + '.react-templates.net'"
62+
<a :href="liveDemoHref"
6363
class="group inline-flex items-center gap-2 px-4 py-2 bg-[#61DAFB] hover:bg-[#4fa8c7] text-gray-900 font-medium rounded-lg shadow-md hover:shadow-lg transition-all duration-300">
6464
<svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
6565
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9" />
@@ -96,8 +96,23 @@ export default {
9696
},
9797
setup(props) {
9898
const command = computed(() => `npx create-net ${props.template} MyProject`)
99+
100+
const reactTemplates = [
101+
'react-static',
102+
'react-spa',
103+
'nextjs',
104+
'next-rsc',
105+
'next-static',
106+
]
107+
108+
const liveDemoHref = computed(() =>
109+
'https://' + props.template + (reactTemplates.includes(props.template)
110+
? '.react-templates.net'
111+
: '.web-templates.io'))
112+
99113
return {
100-
command
114+
command,
115+
liveDemoHref,
101116
}
102117
}
103118
}

0 commit comments

Comments
 (0)