Skip to content

Commit

Permalink
CDA: update dreamland-router
Browse files Browse the repository at this point in the history
  • Loading branch information
MotorTruck1221 committed Jul 10, 2024
1 parent 13baaa9 commit 0a8db5d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
}
},
"folders": ["src/routes/"],
"files": ["src/router.tsx", "src/main.tsx", "src/routes/home.tsx"]
"files": ["src/router.tsx", "src/routes/home.tsx"]
}
30 changes: 0 additions & 30 deletions create-dreamland-app/templates/tsx/dreamland-router/src/main.tsx

This file was deleted.

15 changes: 11 additions & 4 deletions create-dreamland-app/templates/tsx/dreamland-router/src/router.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import { Route } from 'dreamland-router';
import { Router, Route } from 'dreamland-router';
import Home from './routes/home';
export const Router = (
<Route path="/">

//base styles
import './index.css';
const base = css`
width: 100%;
height: 100%;
`
new Router(
<Route class={base}>
<Route path="" show={<Home />} />
</Route>
).$;
).mount(document.getElementById('app')!);
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ const docsButton = css`
text-decoration: none;
`

const Home: Component<{}, { counter: number }> = function () {
const Home: Component<{
// component properties. if you had a component that took a property like `<Button text="..." /> you would use a type like the one in the following line
// text: string
}, {
// types for internal state
counter: number
}> = function () {
this.counter = 0;
return (
<div class={baseStyle}>
Expand Down

0 comments on commit 0a8db5d

Please sign in to comment.