Skip to content

Commit 981522c

Browse files
committed
Merge branch 'main' into october
2 parents 8f02899 + 07a6252 commit 981522c

13 files changed

+151
-16
lines changed

flake.nix

+4-9
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,10 @@
3333
let
3434
inherit (pkgs) lib;
3535
# Toolchain with wasm32 target
36-
toolchain = with fenix.packages.${system};
37-
combine [
38-
complete.cargo
39-
complete.clippy
40-
complete.rust-src
41-
complete.rustc
42-
complete.rustfmt
43-
targets.wasm32-unknown-unknown.latest.rust-std
44-
];
36+
toolchain = fenix.packages.${system}.fromToolchainFile {
37+
file = ./rust-toolchain.toml;
38+
sha256 = "sha256-2Af13p12CWwmppsdujS1EeCQ41u0rMzJmqNh7WQ2QKM=";
39+
};
4540
# craneLib with wasm32 toolchain
4641
craneLib = crane.lib.${system}.overrideToolchain toolchain;
4742
# Node modules installer

rust-toolchain.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
[toolchain]
22
channel = "nightly-2024-02-12"
3-
profile = "default"
3+
profile = "minimal"
4+
targets = ["wasm32-unknown-unknown"]
5+

src/components/button_large_link.rs

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
use leptos::{component, view, Children, IntoView};
2+
use std::collections::HashMap;
3+
4+
#[component]
5+
pub fn ButtonLargeLink(
6+
#[prop(into)] href: String,
7+
#[prop(default = "primary")] color: &'static str,
8+
#[prop(default = "normal")] size: &'static str,
9+
#[prop(default = "drop")] shadow: &'static str,
10+
#[prop(into, optional)] class: String,
11+
children: Children,
12+
) -> impl IntoView {
13+
let colors = HashMap::from([
14+
(
15+
"primary",
16+
"bg-orange-200 dark:bg-transparent hover:bg-black hover:text-white",
17+
),
18+
("white", "bg-orange-100 dark:bg-transparent hover:bg-black hover:text-white"),
19+
]);
20+
let shadows = HashMap::from([
21+
("drop", "drop-shadow-[4px_4px_0_rgba(0,0,0)] hover:drop-shadow-[0_0_0_rgba(0,0,0)]"),
22+
("box", "drop-shadow-[4px_4px_0_rgba(0,0,0)] hover:drop-shadow-[0_0_0_rgba(0,0,0)] dark:drop-shadow-none shadow-sm hover:drop-shadow-none dark:hover:shadow-lg shadow-black"),
23+
]);
24+
let sizes = HashMap::from([("tiny", "min-h-7"), ("normal", "h-9"), ("big", "h-12")]);
25+
let current_color = (*colors.get(&color).unwrap()).to_string();
26+
let current_size = (*sizes.get(&size).unwrap()).to_string();
27+
let shadow = (*shadows.get(&shadow).unwrap()).to_string();
28+
29+
view! {
30+
<a
31+
href=href
32+
target="_blank"
33+
class=format!(
34+
"tracking-wider text-center font-work-sans border border-black dark:border-white flex items-center px-4 transition w-full max-w-full sm:max-w-[20rem] gap-x-4 {} {} {} {} whitespace-nowrap",
35+
current_color,
36+
current_size,
37+
class,
38+
shadow,
39+
)
40+
>
41+
42+
{children()}
43+
</a>
44+
}
45+
}
46+

src/components/button_link.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub fn ButtonLink(
1515
"primary",
1616
"bg-orange-200 dark:bg-transparent hover:bg-black hover:text-white",
1717
),
18-
("white", "bg-orange-100 dark:bg-transparent hover:bg-black"),
18+
("white", "bg-orange-100 dark:bg-transparent hover:bg-black hover:text-white"),
1919
]);
2020
let shadows = HashMap::from([
2121
("drop", "drop-shadow-[4px_4px_0_rgba(0,0,0)] hover:drop-shadow-[0_0_0_rgba(0,0,0)]"),

src/components/hacktoberfest.rs

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
use leptos::{component, view, IntoView};
2+
3+
use crate::components::{
4+
button_link::ButtonLink,
5+
button_large_link::ButtonLargeLink,
6+
icons::{DiscordIcon, CalendarIcon, GithubIcon},
7+
};
8+
9+
#[component]
10+
pub fn Hacktoberfest() -> impl IntoView {
11+
view! {
12+
<section class="bg-orange-200/30 dark:bg-transparent">
13+
<div class="container mx-auto px-4">
14+
<div class="flex flex-col items-center py-20 gap-y-6">
15+
<h2 class="text-4xl text-center mb-4">
16+
<span class="font-work-sans font-light">
17+
"🚀 ¡Únete a la celebración del"
18+
<span class="font-alfa-slab text-orange-500">" Hacktoberfest "</span>
19+
"con nosotros! 🚀"
20+
</span>
21+
</h2>
22+
<p class="text-center text-xl">
23+
"Este" <span class="text-orange-500 font-alfa-slab">" 28 de septiembre"</span>"
24+
, nuestro comunidad se une a este emocionante evento de programación.
25+
Aprovecha esta excelente oportunidad para contribuir a proyectos open-source, aprender nuevas habilidades
26+
y conectar con otros amantes del open-source."
27+
</p>
28+
<div class="flex items-center gap-x-12 gap-y-6 flex-col *:w-full sm:flex-row">
29+
<ButtonLink
30+
href="https://discord.gg/4ng5HgmaMg"
31+
shadow="box"
32+
color="white"
33+
size="big"
34+
>
35+
<DiscordIcon size=30/>
36+
"Participa"
37+
</ButtonLink>
38+
<ButtonLargeLink
39+
href="https://calendar.google.com/calendar/event?action=TEMPLATE&tmeid=M2ZiMjhzbGNqbTZoMjNrZ2ZpbW4zYzk1ZGUgZGFmYzYyODQwMzRkOWJlZjNlMzFkZTNiZDE1OTI2OGQ5OGU4YzlhOGY2MjU3Mzk4NGI3MGE1OWQ2NjU3ZjVhZkBn&tmsrc=dafc6284034d9bef3e31de3bd159268d98e8c9a8f62573984b70a59d6657f5af%40group.calendar.google.com"
40+
shadow="box"
41+
color="white"
42+
size="big"
43+
>
44+
<CalendarIcon size=30/>
45+
"Añade a tu calendario"
46+
</ButtonLargeLink>
47+
<ButtonLargeLink
48+
href="https://github.com/RustLangES"
49+
shadow="box"
50+
color="white"
51+
size="big"
52+
>
53+
<GithubIcon size=30/>
54+
"Postula tu proyecto"
55+
</ButtonLargeLink>
56+
</div>
57+
</div>
58+
</div>
59+
</section>
60+
}
61+
}

src/components/icons/calendar_icon.rs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
use leptos::{component, view, IntoView};
2+
3+
#[component]
4+
pub fn CalendarIcon(
5+
#[prop(default = 40)] size: u32,
6+
#[prop(default = "fill-current dark:fill-[#bf8821]")] class: &'static str,
7+
) -> impl IntoView {
8+
view! {
9+
<svg
10+
width=size
11+
height=size
12+
viewBox="0 0 18 21"
13+
class=class
14+
xmlns="http://www.w3.org/2000/svg"
15+
>
16+
<path d="M13 0.5C13.2449 0.500032 13.4813 0.589956 13.6644 0.752715C13.8474 0.915475 13.9643 1.13975 13.993 1.383L14 1.5V2.5H15C15.7652 2.49996 16.5015 2.79233 17.0583 3.31728C17.615 3.84224 17.9501 4.56011 17.995 5.324L18 5.5V17.5C18 18.2652 17.7077 19.0015 17.1827 19.5583C16.6578 20.115 15.9399 20.4501 15.176 20.495L15 20.5H3C2.23479 20.5 1.49849 20.2077 0.941739 19.6827C0.384993 19.1578 0.0498925 18.4399 0.00500012 17.676L4.66045e-09 17.5V5.5C-4.26217e-05 4.73479 0.292325 3.99849 0.817284 3.44174C1.34224 2.88499 2.06011 2.54989 2.824 2.505L3 2.5H4V1.5C4.00028 1.24512 4.09788 0.999968 4.27285 0.814632C4.44782 0.629296 4.68695 0.517765 4.94139 0.502828C5.19584 0.487891 5.44638 0.570675 5.64183 0.734265C5.83729 0.897855 5.9629 1.1299 5.993 1.383L6 1.5V2.5H12V1.5C12 1.23478 12.1054 0.98043 12.2929 0.792893C12.4804 0.605357 12.7348 0.5 13 0.5ZM16 7.5H2V17.125C2 17.83 2.386 18.411 2.883 18.491L3 18.5H15C15.513 18.5 15.936 17.97 15.993 17.285L16 17.125V7.5Z" fill="current-color"/>
17+
<path d="M9 10.5C9.24493 10.5 9.48134 10.59 9.66437 10.7527C9.84741 10.9155 9.96434 11.1397 9.993 11.383L10 11.5V14.5C9.99972 14.7549 9.90212 15 9.72715 15.1854C9.55218 15.3707 9.31305 15.4822 9.0586 15.4972C8.80416 15.5121 8.55362 15.4293 8.35817 15.2657C8.16271 15.1021 8.0371 14.8701 8.007 14.617L8 14.5V12.5C7.74512 12.4997 7.49997 12.4021 7.31463 12.2272C7.12929 12.0522 7.01776 11.813 7.00283 11.5586C6.98789 11.3042 7.07067 11.0536 7.23426 10.8582C7.39785 10.6627 7.6299 10.5371 7.883 10.507L8 10.5H9Z" fill="current-color"/>
18+
</svg>
19+
}
20+
}
21+

src/components/icons/discord_icon.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use leptos::{component, view, IntoView};
33
#[component]
44
pub fn DiscordIcon(
55
#[prop(default = 40)] size: u32,
6-
#[prop(default = "fill-black dark:fill-[#bf8821]")] class: &'static str,
6+
#[prop(default = "fill-current dark:fill-[#bf8821]")] class: &'static str,
77
) -> impl IntoView {
88
view! {
99
<svg
@@ -17,3 +17,4 @@ pub fn DiscordIcon(
1717
</svg>
1818
}
1919
}
20+

src/components/icons/github_icon.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use leptos::{component, view, IntoView};
33
#[component]
44
pub fn GithubIcon(
55
#[prop(default = 40)] size: u32,
6-
#[prop(default = "fill-black dark:fill-[#bf8821]")] class: &'static str,
6+
#[prop(default = "fill-current dark:fill-[#bf8821]")] class: &'static str,
77
) -> impl IntoView {
88
view! {
99
<svg

src/components/icons/linkedin_icon.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use leptos::*;
33
#[component]
44
pub fn LinkedinIcon(
55
#[prop(default = 40)] size: u32,
6-
#[prop(default = "fill-black dark:fill-[#bf8821]")] class: &'static str,
6+
#[prop(default = "fill-current dark:fill-[#bf8821]")] class: &'static str,
77
) -> impl IntoView {
88
view! {
99
<svg
@@ -17,3 +17,4 @@ pub fn LinkedinIcon(
1717
</svg>
1818
}
1919
}
20+

src/components/icons/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
mod cloudflare;
2+
mod calendar_icon;
23
mod discord_icon;
34
mod github_icon;
45
mod linkedin_icon;
@@ -9,6 +10,7 @@ mod telegram_icon;
910
mod twitter_icon;
1011
mod web_icon;
1112

13+
pub use calendar_icon::*;
1214
pub use cloudflare::*;
1315
pub use discord_icon::*;
1416
pub use github_icon::*;

src/components/icons/telegram_icon.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use leptos::{component, view, IntoView};
33
#[component]
44
pub fn TelegramIcon(
55
#[prop(default = 40)] size: u32,
6-
#[prop(default = "fill-black dark:fill-[#bf8821]")] class: &'static str,
6+
#[prop(default = "fill-current dark:fill-[#bf8821]")] class: &'static str,
77
) -> impl IntoView {
88
view! {
99
<svg

src/components/mod.rs

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
mod aprende;
22
mod button_link;
3+
mod button_large_link;
34
mod cards;
45
mod community_projects;
56
mod footer;
@@ -8,13 +9,15 @@ mod header;
89
mod hero;
910
mod icons;
1011
mod other_communities;
12+
mod hacktoberfest;
1113
mod our_communities;
1214
pub mod separator;
1315
mod slogan_button;
1416
mod sponsors;
1517

1618
pub use aprende::{Books, HeaderAprende, Roadmap, Youtube};
1719
pub use button_link::ButtonLink;
20+
pub use button_large_link::ButtonLargeLink;
1821
pub use cards::{CardTitle, CommunityCard, ContributorCard, ProjectCard};
1922
pub use community_projects::CommunityProjects;
2023
pub use footer::Footer;
@@ -25,6 +28,8 @@ pub use icons::{
2528
CloudflareIcon, DiscordIcon, GithubIcon, LinkedinIcon, LocationIcon, NextIcon, TelegramIcon,
2629
TwitterIcon,
2730
};
31+
32+
pub use hacktoberfest::Hacktoberfest;
2833
pub use other_communities::OtherCommunities;
2934
pub use our_communities::OurCommunities;
3035
pub use separator::Separator;

src/pages/index.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
use leptos::{component, view, IntoView};
22

3-
use crate::components::{CommunityProjects, Hero, OtherCommunities, OurCommunities, Sponsors};
3+
use crate::components::{CommunityProjects, Hero, OtherCommunities, OurCommunities, Hacktoberfest, Sponsors};
44

55
#[component]
66
pub fn Index() -> impl IntoView {
77
view! {
88
<div>
99
<Hero/>
1010
<OurCommunities/>
11+
<Hacktoberfest/>
1112
<CommunityProjects show_more=true/>
1213
<OtherCommunities show_more=true/>
1314
<Sponsors/>

0 commit comments

Comments
 (0)