Skip to content

Commit e97be52

Browse files
wilovywilovy
authored andcommitted
chore: Format code with CargoMake options
1 parent 4adbb43 commit e97be52

17 files changed

Lines changed: 109 additions & 87 deletions

src/app.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use leptos::{component, view, IntoView};
22
use leptos_meta::{provide_meta_context, Body};
3-
use leptos_router::{Router, Routes, StaticParamsMap, StaticRoute};
3+
use leptos_router::{Route, Router, Routes, StaticParamsMap, StaticRoute};
44

55
use crate::{
66
components::{Footer, HeadInformation, Header},
@@ -19,19 +19,15 @@ pub fn App() -> impl IntoView {
1919

2020
view! {
2121
<Router>
22-
<HeadInformation/>
22+
<HeadInformation />
2323
<Body class=format!(
2424
"bg-orange-200 dark:bg-[#131313]/90 bg-center bg-fixed {} dark:bri dark:bg-cover dark:bg-blend-darken dark:backdrop-blur-xl overflow-x-hidden dark:text-[#e2cea9]",
2525
bg_in_dark_mode,
26-
)/>
27-
<Header/>
26+
) />
27+
<Header />
2828
<main>
2929
<Routes>
30-
<StaticRoute
31-
path="/"
32-
view=Index
33-
static_params=move || Box::pin(async move { StaticParamsMap::default() })
34-
/>
30+
<Route path="/" view=Index />
3531
<StaticRoute
3632
path="/comunidades"
3733
view=Communities
@@ -59,7 +55,7 @@ pub fn App() -> impl IntoView {
5955
/>
6056
</Routes>
6157
</main>
62-
<Footer/>
58+
<Footer />
6359
</Router>
6460
}
6561
}

src/components/cards/community_card.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ pub fn CommunityCard(
2929
loading="lazy"
3030
alt=brand_alt
3131
/>
32-
<CardTitle texts=name/>
32+
<CardTitle texts=name />
3333
<p class="font-work-sans text-black dark:text-white">{description}</p>
3434
</div>
3535
<span class="ml-auto">
3636
{move || match icon {
37-
"discord" => view! { <DiscordIcon size=30/> },
38-
"github" => view! { <GithubIcon size=30/> },
39-
"telegram" => view! { <TelegramIcon size=30/> },
40-
"web" => view! { <WebIcon size=30/> },
37+
"discord" => view! { <DiscordIcon size=30 /> },
38+
"github" => view! { <GithubIcon size=30 /> },
39+
"telegram" => view! { <TelegramIcon size=30 /> },
40+
"web" => view! { <WebIcon size=30 /> },
4141
_ => unreachable!(),
4242
}}
4343

src/components/cards/contributor_card.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ pub fn ContributorCard(
2121
</span>
2222
</span>
2323
<div class="flex flex-col gap-y-2">
24-
<img src=brand_src width="60" class="rounded-full mb-4" alt=name.clone()/>
24+
<img src=brand_src width="60" class="rounded-full mb-4" alt=name.clone() />
2525
<h2 class="font-work-sans text-black dark:text-white text-xl">{name}</h2>
2626
{location
2727
.map(|location| {
2828
view! {
2929
<div class="flex gap-2 items-center bg-slate-200/20 dark:bg-neutral-500/40 rounded-md p-1">
30-
<LocationIcon size=16/>
30+
<LocationIcon size=16 />
3131
<p class="font-work-sans text-black dark:text-white text-sm">
3232
{location}
3333
</p>
@@ -43,12 +43,11 @@ pub fn ContributorCard(
4343
.map(|twitter| {
4444
view! {
4545
<a href=format!("https://twitter.com/{}", twitter) target="_blank">
46-
<TwitterIcon size=30/>
46+
<TwitterIcon size=30 />
4747
</a>
4848
}
49-
})}
50-
<a href=link target="_blank">
51-
<GithubIcon size=30/>
49+
})} <a href=link target="_blank">
50+
<GithubIcon size=30 />
5251
</a>
5352
</div>
5453
</article>

src/components/cards/project_card.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ pub fn ProjectCard(
4343
/>
4444
}
4545
.into_any()
46-
}}
47-
<CardTitle texts=name/>
46+
}} <CardTitle texts=name />
4847
<p class="mt-2 font-work-sans text-black dark:text-white">{description}</p>
4948
</div>
5049
<div class="flex gap-4 sm:gap-0 justify-around items-center mt-4">
@@ -57,7 +56,7 @@ pub fn ProjectCard(
5756

5857
</ButtonLink>
5958
<span class="px-1">
60-
<GithubIcon size=30/>
59+
<GithubIcon size=30 />
6160
</span>
6261
</div>
6362
</a>

src/components/community_projects.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub fn CommunityProjects(#[prop(default = false)] show_more: bool) -> impl IntoV
5151
>
5252
"Ver todos los proyectos"
5353
<span class="inline-block ml-2">
54-
<NextIcon class="fill-current" size=20/>
54+
<NextIcon class="fill-current" size=20 />
5555
</span>
5656
</A>
5757
</div>

src/components/head_information.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,37 +21,37 @@ pub fn HeadInformation() -> impl IntoView {
2121

2222
view! {
2323
<>
24-
<Html lang="es"/>
25-
<Meta charset="utf-8"/>
26-
<Meta name="viewport" content="width=device-width, initial-scale=1"/>
27-
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#fed7aa"/>
28-
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#181811"/>
29-
<Stylesheet id="fonts" href=format!("{}/fonts.css", assets_folder)/>
30-
<Stylesheet id="leptos" href="/pkg/leptos_start.css"/>
31-
<Title text="Rust Lang en Español"/>
24+
<Html lang="es" />
25+
<Meta charset="utf-8" />
26+
<Meta name="viewport" content="width=device-width, initial-scale=1" />
27+
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#fed7aa" />
28+
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#181811" />
29+
<Stylesheet id="fonts" href=format!("{}/fonts.css", assets_folder) />
30+
<Stylesheet id="leptos" href="/pkg/leptos_start.css" />
31+
<Title text="Rust Lang en Español" />
3232
<Meta
3333
name="description"
3434
content="Únete a nuestra comunidad de Rust en español. Promovemos el aprendizaje y la difusión de Rust, compartiendo conocimientos y proyectos emocionantes."
3535
/>
3636

37-
<Meta name="og:site_name" content="Rust Lang en Español"/>
38-
<Meta name="og:title" content="Bienvenidos a Rust Lang en Español"/>
37+
<Meta name="og:site_name" content="Rust Lang en Español" />
38+
<Meta name="og:title" content="Bienvenidos a Rust Lang en Español" />
3939
<Meta
4040
name="og:description"
4141
content="Únete a nuestra comunidad de Rust en español. Promovemos el aprendizaje y la difusión de Rust, compartiendo conocimientos y proyectos emocionantes."
4242
/>
43-
<Meta name="og:url" content="https://rustlang-es.org"/>
43+
<Meta name="og:url" content="https://rustlang-es.org" />
4444

45-
<Meta name="twitter:card" content="summary_large_image"/>
46-
<Meta name="twitter:site" content="@rustlang"/>
45+
<Meta name="twitter:card" content="summary_large_image" />
46+
<Meta name="twitter:site" content="@rustlang" />
4747
<Meta
4848
name="google-site-verification"
4949
content="OntIe2SKuQalaapGvxdded9tU4G2p57h0A6e0Rkoni0"
5050
/>
5151

52-
<Meta name="og:image" content=format!("https://rustlang-es.org/{preview}")/>
53-
<Meta name="twitter:image" content=format!("https://rustlang-es.org/{preview}")/>
54-
<Link rel="canonical" href=format!("https://rustlang-es.org{}", path)/>
52+
<Meta name="og:image" content=format!("https://rustlang-es.org/{preview}") />
53+
<Meta name="twitter:image" content=format!("https://rustlang-es.org/{preview}") />
54+
<Link rel="canonical" href=format!("https://rustlang-es.org{}", path) />
5555
<script type="text/javascript">
5656
(function(c,l,a,r,i,t,y){
5757
if ("localhost0.0.0.0::0192.168.0.1192.168.1.1".includes(document.location.hostname)) return;

src/components/header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn Header() -> impl IntoView {
1313
<div class="container mx-auto px-4 flex items-center justify-between flex-col lg:flex-row">
1414
<div class="flex justify-between w-full lg:w-auto">
1515
<a href="/" exact=true class="flex items-center gap-x-4">
16-
<LogoRustPageIcon size=80/>
16+
<LogoRustPageIcon size=80 />
1717
</a>
1818
<button
1919
class="lg:hidden"

src/components/hero.rs

Lines changed: 49 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,62 @@
11
use crate::components::SloganButton;
2-
use leptos::{component, view, IntoView};
2+
use leptos::{island, view, IntoView, SignalGet};
3+
use leptos_router::use_query_map;
34

4-
#[component]
5+
#[island]
56
pub fn Hero() -> impl IntoView {
6-
let image_src = if cfg!(debug_assertions) {
7-
"./assets/ferris-hero.avif"
7+
let query_params = use_query_map();
8+
9+
let image_src = if query_params.get().get("uwu").is_some() && cfg!(debug_assertions) {
10+
"./assets/RustLang_Uwu.png"
811
} else {
9-
"/ferris-hero.avif"
12+
"./assets/ferris-hero.avif"
1013
};
1114

15+
let uwu = query_params.get().get("uwu").is_some();
16+
1217
view! {
13-
<section class="grid items-center py-14 lg:py-32 px-4 gap-x-20 gap-y-10 lg:grid-cols-2 w-full">
18+
<section
19+
class=(
20+
"grid items-center py-14 lg:py-32 px-4 gap-x-20 gap-y-10 lg:grid-cols-2 w-full",
21+
move || uwu == false,
22+
)
23+
class="grid items-center justify-center"
24+
>
1425
<figure class="w-80 mx-auto lg:w-full">
15-
<img
16-
src=image_src
17-
alt="Rust Lang en Español"
18-
height="300"
19-
width="500"
20-
class="ml-auto"
21-
/>
26+
{if !uwu {
27+
view! {
28+
<img
29+
src=image_src
30+
alt="Rust Lang en Español"
31+
height="300"
32+
width="500"
33+
class="ml-auto"
34+
/>
35+
}
36+
} else {
37+
view! {
38+
<img src=image_src alt="Rust Lang en Español" height="700" width="700" />
39+
}
40+
}}
2241
</figure>
2342
<div>
24-
<h1 class="flex flex-col mb-4 gap-y-2">
25-
<span class="font-work-sans text-4xl font-light text-center lg:text-left">
26-
"Bienvenidos a"
27-
</span>
28-
<span class="font-alfa-slab text-orange-500 dark:text-orange_(pantone)-500 text-6xl sm:text-7xl lg:text-8xl text-center lg:text-left">
29-
"Rust Lang"
30-
</span>
31-
<span class="font-work-sans text-5xl font-semibold text-center lg:text-left">
32-
"En Español"
33-
</span>
34-
</h1>
35-
<SloganButton/>
43+
{if !uwu {
44+
view! {
45+
<h1 class="flex flex-col mb-4 gap-y-2">
46+
<span class="font-work-sans text-4xl font-light text-center lg:text-left">
47+
"Bienvenidos a"
48+
</span>
49+
<span class="font-alfa-slab text-orange-500 dark:text-orange_(pantone)-500 text-6xl sm:text-7xl lg:text-8xl text-center lg:text-left">
50+
"Rust Lang"
51+
</span>
52+
<span class="font-work-sans text-5xl font-semibold text-center lg:text-left">
53+
"En Español"
54+
</span>
55+
</h1>
56+
}
57+
} else {
58+
view! { <h1 class="hidden">"UwU"</h1> }
59+
}} <SloganButton uwu=uwu />
3660
</div>
3761
</section>
3862
}

src/components/other_communities.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ pub fn OtherCommunities(
7171
>
7272
"Ver todas las comunidades"
7373
<span class="inline-block ml-2">
74-
<NextIcon class="fill-current" size=20/>
74+
<NextIcon class="fill-current" size=20 />
7575
</span>
7676
</a>
7777
</div>

src/components/our_communities.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub fn OurCommunities() -> impl IntoView {
2222
color="white"
2323
size="big"
2424
>
25-
<DiscordIcon size=30/>
25+
<DiscordIcon size=30 />
2626
"Discord"
2727
</ButtonLink>
2828
<ButtonLink
@@ -31,7 +31,7 @@ pub fn OurCommunities() -> impl IntoView {
3131
color="white"
3232
size="big"
3333
>
34-
<GithubIcon size=30/>
34+
<GithubIcon size=30 />
3535
"Github"
3636
</ButtonLink>
3737
<ButtonLink
@@ -40,7 +40,7 @@ pub fn OurCommunities() -> impl IntoView {
4040
size="big"
4141
shadow="box"
4242
>
43-
<LinkedinIcon size=30/>
43+
<LinkedinIcon size=30 />
4444
"Linkedin"
4545
</ButtonLink>
4646
<ButtonLink
@@ -49,7 +49,7 @@ pub fn OurCommunities() -> impl IntoView {
4949
color="white"
5050
size="big"
5151
>
52-
<TelegramIcon size=30/>
52+
<TelegramIcon size=30 />
5353
"Telegram"
5454
</ButtonLink>
5555
</div>

0 commit comments

Comments
 (0)