File tree 3 files changed +15
-15
lines changed
3 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ pub fn App() -> impl IntoView {
11
11
view ! {
12
12
<Router >
13
13
<Routes >
14
- <Route path="" view=|| view! { <Index /> } />
14
+ <Route path="/ " view=|| view! { <Index /> } />
15
15
<Route path="/colaboradores" view=|| view! { <Contributors /> } />
16
16
</Routes >
17
17
</Router >
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ pub fn Header() -> impl IntoView {
11
11
<header class="border-b border-b-black/20" >
12
12
<div class="container mx-auto px-4 flex items-center justify-between flex-col lg:flex-row" >
13
13
<div class="flex justify-between w-full lg:w-auto" >
14
- <A href="https://rustlanges.github.io /" exact=true class="flex items-center gap-x-4" >
14
+ <A href="/" exact=true class="flex items-center gap-x-4" >
15
15
<img
16
16
src="https://www.rust-lang.org/static/images/rust-logo-blk.svg"
17
17
class="max-h-20 rounded-full"
Original file line number Diff line number Diff line change @@ -26,22 +26,22 @@ async fn fetch_contributors() -> Result<Vec<Contributor>> {
26
26
#[ component]
27
27
pub fn Contributors ( ) -> impl IntoView {
28
28
let contributors_results = create_local_resource ( move || ( ) , |_| fetch_contributors ( ) ) ;
29
+ let contributorMapper = |item : & Contributor | {
30
+ view ! {
31
+ <ContributorCard
32
+ name=item. login. clone( )
33
+ description=""
34
+ link=item. html_url. clone( )
35
+ brand_src=item. avatar_url. clone( )
36
+ />
37
+ }
38
+ } ;
29
39
30
40
let contributors_view = move || {
31
- let data = contributors_results. get ( ) ;
32
- let Some ( Ok ( items) ) = data else { return None } ;
33
- let result = items
41
+ let contributors = contributors_results. get ( ) ?. ok ( ) ?;
42
+ let result = contributors
34
43
. iter ( )
35
- . map ( |item| {
36
- view ! {
37
- <ContributorCard
38
- name=item. login. clone( )
39
- description=""
40
- link=item. html_url. clone( )
41
- brand_src=item. avatar_url. clone( )
42
- />
43
- }
44
- } )
44
+ . map ( contributorMapper)
45
45
. collect :: < Fragment > ( ) ;
46
46
Some ( result. into_view ( ) )
47
47
} ;
You can’t perform that action at this time.
0 commit comments