Skip to content

Commit

Permalink
Fix: Import errors in Homepage and json property in GenericModel
Browse files Browse the repository at this point in the history
- Removed VStack imports and unused template components
  • Loading branch information
yeahlowflicker committed Nov 23, 2024
1 parent d3b748f commit d14c417
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 34 deletions.
1 change: 1 addition & 0 deletions src/models/GenericModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ export default abstract class GenericModel {
// Abstract method for parsing JSON
static parseJson(json: any): GenericModel {
throw new Error("parseJson method not implemented.");
return json
}
}
25 changes: 25 additions & 0 deletions src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { Route as LoginImport } from './routes/login'
import { Route as IndexImport } from './routes/index'
import { Route as SalesIndexImport } from './routes/sales/index'
import { Route as MapIndexImport } from './routes/map/index'
import { Route as HomeIndexImport } from './routes/home/index'
import { Route as EventsIndexImport } from './routes/events/index'
import { Route as DinnerIndexImport } from './routes/dinner/index'
import { Route as CalendarIndexImport } from './routes/calendar/index'
Expand Down Expand Up @@ -44,6 +45,11 @@ const MapIndexRoute = MapIndexImport.update({
getParentRoute: () => rootRoute,
} as any)

const HomeIndexRoute = HomeIndexImport.update({
path: '/home/',
getParentRoute: () => rootRoute,
} as any)

const EventsIndexRoute = EventsIndexImport.update({
path: '/events/',
getParentRoute: () => rootRoute,
Expand Down Expand Up @@ -134,6 +140,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof EventsIndexImport
parentRoute: typeof rootRoute
}
'/home/': {
id: '/home/'
path: '/home'
fullPath: '/home'
preLoaderRoute: typeof HomeIndexImport
parentRoute: typeof rootRoute
}
'/map/': {
id: '/map/'
path: '/map'
Expand Down Expand Up @@ -162,6 +175,7 @@ export interface FileRoutesByFullPath {
'/calendar': typeof CalendarIndexRoute
'/dinner': typeof DinnerIndexRoute
'/events': typeof EventsIndexRoute
'/home': typeof HomeIndexRoute
'/map': typeof MapIndexRoute
'/sales': typeof SalesIndexRoute
}
Expand All @@ -175,6 +189,7 @@ export interface FileRoutesByTo {
'/calendar': typeof CalendarIndexRoute
'/dinner': typeof DinnerIndexRoute
'/events': typeof EventsIndexRoute
'/home': typeof HomeIndexRoute
'/map': typeof MapIndexRoute
'/sales': typeof SalesIndexRoute
}
Expand All @@ -189,6 +204,7 @@ export interface FileRoutesById {
'/calendar/': typeof CalendarIndexRoute
'/dinner/': typeof DinnerIndexRoute
'/events/': typeof EventsIndexRoute
'/home/': typeof HomeIndexRoute
'/map/': typeof MapIndexRoute
'/sales/': typeof SalesIndexRoute
}
Expand All @@ -204,6 +220,7 @@ export interface FileRouteTypes {
| '/calendar'
| '/dinner'
| '/events'
| '/home'
| '/map'
| '/sales'
fileRoutesByTo: FileRoutesByTo
Expand All @@ -216,6 +233,7 @@ export interface FileRouteTypes {
| '/calendar'
| '/dinner'
| '/events'
| '/home'
| '/map'
| '/sales'
id:
Expand All @@ -228,6 +246,7 @@ export interface FileRouteTypes {
| '/calendar/'
| '/dinner/'
| '/events/'
| '/home/'
| '/map/'
| '/sales/'
fileRoutesById: FileRoutesById
Expand All @@ -242,6 +261,7 @@ export interface RootRouteChildren {
CalendarIndexRoute: typeof CalendarIndexRoute
DinnerIndexRoute: typeof DinnerIndexRoute
EventsIndexRoute: typeof EventsIndexRoute
HomeIndexRoute: typeof HomeIndexRoute
MapIndexRoute: typeof MapIndexRoute
SalesIndexRoute: typeof SalesIndexRoute
}
Expand All @@ -255,6 +275,7 @@ const rootRouteChildren: RootRouteChildren = {
CalendarIndexRoute: CalendarIndexRoute,
DinnerIndexRoute: DinnerIndexRoute,
EventsIndexRoute: EventsIndexRoute,
HomeIndexRoute: HomeIndexRoute,
MapIndexRoute: MapIndexRoute,
SalesIndexRoute: SalesIndexRoute,
}
Expand All @@ -279,6 +300,7 @@ export const routeTree = rootRoute
"/calendar/",
"/dinner/",
"/events/",
"/home/",
"/map/",
"/sales/"
]
Expand Down Expand Up @@ -307,6 +329,9 @@ export const routeTree = rootRoute
"/events/": {
"filePath": "events/index.tsx"
},
"/home/": {
"filePath": "home/index.tsx"
},
"/map/": {
"filePath": "map/index.tsx"
},
Expand Down
50 changes: 16 additions & 34 deletions src/routes/home/index.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { createFileRoute } from '@tanstack/react-router'
import { VStack } from '../../components'

const homeItems = [
{ title: "test", description: "Hello world." },
{ title: "test", description: "Hello world." },
{ title: "test", description: "Hello world." },
{ title: "test", description: "Hello world." },
{ title: "test", description: "Hello world." },
{ title: "test", description: "Hello world." },
{ title: "test", description: "Hello world." },
{ title: "test", description: "Hello world." },
{ title: "test", description: "Hello world." },
{ title: "test", description: "Hello world." },
{ title: "test", description: "Hello world." },
]
// import { VStack } from '../../components'

// const homeItems = [
// { title: "test", description: "Hello world." },
// { title: "test", description: "Hello world." },
// { title: "test", description: "Hello world." },
// { title: "test", description: "Hello world." },
// { title: "test", description: "Hello world." },
// { title: "test", description: "Hello world." },
// { title: "test", description: "Hello world." },
// { title: "test", description: "Hello world." },
// { title: "test", description: "Hello world." },
// { title: "test", description: "Hello world." },
// { title: "test", description: "Hello world." },
// ]

// User.fetchSingle().then(user => {
// console.log(user)
Expand Down Expand Up @@ -67,23 +67,5 @@ export const Route = createFileRoute('/home/')({
變更個人檔案
</span>
</section>

<VStack className='px-[10px] gap-[20px]'>


{/* {homeItems.map((item, index) => (
<WelcomeCard title={item.title} description={item.description} />
))} */}

{/* <NcuInput />
<NcuTextarea>
Hello
</NcuTextarea>
<NcuSwitch label="test">X</NcuSwitch>
<NcuButton>Test</NcuButton> */}
</VStack>
</div>,
</div >,
})

0 comments on commit d14c417

Please sign in to comment.