Initial commit

This commit is contained in:
2022-03-21 15:24:12 +00:00
commit d2694bd94c
22 changed files with 968 additions and 0 deletions

26
src/link.rs Normal file
View File

@@ -0,0 +1,26 @@
use yew::{function_component, html, Callback, Children, MouseEvent, Properties};
#[derive(Properties, PartialEq)]
pub struct LinkProps {
#[prop_or_default]
pub children: Children,
#[prop_or_default]
pub href: String,
#[prop_or_default]
pub onclick: Callback<MouseEvent>,
}
#[function_component(Link)]
pub fn link(
LinkProps {
children,
href,
onclick,
}: &LinkProps,
) -> Html {
html! {
<a href={href.clone()} onclick={onclick}>
{ for children.iter() }
</a>
}
}