36 lines
870 B
Rust
36 lines
870 B
Rust
use yew::prelude::*;
|
|
|
|
// use crate::components;
|
|
use crate::layouts;
|
|
|
|
#[derive(Properties, PartialEq)]
|
|
pub struct MainProps {
|
|
pub token: Option<String>,
|
|
pub logged_in: bool,
|
|
#[prop_or_default]
|
|
pub children: Children,
|
|
}
|
|
|
|
pub struct Main;
|
|
|
|
impl Component for Main {
|
|
type Message = ();
|
|
type Properties = MainProps;
|
|
|
|
fn create(_ctx: &Context<Self>) -> Self {
|
|
Self
|
|
}
|
|
|
|
fn view(&self, ctx: &Context<Self>) -> Html {
|
|
html! {
|
|
<layouts::base::Base token={ctx.props().token.to_owned()} logged_in={ctx.props().logged_in}>
|
|
<div class={classes!("columns")}>
|
|
<main class={classes!("column", "is-four-fifths", "mx-auto")}>
|
|
{ for ctx.props().children.iter() }
|
|
</main>
|
|
</div>
|
|
</layouts::base::Base>
|
|
}
|
|
}
|
|
}
|