|
| 1 | +use leptos::prelude::*; |
| 2 | +use rustlanges_components::{ |
| 3 | + avatar::Avatar, |
| 4 | + button::{Button, Variant as ButtonVariant}, |
| 5 | + card::Card, |
| 6 | + chip::{Chip, Variant as ChipVariant}, |
| 7 | + icons::{Github, Twitter}, |
| 8 | +}; |
| 9 | + |
| 10 | +struct Contributor { |
| 11 | + avatar: String, |
| 12 | + name: String, |
| 13 | + location: String, |
| 14 | +} |
| 15 | + |
| 16 | +#[allow(non_snake_case)] |
| 17 | +pub fn Contributors() -> impl IntoView { |
| 18 | + let sergio = Contributor { name: "Sergio Ribera".to_string(), avatar: "https://avatars.githubusercontent.com/u/56278796?u=9e3dac947b4fd3ca2f1a05024e083c64e4c69cfe&v=4".to_string(), location: "Ubicación".to_string() }; |
| 19 | + let juanperias = Contributor { name: "Juanperias".to_string(), avatar: "https://avatars.githubusercontent.com/u/136520331?u=7353ba372f09091049692d6e95f5a8cd8a42565f&v=4".to_string(), location: "Ubicación".to_string() }; |
| 20 | + let phosphorus = Contributor { |
| 21 | + name: "Phosphorus-M".to_string(), |
| 22 | + avatar: "https://avatars.githubusercontent.com/u/19656993?s=400&v=4".to_string(), |
| 23 | + location: "Ubicación".to_string(), |
| 24 | + }; |
| 25 | + |
| 26 | + let contributors = vec![sergio, juanperias, phosphorus]; |
| 27 | + |
| 28 | + let contributors_list = contributors |
| 29 | + .into_iter() |
| 30 | + .map(|c| { |
| 31 | + view! { |
| 32 | + <div class="min-w-87.5 max-w-md h-full mt-5"> |
| 33 | + <Card class="min-w-87.5 max-w-md h-full"> |
| 34 | + <div class="flex flex-col gap-4 justify-between h-full"> |
| 35 | + <div class="flex flex-row items-center gap-4 h-full justify-stretch"> |
| 36 | + <Avatar url=c.avatar.clone() size=52 class="min-w-13" /> |
| 37 | + <div class="w-full"> |
| 38 | + <h2 class="text-heading-3 mt-2 mb-2">{{ c.name.clone() }}</h2> |
| 39 | + <Chip label=c.location.clone() variant=ChipVariant::Location /> |
| 40 | + </div> |
| 41 | + <div class="flex gap-3 items-center justify-center"> |
| 42 | + <Button |
| 43 | + variant=ButtonVariant::Icon |
| 44 | + icon=view! { <Twitter /> }.into_any() |
| 45 | + on_click=move |_| {} |
| 46 | + /> |
| 47 | + <Button |
| 48 | + variant=ButtonVariant::Icon |
| 49 | + icon=view! { <Github /> }.into_any() |
| 50 | + on_click=move |_| {} |
| 51 | + /> |
| 52 | + </div> |
| 53 | + </div> |
| 54 | + </div> |
| 55 | + </Card> |
| 56 | + </div> |
| 57 | + } |
| 58 | + }) |
| 59 | + .collect_view(); |
| 60 | + |
| 61 | + view! { |
| 62 | + <section class="bg-light dark:bg-dark p-4 lg:p-20 w-full"> |
| 63 | + <div class="flex flex-col justify-center items-center w-full container xl:max-w-7xl lg:px-36 lg:pb-20 mx-auto"> |
| 64 | + <h2 class="text-h2 text-center mb-4">"Colaboradores"</h2> |
| 65 | + <div> |
| 66 | + <p class="text-center max-w-lg"> |
| 67 | + "Gracias a su esfuerzo, los servicios de nuestra comunidad" |
| 68 | + </p> |
| 69 | + <p class="text-center max-w-lg"> |
| 70 | + "se mantienen activos y en constante evolución." |
| 71 | + </p> |
| 72 | + </div> |
| 73 | + </div> |
| 74 | + |
| 75 | + <div class="flex flex-row justify-center items-center gap-4 max-w-full m-auto"> |
| 76 | + <div class="items-center gap-8 overflow-x-auto p-4 xl:grid xl:grid-cols-3"> |
| 77 | + {contributors_list} |
| 78 | + </div> |
| 79 | + </div> |
| 80 | + <div class="flex flex-row justify-center items-center m-auto w-full mt-10"> |
| 81 | + <Button |
| 82 | + variant=ButtonVariant::Secondary |
| 83 | + label="Conócelos a todos" |
| 84 | + on_click=move |_| {} |
| 85 | + /> |
| 86 | + </div> |
| 87 | + </section> |
| 88 | + } |
| 89 | +} |
0 commit comments