Skip to content

Commit 00d7b52

Browse files
committed
refactor to use components in react-net-templates
1 parent 989f644 commit 00d7b52

File tree

9 files changed

+30
-504
lines changed

9 files changed

+30
-504
lines changed

MyApp.Client/app/page.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import Intro from "@/components/intro"
22
import Layout from "@/components/layout"
33
import { CMS_NAME } from "@/lib/constants"
4-
import GettingStarted from "@/components/getting-started"
5-
import AutoUis from "@/components/auto-uis"
64
import type { Metadata } from 'next'
75

86
export const metadata: Metadata = {
@@ -15,11 +13,6 @@ export default function Index() {
1513
<Layout>
1614
<div className="max-w-7xl mx-auto px-5">
1715
<Intro />
18-
<div className="mb-32 flex justify-center">
19-
<GettingStarted template="next-static" />
20-
</div>
21-
22-
<AutoUis className="mt-60" />
2316
</div>
2417
</Layout>
2518
)

MyApp.Client/components/auto-uis.tsx

Lines changed: 0 additions & 344 deletions
This file was deleted.

MyApp.Client/components/getting-started.tsx

Lines changed: 0 additions & 146 deletions
This file was deleted.

MyApp.Client/components/intro.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { useState, useEffect } from "react"
44
import { TextInput, useClient } from "@servicestack/react"
55
import { ApiResult } from "@servicestack/client"
6+
import { GettingStarted, AutoUis } from "react-net-templates"
67
import { CMS_NAME } from "@/lib/constants"
78
import { Hello, HelloResponse } from "@/lib/dtos"
89

@@ -22,9 +23,9 @@ const HelloApi = ({ name }:any) => {
2223
: <div className="ml-3 mt-2 text-gray-900 dark:text-gray-100">{api.response?.result ?? 'loading...'}</div>
2324
}
2425

25-
const Intro = () => {
26+
export default function Intro() {
2627
const [inputValue, setInputValue] = useState<string>("Next.js");
27-
return (
28+
return (<>
2829
<section className="flex-col md:flex-row flex items-center md:justify-between mt-16 mb-16 md:mb-12">
2930
<h1 className="text-6xl md:text-8xl font-bold tracking-tighter leading-tight md:pr-8 text-gray-900 dark:text-gray-100">
3031
Next.js
@@ -49,7 +50,11 @@ const Intro = () => {
4950
</div>
5051
</div>
5152
</section>
52-
)
53+
<div>
54+
<div className="mb-32 flex justify-center">
55+
<GettingStarted template="next-static" />
56+
</div>
57+
<AutoUis className="mt-60" />
58+
</div>
59+
</>)
5360
}
54-
55-
export default Intro

MyApp.Client/package-lock.json

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

MyApp.Client/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"next": "^16.0.3",
2222
"react": "^19.2.0",
2323
"react-dom": "^19.2.0",
24+
"react-net-templates": "^0.0.1",
2425
"tailwind-merge": "^3.4.0"
2526
},
2627
"devDependencies": {

MyApp.Client/styles/index.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@import "tailwindcss";
22
@source "../node_modules/@servicestack/react/dist/servicestack-react.mjs";
3+
@source "../../node_modules/react-net-templates/dist/index.js";
34

45
@variant dark (.dark &);
56

MyApp/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
{
4848
app.UseDeveloperExceptionPage();
4949
app.UseMigrationsEndPoint();
50-
50+
5151
app.MapNotFoundToNode(nodeProxy);
5252
}
5353
else
@@ -62,7 +62,6 @@
6262
app.MapCleanUrls();
6363

6464
app.UseHttpsRedirection();
65-
app.UseWebSockets();
6665
app.UseAuthorization();
6766
app.MapRazorPages();
6867

@@ -73,6 +72,7 @@
7372
// Proxy development HMR WebSocket and fallback routes to the Next server
7473
if (app.Environment.IsDevelopment())
7574
{
75+
app.UseWebSockets();
7676
app.MapNextHmr(nodeProxy);
7777

7878
// Start the Next.js dev server if the Next.js lockfile does not exist

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ enable deploying all your Repositories to the same server.
291291
**Optional**:
292292

293293
| Variable | Example | Description |
294+
|----------|---------|-------------|
294295
| `SERVICESTACK_LICENSE` | `...` | ServiceStack license key |
295296

296297
**Inferred** (from GitHub Action context):

0 commit comments

Comments
 (0)