This repository has been archived by the owner on Aug 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
570 additions
and
284 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
use dioxus::prelude::*; | ||
|
||
use crate::services::matrix::matrix::EventOrigin; | ||
|
||
#[derive(PartialEq, Props)] | ||
pub struct MessageSkeletonProps { | ||
pub origin: EventOrigin, | ||
} | ||
|
||
pub fn MessageSkeleton(cx: Scope<MessageSkeletonProps>) -> Element { | ||
let dropdown_left = match cx.props.origin { | ||
EventOrigin::ME => "", | ||
EventOrigin::OTHER => "dropdown--left", | ||
}; | ||
|
||
render!(rsx! { | ||
div { | ||
class: "dropdown {dropdown_left} dropdown--skeleton", | ||
div { | ||
class: "message-view", | ||
// Header content (Avatar) | ||
match &cx.props.origin { | ||
EventOrigin::ME => None, | ||
EventOrigin::OTHER => render!( | ||
rsx!( | ||
div{ | ||
class: "avatar avatar--round avatar--skeleton skeleton", | ||
style: "--avatar-size: 36px", | ||
} | ||
) | ||
) | ||
} | ||
article { | ||
class: "message-wrapper message-wrapper--skeleton", | ||
// Name sender content | ||
match cx.props.origin { | ||
EventOrigin::OTHER => | ||
render!( | ||
rsx!( | ||
p { | ||
class: "message__sender message__sender--skeleton skeleton" | ||
} | ||
) | ||
), | ||
_ => None | ||
} | ||
|
||
div { | ||
class: "message__container__content", | ||
div{ | ||
class: "message__content message__content--skeleton", | ||
p { | ||
class: "message__content message__content--skeleton skeleton-text skeleton", | ||
} | ||
} | ||
span { | ||
class: "message__time message__time--skeleton skeleton-text skeleton", | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use dioxus::prelude::*; | ||
|
||
pub fn RoomViewSkeleton(cx: Scope) -> Element { | ||
cx.render(rsx! { | ||
div { | ||
class: "room-view room-view__skeleton", | ||
div{ | ||
class: "avatar avatar--round avatar--skeleton skeleton", | ||
style: "--avatar-size: 50px", | ||
} | ||
article { | ||
class: "room-view-wrapper room-view-wrapper--skeleton", | ||
p { | ||
class: "room-view__title room-view__title--skeleton skeleton", | ||
} | ||
p { | ||
class: "room-view__message room-view__message--skeleton skeleton", | ||
} | ||
} | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use dioxus::prelude::*; | ||
|
||
use crate::components::atoms::{avatar::Variant, Avatar}; | ||
|
||
#[derive(Props)] | ||
pub struct SpaceProps<'a> { | ||
text: &'a str, | ||
#[props(!optional)] | ||
uri: Option<String>, | ||
on_click: EventHandler<'a, MouseEvent>, | ||
} | ||
|
||
pub fn Space<'a>(cx: Scope<'a, SpaceProps<'a>>) -> Element<'a> { | ||
render!(rsx!( | ||
button { | ||
class: "button button--tertiary padding-reset", | ||
onclick: move |event| cx.props.on_click.call(event), | ||
Avatar { | ||
name: cx.props.text.to_string(), | ||
size: 50, | ||
uri: cx.props.uri.clone(), | ||
variant: Variant::SemiRound | ||
} | ||
} | ||
)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use dioxus::prelude::*; | ||
|
||
#[inline_props] | ||
pub fn SpaceSkeleton(cx: Scope, size: u8) -> Element { | ||
let size = format!("height: {}px; width: {}px;", size, size); | ||
|
||
render!(rsx!( | ||
button { | ||
class: "button button--tertiary padding-reset skeleton", | ||
div{ | ||
class: "avatar avatar--round avatar--skeleton skeleton", | ||
style: "{size}", | ||
} | ||
} | ||
)) | ||
} |
Oops, something went wrong.