File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ export const App = (): JSX.Element => {
54
54
55
55
< Routes >
56
56
< Route path = "/:user/:repl" element = { < Edit dark = { dark ( ) } /> } />
57
- < Route path = "/:id " element = { < Home /> } />
57
+ < Route path = "/:user " element = { < Home /> } />
58
58
< Route path = "/" element = { < Home /> } />
59
59
< Route path = "/login" element = { < Login /> } />
60
60
</ Routes >
Original file line number Diff line number Diff line change 1
- import { useNavigate , useRouteData } from 'solid-app-router' ;
1
+ import { useNavigate , useParams } from 'solid-app-router' ;
2
2
import { Icon } from 'solid-heroicons' ;
3
3
import { eye , eyeOff , plus , x } from 'solid-heroicons/outline' ;
4
4
import { createResource , For } from 'solid-js' ;
@@ -21,11 +21,10 @@ interface Repls {
21
21
}
22
22
23
23
export const Home = ( ) => {
24
- const routeUser = useRouteData ( ) ;
24
+ const params = useParams ( ) ;
25
25
const context = useAppContext ( ) ! ;
26
26
const navigate = useNavigate ( ) ;
27
-
28
- const user = ( ) => routeUser || context . user ( ) ?. display ;
27
+ const user = ( ) => params . user || context . user ( ) ?. display ;
29
28
30
29
const [ repls ] = createResource ( user , async ( user ) => {
31
30
if ( ! user ) return { total : 0 , list : [ ] } ;
You can’t perform that action at this time.
0 commit comments