Skip to content

Commit 5831f7c

Browse files
committed
fix: leptos format
1 parent 8f095ef commit 5831f7c

16 files changed

+102
-114
lines changed

src/app.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn App() -> impl IntoView {
1111
view! {
1212
<Router>
1313
<Routes>
14-
<Route path="" view=|| view! { <Index /> }/>
14+
<Route path="" view=|| view! { <Index/> }/>
1515
</Routes>
1616
</Router>
1717
}

src/components/button_link.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ pub fn ButtonLink(
2020
<a
2121
href=href
2222
target="_blank"
23-
class=format!("tracking-wider font-work-sans border border-black flex items-center px-4 drop-shadow-[4px_4px_0_rgba(0,0,0)] hover:drop-shadow-[0_0_0_rgba(0,0,0)] transition w-fit gap-x-4 sm:whitespace-nowrap max-w-[10rem] sm:max-w-none {} {}", current_color, current_size)
23+
class=format!(
24+
"tracking-wider font-work-sans border border-black flex items-center px-4 drop-shadow-[4px_4px_0_rgba(0,0,0)] hover:drop-shadow-[0_0_0_rgba(0,0,0)] transition w-fit gap-x-4 sm:whitespace-nowrap max-w-[10rem] sm:max-w-none {} {}",
25+
current_color, current_size
26+
)
2427
>
28+
2529
{children()}
2630
</a>
2731
}

src/components/cards/card_title.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,19 @@ use leptos::*;
44
pub fn CardTitle(#[prop(into)] texts: Vec<&'static str>) -> impl IntoView {
55
view! {
66
<h5 class="text-xl">
7-
{texts.into_iter()
8-
.map(|word|
7+
{texts
8+
.into_iter()
9+
.map(|word| {
910
if word.to_lowercase().contains("rust") {
1011
view! {
1112
<span class="font-alfa-slab text-orange-500 group-hover:text-white">
1213
{word}
1314
</span>
1415
}
1516
} else {
16-
view! {
17-
<span class="font-work-sans text-black">
18-
{word}
19-
</span>
20-
}
17+
view! { <span class="font-work-sans text-black">{word}</span> }
2118
}
22-
)
19+
})
2320
.collect::<Vec<_>>()}
2421
</h5>
2522
}

src/components/cards/community_card.rs

+8-9
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,18 @@ pub fn CommunityCard(
2222
class="group flex flex-col gap-y-6 border border-black p-6 hover:bg-orange-500 bg-orange-100 drop-shadow-[0_0_0_rgba(0,0,0)] hover:drop-shadow-[-4px_-4px_0_rgba(0,0,0)] transition justify-between"
2323
>
2424
<div>
25-
<img src=brand_src width="60" class="rounded-full mb-4" alt=brand_alt />
26-
<CardTitle texts=name />
27-
<p class="font-work-sans text-black">
28-
{description}
29-
</p>
25+
<img src=brand_src width="60" class="rounded-full mb-4" alt=brand_alt/>
26+
<CardTitle texts=name/>
27+
<p class="font-work-sans text-black">{description}</p>
3028
</div>
3129
<span class="ml-auto">
3230
{move || match icon {
33-
"discord" => view!{ <DiscordIcon size=30 /> },
34-
"github" => view!{ <GithubIcon size=30 /> },
35-
"telegram" => view!{ <TelegramIcon size=30 /> },
36-
_ => view!{ <DummyComponent /> }
31+
"discord" => view! { <DiscordIcon size=30/> },
32+
"github" => view! { <GithubIcon size=30/> },
33+
"telegram" => view! { <TelegramIcon size=30/> },
34+
_ => view! { <DummyComponent/> },
3735
}}
36+
3837
</span>
3938
</a>
4039
}

src/components/cards/project_card.rs

+11-12
Original file line numberDiff line numberDiff line change
@@ -32,30 +32,28 @@ pub fn ProjectCard(
3232
<div class="flex flex-col justify-between gap-y-2">
3333
{if brand_as_letter {
3434
view! {
35-
<span
36-
class=format!(
37-
"h-[60px] w-[60px] rounded-full text-4xl flex justify-center items-center {}",
38-
current_color
39-
)
40-
>
35+
<span class=format!(
36+
"h-[60px] w-[60px] rounded-full text-4xl flex justify-center items-center {}",
37+
current_color
38+
)>
39+
4140
{brand_src}
4241
</span>
4342
}
4443
} else {
4544
view! {
4645
<span>
4746
<img
48-
src=brand_src width="60"
47+
src=brand_src
48+
width="60"
4949
class=format!("rounded-full h-[60px] w-[60px] {}", current_color)
5050
alt=brand_alt
5151
/>
5252
</span>
5353
}
5454
}}
55-
<CardTitle texts=name.clone() />
56-
<p class="mt-2 font-work-sans text-black">
57-
{description}
58-
</p>
55+
<CardTitle texts=name.clone()/>
56+
<p class="mt-2 font-work-sans text-black">{description}</p>
5957
</div>
6058
<div class="flex gap-2 items-center mt-4">
6159
<ButtonLink href=button_link size="tiny">
@@ -64,9 +62,10 @@ pub fn ProjectCard(
6462
} else {
6563
button_text.to_string()
6664
}}
65+
6766
</ButtonLink>
6867
<span class="ml-auto">
69-
<GithubIcon size=30 />
68+
<GithubIcon size=30/>
7069
</span>
7170
</div>
7271
</a>

src/components/community_projects.rs

+17-14
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,23 @@ pub fn CommunityProjects() -> impl IntoView {
9696
<span class="font-alfa-slab text-orange-500">"Comunidad"</span>
9797
</h2>
9898
<div class="w-full grid sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 sm:gap-x-8 gap-y-4">
99-
{items.into_iter().map(|item| {
100-
view! {
101-
<ProjectCard
102-
name=item.name
103-
description=item.description
104-
link=item.link
105-
brand_src=item.brand_src
106-
button_link=item.button_link
107-
button_text=item.button_text
108-
brand_as_letter=item.brand_as_letter
109-
button_bg_color=item.button_bg_color
110-
/>
111-
}
112-
}).collect::<Vec<_>>()}
99+
{items
100+
.into_iter()
101+
.map(|item| {
102+
view! {
103+
<ProjectCard
104+
name=item.name
105+
description=item.description
106+
link=item.link
107+
brand_src=item.brand_src
108+
button_link=item.button_link
109+
button_text=item.button_text
110+
brand_as_letter=item.brand_as_letter
111+
button_bg_color=item.button_bg_color
112+
/>
113+
}
114+
})
115+
.collect::<Vec<_>>()}
113116
</div>
114117
</div>
115118
</section>

src/components/dummy_component.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@ use leptos::*;
22

33
#[component]
44
pub fn DummyComponent() -> impl IntoView {
5-
view! {
6-
<div></div>
7-
}
5+
view! { <div></div> }
86
}

src/components/header.rs

+11-10
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,23 @@ pub fn Header() -> impl IntoView {
1717
alt="Rust Lang en Español"
1818
/>
1919
</div>
20-
<button class="lg:hidden" on:click=move |_| {set_is_open.update(|n| *n = !*n)}>
20+
<button
21+
class="lg:hidden"
22+
on:click=move |_| { set_is_open.update(|n| *n = !*n) }
23+
>
2124
<span class="w-6 h-1 bg-black block my-4 relative after:absolute after:block after:bg-black after:w-6 after:h-1 after:bottom-2 before:absolute before:block before:bg-black before:w-6 before:h-1 before:-bottom-2"></span>
2225
</button>
2326
</div>
24-
<nav
25-
class=move || format!(
26-
"w-full lg:w-auto pb-10 pt-5 lg:p-0 {}",
27-
if is_open() { "block" } else { "hidden lg:block" }
27+
<nav class=move || {
28+
format!(
29+
"w-full lg:w-auto pb-10 pt-5 lg:p-0 {}", if is_open() { "block" } else {
30+
"hidden lg:block" }
2831
)
29-
>
32+
}>
33+
3034
<ul class="flex items-center gap-6 flex-col lg:flex-row lg:items-center">
3135
<li>
32-
<a
33-
href="https://rustlanges.github.io/rust-book-es"
34-
target="_blank"
35-
>
36+
<a href="https://rustlanges.github.io/rust-book-es" target="_blank">
3637
"Aprende"
3738
</a>
3839
</li>

src/components/hero.rs

+11-5
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,23 @@ use crate::components::header::Header;
66
pub fn Hero() -> impl IntoView {
77
view! {
88
<section class="w-full flex flex-col">
9-
<Header />
9+
<Header/>
1010
<div class="flex items-center justify-center py-14 lg:py-32 px-4">
1111
<div class="grid items-center gap-x-20 gap-y-10 lg:grid-cols-2">
1212
<figure class="w-80 mx-auto lg:w-full">
13-
<img src="./rhq3ezvso9611-min.png" width="500" class="mx-auto" />
13+
<img src="./rhq3ezvso9611-min.png" width="500" class="mx-auto"/>
1414
</figure>
1515
<div class="">
1616
<h1 class="flex flex-col mb-4 gap-y-2">
17-
<span class="font-work-sans text-4xl font-light text-center lg:text-left">"Bienvenidos a"</span>
18-
<span class="font-alfa-slab text-orange-500 text-6xl sm:text-7xl lg:text-8xl text-center lg:text-left">"Rust Lang"</span>
19-
<span class="font-work-sans text-5xl font-semibold text-center lg:text-left">"En Español"</span>
17+
<span class="font-work-sans text-4xl font-light text-center lg:text-left">
18+
"Bienvenidos a"
19+
</span>
20+
<span class="font-alfa-slab text-orange-500 text-6xl sm:text-7xl lg:text-8xl text-center lg:text-left">
21+
"Rust Lang"
22+
</span>
23+
<span class="font-work-sans text-5xl font-semibold text-center lg:text-left">
24+
"En Español"
25+
</span>
2026
</h1>
2127
<p class="font-work-sans font-light text-center lg:text-left">
2228
"Una comunidad de gente mal intencionada y tonta."

src/components/icons/discord_icon.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ pub fn DiscordIcon(
1313
class=class
1414
xmlns="http://www.w3.org/2000/svg"
1515
>
16-
<path
17-
d="M19.2701 5.33C17.9401 4.71 16.5001 4.26 15.0001 4C14.987 3.99958 14.9739 4.00205 14.9618 4.00723C14.9497 4.01241 14.9389 4.02019 14.9301 4.03C14.7501 4.36 14.5401 4.79 14.4001 5.12C12.8091 4.88 11.1911 4.88 9.60012 5.12C9.46012 4.78 9.25012 4.36 9.06012 4.03C9.05012 4.01 9.02012 4 8.99012 4C7.49012 4.26 6.06012 4.71 4.72012 5.33C4.71012 5.33 4.70012 5.34 4.69012 5.35C1.97012 9.42 1.22012 13.38 1.59012 17.3C1.59012 17.32 1.60012 17.34 1.62012 17.35C3.42012 18.67 5.15012 19.47 6.86012 20C6.89012 20.01 6.92012 20 6.93012 19.98C7.33012 19.43 7.69012 18.85 8.00012 18.24C8.02012 18.2 8.00012 18.16 7.96012 18.15C7.39012 17.93 6.85012 17.67 6.32012 17.37C6.28012 17.35 6.28012 17.29 6.31012 17.26C6.42012 17.18 6.53012 17.09 6.64012 17.01C6.66012 16.99 6.69012 16.99 6.71012 17C10.1501 18.57 13.8601 18.57 17.2601 17C17.2801 16.99 17.3101 16.99 17.3301 17.01C17.4401 17.1 17.5501 17.18 17.6601 17.27C17.7001 17.3 17.7001 17.36 17.6501 17.38C17.1301 17.69 16.5801 17.94 16.0101 18.16C15.9701 18.17 15.9601 18.22 15.9701 18.25C16.2901 18.86 16.6501 19.44 17.0401 19.99C17.0701 20 17.1001 20.01 17.1301 20C18.8501 19.47 20.5801 18.67 22.3801 17.35C22.4001 17.34 22.4101 17.32 22.4101 17.3C22.8501 12.77 21.6801 8.84 19.3101 5.35C19.3001 5.34 19.2901 5.33 19.2701 5.33ZM8.52012 14.91C7.49012 14.91 6.63012 13.96 6.63012 12.79C6.63012 11.62 7.47012 10.67 8.52012 10.67C9.58012 10.67 10.4201 11.63 10.4101 12.79C10.4101 13.96 9.57012 14.91 8.52012 14.91ZM15.4901 14.91C14.4601 14.91 13.6001 13.96 13.6001 12.79C13.6001 11.62 14.4401 10.67 15.4901 10.67C16.5501 10.67 17.3901 11.63 17.3801 12.79C17.3801 13.96 16.5501 14.91 15.4901 14.91Z"
18-
/>
16+
<path d="M19.2701 5.33C17.9401 4.71 16.5001 4.26 15.0001 4C14.987 3.99958 14.9739 4.00205 14.9618 4.00723C14.9497 4.01241 14.9389 4.02019 14.9301 4.03C14.7501 4.36 14.5401 4.79 14.4001 5.12C12.8091 4.88 11.1911 4.88 9.60012 5.12C9.46012 4.78 9.25012 4.36 9.06012 4.03C9.05012 4.01 9.02012 4 8.99012 4C7.49012 4.26 6.06012 4.71 4.72012 5.33C4.71012 5.33 4.70012 5.34 4.69012 5.35C1.97012 9.42 1.22012 13.38 1.59012 17.3C1.59012 17.32 1.60012 17.34 1.62012 17.35C3.42012 18.67 5.15012 19.47 6.86012 20C6.89012 20.01 6.92012 20 6.93012 19.98C7.33012 19.43 7.69012 18.85 8.00012 18.24C8.02012 18.2 8.00012 18.16 7.96012 18.15C7.39012 17.93 6.85012 17.67 6.32012 17.37C6.28012 17.35 6.28012 17.29 6.31012 17.26C6.42012 17.18 6.53012 17.09 6.64012 17.01C6.66012 16.99 6.69012 16.99 6.71012 17C10.1501 18.57 13.8601 18.57 17.2601 17C17.2801 16.99 17.3101 16.99 17.3301 17.01C17.4401 17.1 17.5501 17.18 17.6601 17.27C17.7001 17.3 17.7001 17.36 17.6501 17.38C17.1301 17.69 16.5801 17.94 16.0101 18.16C15.9701 18.17 15.9601 18.22 15.9701 18.25C16.2901 18.86 16.6501 19.44 17.0401 19.99C17.0701 20 17.1001 20.01 17.1301 20C18.8501 19.47 20.5801 18.67 22.3801 17.35C22.4001 17.34 22.4101 17.32 22.4101 17.3C22.8501 12.77 21.6801 8.84 19.3101 5.35C19.3001 5.34 19.2901 5.33 19.2701 5.33ZM8.52012 14.91C7.49012 14.91 6.63012 13.96 6.63012 12.79C6.63012 11.62 7.47012 10.67 8.52012 10.67C9.58012 10.67 10.4201 11.63 10.4101 12.79C10.4101 13.96 9.57012 14.91 8.52012 14.91ZM15.4901 14.91C14.4601 14.91 13.6001 13.96 13.6001 12.79C13.6001 11.62 14.4401 10.67 15.4901 10.67C16.5501 10.67 17.3901 11.63 17.3801 12.79C17.3801 13.96 16.5501 14.91 15.4901 14.91Z"></path>
1917
</svg>
2018
}
2119
}

src/components/icons/github_icon.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ pub fn GithubIcon(
1313
class=class
1414
xmlns="http://www.w3.org/2000/svg"
1515
>
16-
<path
17-
d="M12 2C10.6868 2 9.38642 2.25866 8.17317 2.7612C6.95991 3.26375 5.85752 4.00035 4.92893 4.92893C3.05357 6.8043 2 9.34784 2 12C2 16.42 4.87 20.17 8.84 21.5C9.34 21.58 9.5 21.27 9.5 21V19.31C6.73 19.91 6.14 17.97 6.14 17.97C5.68 16.81 5.03 16.5 5.03 16.5C4.12 15.88 5.1 15.9 5.1 15.9C6.1 15.97 6.63 16.93 6.63 16.93C7.5 18.45 8.97 18 9.54 17.76C9.63 17.11 9.89 16.67 10.17 16.42C7.95 16.17 5.62 15.31 5.62 11.5C5.62 10.39 6 9.5 6.65 8.79C6.55 8.54 6.2 7.5 6.75 6.15C6.75 6.15 7.59 5.88 9.5 7.17C10.29 6.95 11.15 6.84 12 6.84C12.85 6.84 13.71 6.95 14.5 7.17C16.41 5.88 17.25 6.15 17.25 6.15C17.8 7.5 17.45 8.54 17.35 8.79C18 9.5 18.38 10.39 18.38 11.5C18.38 15.32 16.04 16.16 13.81 16.41C14.17 16.72 14.5 17.33 14.5 18.26V21C14.5 21.27 14.66 21.59 15.17 21.5C19.14 20.16 22 16.42 22 12C22 10.6868 21.7413 9.38642 21.2388 8.17317C20.7362 6.95991 19.9997 5.85752 19.0711 4.92893C18.1425 4.00035 17.0401 3.26375 15.8268 2.7612C14.6136 2.25866 13.3132 2 12 2Z"
18-
/>
16+
<path d="M12 2C10.6868 2 9.38642 2.25866 8.17317 2.7612C6.95991 3.26375 5.85752 4.00035 4.92893 4.92893C3.05357 6.8043 2 9.34784 2 12C2 16.42 4.87 20.17 8.84 21.5C9.34 21.58 9.5 21.27 9.5 21V19.31C6.73 19.91 6.14 17.97 6.14 17.97C5.68 16.81 5.03 16.5 5.03 16.5C4.12 15.88 5.1 15.9 5.1 15.9C6.1 15.97 6.63 16.93 6.63 16.93C7.5 18.45 8.97 18 9.54 17.76C9.63 17.11 9.89 16.67 10.17 16.42C7.95 16.17 5.62 15.31 5.62 11.5C5.62 10.39 6 9.5 6.65 8.79C6.55 8.54 6.2 7.5 6.75 6.15C6.75 6.15 7.59 5.88 9.5 7.17C10.29 6.95 11.15 6.84 12 6.84C12.85 6.84 13.71 6.95 14.5 7.17C16.41 5.88 17.25 6.15 17.25 6.15C17.8 7.5 17.45 8.54 17.35 8.79C18 9.5 18.38 10.39 18.38 11.5C18.38 15.32 16.04 16.16 13.81 16.41C14.17 16.72 14.5 17.33 14.5 18.26V21C14.5 21.27 14.66 21.59 15.17 21.5C19.14 20.16 22 16.42 22 12C22 10.6868 21.7413 9.38642 21.2388 8.17317C20.7362 6.95991 19.9997 5.85752 19.0711 4.92893C18.1425 4.00035 17.0401 3.26375 15.8268 2.7612C14.6136 2.25866 13.3132 2 12 2Z"></path>
1917
</svg>
2018
}
2119
}

src/components/icons/telegram_icon.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ pub fn TelegramIcon(
1313
class=class
1414
xmlns="http://www.w3.org/2000/svg"
1515
>
16-
<path
17-
d="M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM16.64 8.8C16.49 10.38 15.84 14.22 15.51 15.99C15.37 16.74 15.09 16.99 14.83 17.02C14.25 17.07 13.81 16.64 13.25 16.27C12.37 15.69 11.87 15.33 11.02 14.77C10.03 14.12 10.67 13.76 11.24 13.18C11.39 13.03 13.95 10.7 14 10.49C14.0069 10.4582 14.006 10.4252 13.9973 10.3938C13.9886 10.3624 13.9724 10.3337 13.95 10.31C13.89 10.26 13.81 10.28 13.74 10.29C13.65 10.31 12.25 11.24 9.52 13.08C9.12 13.35 8.76 13.49 8.44 13.48C8.08 13.47 7.4 13.28 6.89 13.11C6.26 12.91 5.77 12.8 5.81 12.45C5.83 12.27 6.08 12.09 6.55 11.9C9.47 10.63 11.41 9.79 12.38 9.39C15.16 8.23 15.73 8.03 16.11 8.03C16.19 8.03 16.38 8.05 16.5 8.15C16.6 8.23 16.63 8.34 16.64 8.42C16.63 8.48 16.65 8.66 16.64 8.8Z"
18-
/>
16+
<path d="M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM16.64 8.8C16.49 10.38 15.84 14.22 15.51 15.99C15.37 16.74 15.09 16.99 14.83 17.02C14.25 17.07 13.81 16.64 13.25 16.27C12.37 15.69 11.87 15.33 11.02 14.77C10.03 14.12 10.67 13.76 11.24 13.18C11.39 13.03 13.95 10.7 14 10.49C14.0069 10.4582 14.006 10.4252 13.9973 10.3938C13.9886 10.3624 13.9724 10.3337 13.95 10.31C13.89 10.26 13.81 10.28 13.74 10.29C13.65 10.31 12.25 11.24 9.52 13.08C9.12 13.35 8.76 13.49 8.44 13.48C8.08 13.47 7.4 13.28 6.89 13.11C6.26 12.91 5.77 12.8 5.81 12.45C5.83 12.27 6.08 12.09 6.55 11.9C9.47 10.63 11.41 9.79 12.38 9.39C15.16 8.23 15.73 8.03 16.11 8.03C16.19 8.03 16.38 8.05 16.5 8.15C16.6 8.23 16.63 8.34 16.64 8.42C16.63 8.48 16.65 8.66 16.64 8.8Z"></path>
1917
</svg>
2018
}
2119
}

src/components/other_communities.rs

+15-12
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,21 @@ pub fn OtherCommunities() -> impl IntoView {
6565
<span class="font-work-sans font-light">" recomendadas "</span>
6666
</h2>
6767
<div class="w-full grid sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-x-8 gap-y-4">
68-
{items.into_iter().map(|item| {
69-
view! {
70-
<CommunityCard
71-
name=item.name.clone()
72-
description=item.description
73-
link=item.link
74-
icon=item.icon
75-
brand_src=item.brand_src
76-
brand_alt=item.brand_alt
77-
/>
78-
}
79-
}).collect::<Vec<_>>()}
68+
{items
69+
.into_iter()
70+
.map(|item| {
71+
view! {
72+
<CommunityCard
73+
name=item.name.clone()
74+
description=item.description
75+
link=item.link
76+
icon=item.icon
77+
brand_src=item.brand_src
78+
brand_alt=item.brand_alt
79+
/>
80+
}
81+
})
82+
.collect::<Vec<_>>()}
8083
</div>
8184
</div>
8285
</section>

0 commit comments

Comments
 (0)