Run tests on PR #1
@@ -13,3 +13,6 @@ steps:
|
|||||||
when:
|
when:
|
||||||
- event: push
|
- event: push
|
||||||
branch: ${CI_REPO_DEFAULT_BRANCH}
|
branch: ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- validate
|
||||||
|
26
.woodpecker/.validate.yaml
Normal file
26
.woodpecker/.validate.yaml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
steps:
|
||||||
|
- name: format
|
||||||
|
image: rust:latest
|
||||||
|
commands:
|
||||||
|
- rustup component add rustfmt
|
||||||
|
- cargo fmt --all --check
|
||||||
|
|
||||||
|
- name: clippy
|
||||||
|
image: rust:latest
|
||||||
|
commands:
|
||||||
|
- apt update && apt install -y libgtk-3-dev libjavascriptcoregtk-4.1-dev libwebkit2gtk-4.1-dev
|
||||||
|
- rustup component add clippy
|
||||||
|
- cargo clippy --all --all-features -- -D warnings
|
||||||
|
# Not ready for clippy validation
|
||||||
|
failure: ignore
|
||||||
|
|
||||||
|
# - name: build
|
||||||
|
# image: rust:latest
|
||||||
|
# commands:
|
||||||
|
# - cargo install dioxus-cli --locked -j ${JOBS_NB:-default}
|
||||||
|
# - rustup target add wasm32-unknown-unknown
|
||||||
|
# - cargo install -f wasm-bindgen-cli --version 0.2.93
|
||||||
|
# - dx build -r --platform web -- -j ${JOBS_NB:-default}
|
||||||
|
|
||||||
|
when:
|
||||||
|
- event: pull_request
|
41
build.rs
41
build.rs
@@ -15,26 +15,27 @@ fn main() {
|
|||||||
|
|
||||||
let out_dir = env::var("OUT_DIR").unwrap();
|
let out_dir = env::var("OUT_DIR").unwrap();
|
||||||
|
|
||||||
let mut tasks = Vec::new();
|
// let mut tasks = Vec::new();
|
||||||
|
let tasks = vec![
|
||||||
// Global tokens
|
// Global tokens
|
||||||
tasks.push(Task::new(
|
Task::new(
|
||||||
PathBuf::from("src/ui/_base.scss"),
|
PathBuf::from("src/ui/_base.scss"),
|
||||||
Path::new(&out_dir).join("style_tokens.rs"),
|
Path::new(&out_dir).join("style_tokens.rs"),
|
||||||
"style".to_string(),
|
"style".to_string(),
|
||||||
));
|
),
|
||||||
// variables defined by the Panel component
|
// variables defined by the Panel component
|
||||||
tasks.push(Task::new(
|
Task::new(
|
||||||
PathBuf::from("src/ui/components/_panel.scss"),
|
PathBuf::from("src/ui/components/_panel.scss"),
|
||||||
Path::new(&out_dir).join("style_component_panel.rs"),
|
Path::new(&out_dir).join("style_component_panel.rs"),
|
||||||
"panel".to_string(),
|
"panel".to_string(),
|
||||||
));
|
),
|
||||||
// Variables set by the Conversations layout
|
// Variables set by the Conversations layout
|
||||||
tasks.push(Task::new(
|
Task::new(
|
||||||
PathBuf::from("src/ui/layouts/conversations.scss"),
|
PathBuf::from("src/ui/layouts/conversations.scss"),
|
||||||
Path::new(&out_dir).join("style_layout_conversations.rs"),
|
Path::new(&out_dir).join("style_layout_conversations.rs"),
|
||||||
"conversations".to_string(),
|
"conversations".to_string(),
|
||||||
));
|
),
|
||||||
|
];
|
||||||
|
|
||||||
export_variables(tasks)
|
export_variables(tasks)
|
||||||
}
|
}
|
||||||
|
@@ -39,6 +39,7 @@ pub trait RoomStoreConsumerInterface {
|
|||||||
pub trait RoomStoreProviderInterface {
|
pub trait RoomStoreProviderInterface {
|
||||||
fn on_new_name(&self, name: Option<String>);
|
fn on_new_name(&self, name: Option<String>);
|
||||||
fn on_new_avatar(&self, avatar: Option<Avatar>);
|
fn on_new_avatar(&self, avatar: Option<Avatar>);
|
||||||
|
#[allow(dead_code)]
|
||||||
fn on_new_topic(&self, topic: Option<String>);
|
fn on_new_topic(&self, topic: Option<String>);
|
||||||
fn on_new_member(&self, member: RoomMember);
|
fn on_new_member(&self, member: RoomMember);
|
||||||
fn on_invitation(&self, invitation: Invitation);
|
fn on_invitation(&self, invitation: Invitation);
|
||||||
|
@@ -5,7 +5,7 @@ turf::style_sheet!("src/ui/components/chat_panel.scss");
|
|||||||
#[component]
|
#[component]
|
||||||
pub fn ChatPanel(name: String) -> Element {
|
pub fn ChatPanel(name: String) -> Element {
|
||||||
rsx! {
|
rsx! {
|
||||||
style { {STYLE_SHEET} },
|
style { {STYLE_SHEET} }
|
||||||
|
|
||||||
div {
|
div {
|
||||||
class: ClassName::CHAT_PANEL,
|
class: ClassName::CHAT_PANEL,
|
||||||
|
@@ -237,12 +237,16 @@ pub fn ConversationAvatar(
|
|||||||
let on_press = {
|
let on_press = {
|
||||||
let room_id = room_id.clone();
|
let room_id = room_id.clone();
|
||||||
move || {
|
move || {
|
||||||
on_selected.map(|c| c.call(room_id.as_ref().clone()));
|
if let Some(c) = on_selected {
|
||||||
|
c.call(room_id.as_ref().clone())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let on_long_press = move || {
|
let on_long_press = move || {
|
||||||
on_pressed.map(|c| c.call(room_id.as_ref().clone()));
|
if let Some(c) = on_pressed {
|
||||||
|
c.call(room_id.as_ref().clone())
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let long_press_hook = use_long_press(long_press_duration, on_press, on_long_press);
|
let long_press_hook = use_long_press(long_press_duration, on_press, on_long_press);
|
||||||
|
Reference in New Issue
Block a user