summaryrefslogtreecommitdiffstats
path: root/gui/src/timeline_post.rs
blob: 8b53898a0f5130a10abc58563d9ab26142b1d8b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#[derive(Debug)]
pub struct TimelinePost {
    mime: mime::Mime,
    content: PostContent,
}

#[derive(Debug)]
pub enum PostContent {
    Text(String)
}

impl TimelinePost {
    pub fn update(&mut self) {
        ()
    }

    pub fn view(&self) -> iced::Row<crate::app::Message> {
        iced::Row::new()
            .push({
                iced::Text::new(self.mime.as_ref().to_string())
            })
            .push({
                match self.content {
                    PostContent::Text(ref txt) => iced::Text::new(txt.clone()),
                }
            })
            .into()
    }
}