Skip to content

Commit c8a73b1

Browse files
committed
feat: add web icon and show just rust communties in the index
1 parent 961521c commit c8a73b1

File tree

5 files changed

+25
-8
lines changed

5 files changed

+25
-8
lines changed

src/components/cards/community_card.rs

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

33
use crate::components::{
44
cards::card_title::CardTitle,
5-
icons::{DiscordIcon, GithubIcon, TelegramIcon},
5+
icons::{DiscordIcon, GithubIcon, TelegramIcon, WebIcon},
66
};
77

88
#[component]
@@ -37,6 +37,7 @@ pub fn CommunityCard(
3737
"discord" => view! { <DiscordIcon size=30/> },
3838
"github" => view! { <GithubIcon size=30/> },
3939
"telegram" => view! { <TelegramIcon size=30/> },
40+
"web" => view! { <WebIcon size=30/> },
4041
_ => unreachable!(),
4142
}}
4243

src/components/icons/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ mod logo_rust_page;
66
mod next;
77
mod telegram_icon;
88
mod twitter_icon;
9+
mod web_icon;
910

1011
pub use discord_icon::*;
1112
pub use github_icon::*;
@@ -15,3 +16,4 @@ pub use logo_rust_page::*;
1516
pub use next::*;
1617
pub use telegram_icon::*;
1718
pub use twitter_icon::*;
19+
pub use web_icon::*;

src/components/icons/web_icon.rs

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
use leptos::{component, view, IntoView};
2+
3+
#[component]
4+
pub fn WebIcon(
5+
#[prop(default = 40)] size: u32,
6+
#[prop(default = "fill-black dark:fill-[#bf8821]")] class: &'static str,
7+
) -> impl IntoView {
8+
view! {
9+
<svg
10+
width=size
11+
height=size
12+
viewBox="0 0 640 512"
13+
class=class
14+
xmlns="http://www.w3.org/2000/svg"
15+
>
16+
<path d="M579.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L422.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C206.5 251.2 213 330 263 380c56.5 56.5 148 56.5 204.5 0L579.8 267.7zM60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5L217.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C433.5 260.8 427 182 377 132c-56.5-56.5-148-56.5-204.5 0L60.2 244.3z"></path>
17+
</svg>
18+
}
19+
}

src/components/other_communities.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,7 @@ pub fn OtherCommunities(
1313
let communities = match (other_communities, show_more) {
1414
(true, false) => OTHER_COMMUNITIES.to_vec(),
1515
(false, false) => RUST_COMMUNITIES.to_vec(),
16-
(_, true) => {
17-
let mut all_communities = vec![];
18-
all_communities.extend(OTHER_COMMUNITIES.to_vec());
19-
all_communities.extend(RUST_COMMUNITIES.to_vec());
20-
all_communities
21-
}
16+
(_, true) => RUST_COMMUNITIES.to_vec(),
2217
};
2318

2419
view! {

0 commit comments

Comments
 (0)