Skip to content

Commit cf087d6

Browse files
committed
format
1 parent e01d4d8 commit cf087d6

File tree

2 files changed

+39
-35
lines changed

2 files changed

+39
-35
lines changed

src/components/aprende/books.rs

+36-32
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,19 @@ BookData {
4242
pub fn Books() -> impl IntoView {
4343
let book = |book: BookData| {
4444
view! {
45-
<Book title={book.name} description={book.description} link={book.url} link_text={book.url_name} incomplete={!book.complete}>
45+
<Book
46+
title=book.name
47+
description=book.description
48+
link=book.url
49+
link_text=book.url_name
50+
incomplete=!book.complete
51+
>
4652
{book
4753
.english
4854
.then_some(|| {
49-
view! {
50-
<Badge color="teal"> "En Inglés" </Badge>
51-
}
55+
view! { <Badge color="teal">"En Inglés"</Badge> }
5256
})}
57+
5358
</Book>
5459
}
5560
};
@@ -73,11 +78,21 @@ pub fn Books() -> impl IntoView {
7378
</p>
7479
</div>
7580
<div class="grid grid-cols-1 md:grid-cols-2 container mx-auto mb-16 md:mb-28 gap-4 h-fit">
76-
<Book title="El lenguaje de Programación Rust" description="Cariñosamente conocido como “el libro”, El Lenguaje de Programación Rust te dará una visión del lenguaje desde los principios básicos. Construirás unos cuantos proyectos por el camino y, al final, tendrás una comprensión sólida del lenguaje." link="https://rustlang-es.org/rust-book-es" link_text="Ir a “El Libro”">
77-
<Badge color="teal"> "Recomendado" </Badge>
81+
<Book
82+
title="El lenguaje de Programación Rust"
83+
description="Cariñosamente conocido como “el libro”, El Lenguaje de Programación Rust te dará una visión del lenguaje desde los principios básicos. Construirás unos cuantos proyectos por el camino y, al final, tendrás una comprensión sólida del lenguaje."
84+
link="https://rustlang-es.org/rust-book-es"
85+
link_text="Ir a “El Libro”"
86+
>
87+
<Badge color="teal">"Recomendado"</Badge>
7888
</Book>
79-
<Book title="Rust para C#/.NET Developers" description="La guía esta hecha por la misma Microsoft y es para desarrolladores experimentados en C#/.NET que exploran Rust. Ofrece una breve comparación, enlaces a recursos y respuestas rápidas." link="https://rustlang-es.org/rust-para-dotnet-devs" link_text="Ir a la guía">
80-
<Badge color="yellow"> "¡En Progreso!" </Badge>
89+
<Book
90+
title="Rust para C#/.NET Developers"
91+
description="La guía esta hecha por la misma Microsoft y es para desarrolladores experimentados en C#/.NET que exploran Rust. Ofrece una breve comparación, enlaces a recursos y respuestas rápidas."
92+
link="https://rustlang-es.org/rust-para-dotnet-devs"
93+
link_text="Ir a la guía"
94+
>
95+
<Badge color="yellow">"¡En Progreso!"</Badge>
8196
</Book>
8297
</div>
8398

@@ -98,25 +113,20 @@ pub fn Books() -> impl IntoView {
98113

99114
#[component]
100115
fn Book(
101-
#[prop(into)]
102-
title: String,
103-
#[prop(into)]
104-
description: String,
105-
#[prop(into)]
106-
link: String,
107-
#[prop(into)]
108-
link_text: String,
109-
#[prop(optional)]
110-
incomplete: bool,
111-
children: Children) -> impl IntoView {
116+
#[prop(into)] title: String,
117+
#[prop(into)] description: String,
118+
#[prop(into)] link: String,
119+
#[prop(into)] link_text: String,
120+
#[prop(optional)] incomplete: bool,
121+
children: Children,
122+
) -> impl IntoView {
112123
view! {
113124
<article class="w-full h-full px-8">
114125
<div class="h-full relative group flex flex-col gap-y-6 border border-black p-2 sm:p-6 bg-orange-100 dark:hover:bg-zinc-900/40 dark:bg-black/40 drop-shadow-[0_0_0_rgba(0,0,0)] hover:drop-shadow-[-4px_-4px_0_rgba(0,0,0)] justify-between group transition-all transform">
115126
{children()}
116127
<h1 class="font-alfa-slab text-xl sm:text-2xl lg:text-3xl text-center mb-5">
117128
{title}
118-
</h1>
119-
<p class="container mx-auto text-pretty"> {description} </p>
129+
</h1> <p class="container mx-auto text-pretty">{description}</p>
120130
{incomplete
121131
.then_some(|| {
122132
view! {
@@ -128,7 +138,7 @@ fn Book(
128138
}
129139
})}
130140
<div class="mx-auto">
131-
<ButtonLink href={link} size="big">
141+
<ButtonLink href=link size="big">
132142
{link_text}
133143
</ButtonLink>
134144
</div>
@@ -138,24 +148,18 @@ fn Book(
138148
}
139149

140150
#[component]
141-
fn Badge(
142-
color: &'static str,
143-
children: Children) -> impl IntoView {
144-
let colors = HashMap::from([
145-
("teal", "bg-teal-500"),
146-
("yellow", "bg-yellow-500"),
147-
]);
151+
fn Badge(color: &'static str, children: Children) -> impl IntoView {
152+
let colors = HashMap::from([("teal", "bg-teal-500"), ("yellow", "bg-yellow-500")]);
148153
let color = (*colors.get(&color).expect("Unknown color")).to_string();
149154

150155
view! {
151156
<span class=format!(
152-
"absolute top-0 end-0 inline-flex items-center size-3.5 group-hover:min-w-28 rounded-full border-2 border-white text-xs font-medium transition-all transform -translate-y-1/2 translate-x-1/2 badge-container dark:border-slate-900 {}",
153-
color
157+
"absolute top-0 end-0 inline-flex items-center size-3.5 group-hover:min-w-28 rounded-full border-2 border-white text-xs font-medium transition-all transform -translate-y-1/2 translate-x-1/2 badge-container dark:border-slate-900 {}",
158+
color,
154159
)>
155160
<span class="sr-only text-black badge-content transition-all transform">
156161
{children()}
157162
</span>
158163
</span>
159164
}
160165
}
161-

src/components/cards/project_card.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ pub fn ProjectCard(
5555
button_text.to_string()
5656
}}
5757

58-
</ButtonLink>
59-
<span class="px-1">
58+
</ButtonLink>
59+
<span class="px-1">
6060
<GithubIcon size=30/>
61-
</span>
61+
</span>
6262
</div>
6363
</a>
6464
</div>

0 commit comments

Comments
 (0)