summary refs log tree commit diff stats
path: root/src/components/side_header.rs
blob: 9cd67779fd3239b17bcee4172f7085d9df01ac0c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use leptos::prelude::{AddAnyAttr, ElementChild, IntoView, StyleAttribute, component, view};
use leptos_router::{NavigateOptions, hooks::use_navigate};
use thaw::{Flex, FlexJustify, LayoutHeader};

#[component]
pub fn SiteHeader() -> impl IntoView {
    let navigate = use_navigate();

    view! {
        <LayoutHeader
            attr:style="padding: 20px;"
            on:click=move |_| {
                navigate("/", NavigateOptions::default());
            }
        >
            <Flex justify=FlexJustify::SpaceAround>
                <img src="/logo.svg" style="width: 36px" />
                <h3>"Rocie"</h3>
            </Flex>
        </LayoutHeader>
    }
}