Merge branch 'clean-redesign' into develop
This commit is contained in:
2
build.rs
2
build.rs
@@ -14,7 +14,7 @@ fn main() {
|
|||||||
|
|
||||||
let out_dir = env::var("OUT_DIR").unwrap();
|
let out_dir = env::var("OUT_DIR").unwrap();
|
||||||
|
|
||||||
let style_src_path = PathBuf::from("src/_base.scss");
|
let style_src_path = PathBuf::from("src/ui/_base.scss");
|
||||||
let style_dst_path = Path::new(&out_dir).join("style_vars.rs");
|
let style_dst_path = Path::new(&out_dir).join("style_vars.rs");
|
||||||
|
|
||||||
export_color_variables(&style_src_path, &style_dst_path)
|
export_color_variables(&style_src_path, &style_dst_path)
|
||||||
|
@@ -6,9 +6,9 @@ use futures_util::stream::StreamExt;
|
|||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::{collections::HashMap, sync::Arc};
|
use std::{collections::HashMap, sync::Arc};
|
||||||
|
|
||||||
use crate::matrix_interface::client::{Client, RoomEvent};
|
use crate::infrastructure::messaging::matrix::client::{Client, RoomEvent};
|
||||||
use crate::matrix_interface::requester::{Receivers, Requester};
|
use crate::infrastructure::messaging::matrix::requester::{Receivers, Requester};
|
||||||
use crate::matrix_interface::worker_tasks::LoginStyle;
|
use crate::infrastructure::messaging::matrix::worker_tasks::LoginStyle;
|
||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
use matrix_sdk::{
|
use matrix_sdk::{
|
||||||
room::{Room as MatrixRoom, RoomMember},
|
room::{Room as MatrixRoom, RoomMember},
|
||||||
@@ -17,7 +17,7 @@ use matrix_sdk::{
|
|||||||
use tokio::select;
|
use tokio::select;
|
||||||
use tracing::{debug, error, warn};
|
use tracing::{debug, error, warn};
|
||||||
|
|
||||||
use crate::components::chats_window::interface::Interface as ChatsWinInterface;
|
use crate::ui::components::chats_window::interface::Interface as ChatsWinInterface;
|
||||||
|
|
||||||
// #[derive(Clone, Debug)]
|
// #[derive(Clone, Debug)]
|
||||||
// pub struct UserInfo {
|
// pub struct UserInfo {
|
||||||
|
@@ -1,13 +0,0 @@
|
|||||||
pub mod avatar_selector;
|
|
||||||
pub mod button;
|
|
||||||
pub mod chats_window;
|
|
||||||
pub mod contacts_window;
|
|
||||||
pub mod header;
|
|
||||||
pub mod icons;
|
|
||||||
pub mod loading;
|
|
||||||
pub mod login;
|
|
||||||
pub mod main_window;
|
|
||||||
pub mod modal;
|
|
||||||
pub mod spinner;
|
|
||||||
pub mod text_input;
|
|
||||||
pub mod wallpaper;
|
|
@@ -1 +0,0 @@
|
|||||||
pub(crate) mod datasources;
|
|
3
src/infrastructure/messaging/matrix/mod.rs
Normal file
3
src/infrastructure/messaging/matrix/mod.rs
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
pub(crate) mod client;
|
||||||
|
pub(crate) mod requester;
|
||||||
|
pub(crate) mod worker_tasks;
|
1
src/infrastructure/messaging/mod.rs
Normal file
1
src/infrastructure/messaging/mod.rs
Normal file
@@ -0,0 +1 @@
|
|||||||
|
pub(crate) mod matrix;
|
2
src/infrastructure/mod.rs
Normal file
2
src/infrastructure/mod.rs
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
pub(crate) mod messaging;
|
||||||
|
pub(crate) mod services;
|
11
src/main.rs
11
src/main.rs
@@ -1,8 +1,7 @@
|
|||||||
#![allow(non_snake_case)]
|
#![allow(non_snake_case)]
|
||||||
|
|
||||||
mod components;
|
mod infrastructure;
|
||||||
mod data;
|
mod ui;
|
||||||
mod matrix_interface;
|
|
||||||
mod utils;
|
mod utils;
|
||||||
|
|
||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
@@ -11,9 +10,9 @@ use tracing::{debug, Level};
|
|||||||
|
|
||||||
use crate::base::{login, sync_rooms};
|
use crate::base::{login, sync_rooms};
|
||||||
use crate::base::{APP_SETTINGS, ROOMS, SESSION};
|
use crate::base::{APP_SETTINGS, ROOMS, SESSION};
|
||||||
use crate::components::loading::LoadingPage;
|
use crate::ui::components::loading::LoadingPage;
|
||||||
use crate::components::login::Login;
|
use crate::ui::components::login::Login;
|
||||||
use crate::components::main_window::MainWindow;
|
use crate::ui::components::main_window::MainWindow;
|
||||||
|
|
||||||
mod base;
|
mod base;
|
||||||
|
|
||||||
|
@@ -1,3 +0,0 @@
|
|||||||
pub mod client;
|
|
||||||
pub mod requester;
|
|
||||||
pub mod worker_tasks;
|
|
@@ -1,6 +1,6 @@
|
|||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
|
|
||||||
turf::style_sheet!("src/components/avatar_selector.scss");
|
turf::style_sheet!("src/ui/components/avatar_selector.scss");
|
||||||
|
|
||||||
pub fn AvatarSelector() -> Element {
|
pub fn AvatarSelector() -> Element {
|
||||||
rsx! {
|
rsx! {
|
@@ -1,7 +1,7 @@
|
|||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
use dioxus_free_icons::{Icon, IconShape};
|
use dioxus_free_icons::{Icon, IconShape};
|
||||||
|
|
||||||
turf::style_sheet!("src/components/button.scss");
|
turf::style_sheet!("src/ui/components/button.scss");
|
||||||
|
|
||||||
#[derive(PartialEq, Clone, Props)]
|
#[derive(PartialEq, Clone, Props)]
|
||||||
struct _ButtonProps {
|
struct _ButtonProps {
|
@@ -4,10 +4,10 @@ use tracing::error;
|
|||||||
|
|
||||||
use super::edit_section::EditSection;
|
use super::edit_section::EditSection;
|
||||||
use crate::base::{sync_messages, ROOMS};
|
use crate::base::{sync_messages, ROOMS};
|
||||||
use crate::components::avatar_selector::AvatarSelector;
|
use crate::ui::components::avatar_selector::AvatarSelector;
|
||||||
use crate::components::icons::DownArrowIcon;
|
use crate::ui::components::icons::DownArrowIcon;
|
||||||
|
|
||||||
turf::style_sheet!("src/components/chats_window/conversation.scss");
|
turf::style_sheet!("src/ui/components/chats_window/conversation.scss");
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
pub(super) fn Conversation(room_id: OwnedRoomId) -> Element {
|
pub(super) fn Conversation(room_id: OwnedRoomId) -> Element {
|
@@ -1,6 +1,6 @@
|
|||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
|
|
||||||
turf::style_sheet!("src/components/chats_window/edit_section.scss");
|
turf::style_sheet!("src/ui/components/chats_window/edit_section.scss");
|
||||||
|
|
||||||
pub fn EditSection() -> Element {
|
pub fn EditSection() -> Element {
|
||||||
rsx! {
|
rsx! {
|
@@ -1,8 +1,9 @@
|
|||||||
mod conversation;
|
mod conversation;
|
||||||
mod edit_section;
|
mod edit_section;
|
||||||
pub mod interface;
|
|
||||||
mod navbar;
|
mod navbar;
|
||||||
|
|
||||||
|
pub(crate) mod interface;
|
||||||
|
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::collections::{HashMap, HashSet};
|
use std::collections::{HashMap, HashSet};
|
||||||
|
|
||||||
@@ -12,13 +13,13 @@ use tokio::sync::broadcast::Receiver;
|
|||||||
use tracing::{debug, error};
|
use tracing::{debug, error};
|
||||||
|
|
||||||
use crate::base::{sync_rooms, Room, ROOMS};
|
use crate::base::{sync_rooms, Room, ROOMS};
|
||||||
use crate::matrix_interface::requester::Receivers;
|
use crate::infrastructure::messaging::matrix::requester::Receivers;
|
||||||
use conversation::Conversation;
|
use conversation::Conversation;
|
||||||
use navbar::Navbar;
|
use navbar::Navbar;
|
||||||
|
|
||||||
use interface::{Interface, Tasks};
|
use interface::{Interface, Tasks};
|
||||||
|
|
||||||
turf::style_sheet!("src/components/chats_window/chats_window.scss");
|
turf::style_sheet!("src/ui/components/chats_window/chats_window.scss");
|
||||||
|
|
||||||
#[derive(Props, Clone, PartialEq)]
|
#[derive(Props, Clone, PartialEq)]
|
||||||
pub struct ChatsWindowProps {
|
pub struct ChatsWindowProps {
|
@@ -1,7 +1,7 @@
|
|||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
use tracing::debug;
|
use tracing::debug;
|
||||||
|
|
||||||
turf::style_sheet!("src/components/chats_window/navbar.scss");
|
turf::style_sheet!("src/ui/components/chats_window/navbar.scss");
|
||||||
|
|
||||||
pub fn Navbar() -> Element {
|
pub fn Navbar() -> Element {
|
||||||
debug!("Navbar rendering");
|
debug!("Navbar rendering");
|
@@ -3,11 +3,11 @@ use std::rc::Rc;
|
|||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
use tracing::debug;
|
use tracing::debug;
|
||||||
|
|
||||||
use crate::components::contacts_window::contacts_section::{
|
use crate::ui::components::contacts_window::contacts_section::{
|
||||||
filter_people_conversations, filter_room_conversations, ContactsSection,
|
filter_people_conversations, filter_room_conversations, ContactsSection,
|
||||||
};
|
};
|
||||||
|
|
||||||
turf::style_sheet!("src/components/contacts_window/contacts.scss");
|
turf::style_sheet!("src/ui/components/contacts_window/contacts.scss");
|
||||||
|
|
||||||
pub fn Contacts() -> Element {
|
pub fn Contacts() -> Element {
|
||||||
debug!("Contacts rendering");
|
debug!("Contacts rendering");
|
@@ -8,9 +8,9 @@ use matrix_sdk::{ruma::OwnedRoomId, RoomState};
|
|||||||
use tracing::debug;
|
use tracing::debug;
|
||||||
|
|
||||||
use crate::base::{ByIdRooms, Room, CHATS_WIN_INTERFACE, ROOMS};
|
use crate::base::{ByIdRooms, Room, CHATS_WIN_INTERFACE, ROOMS};
|
||||||
use crate::components::chats_window::interface::Interface as ChatsWindowInterface;
|
use crate::ui::components::chats_window::interface::Interface as ChatsWindowInterface;
|
||||||
|
|
||||||
turf::style_sheet!("src/components/contacts_window/contacts_section.scss");
|
turf::style_sheet!("src/ui/components/contacts_window/contacts_section.scss");
|
||||||
|
|
||||||
fn ContactsArrow() -> Element {
|
fn ContactsArrow() -> Element {
|
||||||
rsx! {
|
rsx! {
|
@@ -5,10 +5,10 @@ mod user_infos;
|
|||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
use tracing::debug;
|
use tracing::debug;
|
||||||
|
|
||||||
use crate::components::contacts_window::contacts::Contacts;
|
use crate::ui::components::contacts_window::contacts::Contacts;
|
||||||
use crate::components::contacts_window::user_infos::UserInfos;
|
use crate::ui::components::contacts_window::user_infos::UserInfos;
|
||||||
|
|
||||||
turf::style_sheet!("src/components/contacts_window/contacts_window.scss");
|
turf::style_sheet!("src/ui/components/contacts_window/contacts_window.scss");
|
||||||
|
|
||||||
pub fn ContactsWindow() -> Element {
|
pub fn ContactsWindow() -> Element {
|
||||||
debug!("ContactsWindow rendering");
|
debug!("ContactsWindow rendering");
|
@@ -1,10 +1,10 @@
|
|||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
use tracing::debug;
|
use tracing::debug;
|
||||||
|
|
||||||
use crate::components::avatar_selector::AvatarSelector;
|
use crate::ui::components::avatar_selector::AvatarSelector;
|
||||||
use crate::components::icons::DownArrowIcon;
|
use crate::ui::components::icons::DownArrowIcon;
|
||||||
|
|
||||||
turf::style_sheet!("src/components/contacts_window/user_infos.scss");
|
turf::style_sheet!("src/ui/components/contacts_window/user_infos.scss");
|
||||||
|
|
||||||
static MESSAGE_PLACEHOLDER: &str = "<Enter a personal message>";
|
static MESSAGE_PLACEHOLDER: &str = "<Enter a personal message>";
|
||||||
|
|
@@ -1,6 +1,6 @@
|
|||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
|
|
||||||
turf::style_sheet!("src/components/header.scss");
|
turf::style_sheet!("src/ui/components/header.scss");
|
||||||
|
|
||||||
pub fn Header() -> Element {
|
pub fn Header() -> Element {
|
||||||
rsx! {
|
rsx! {
|
@@ -2,7 +2,7 @@ use dioxus::prelude::*;
|
|||||||
use dioxus_free_icons::icons::md_navigation_icons::MdArrowDropDown;
|
use dioxus_free_icons::icons::md_navigation_icons::MdArrowDropDown;
|
||||||
use dioxus_free_icons::{Icon, IconShape};
|
use dioxus_free_icons::{Icon, IconShape};
|
||||||
|
|
||||||
turf::style_sheet!("src/components/icons.scss");
|
turf::style_sheet!("src/ui/components/icons.scss");
|
||||||
|
|
||||||
include!(concat!(env!("OUT_DIR"), "/style_vars.rs"));
|
include!(concat!(env!("OUT_DIR"), "/style_vars.rs"));
|
||||||
|
|
@@ -4,7 +4,7 @@ use tracing::debug;
|
|||||||
use super::spinner::Spinner;
|
use super::spinner::Spinner;
|
||||||
use super::wallpaper::Wallpaper;
|
use super::wallpaper::Wallpaper;
|
||||||
|
|
||||||
turf::style_sheet!("src/components/loading.scss");
|
turf::style_sheet!("src/ui/components/loading.scss");
|
||||||
|
|
||||||
pub fn LoadingPage() -> Element {
|
pub fn LoadingPage() -> Element {
|
||||||
debug!("LoadingPage rendering");
|
debug!("LoadingPage rendering");
|
@@ -10,7 +10,9 @@ use validator::{Validate, ValidateArgs, ValidateEmail, ValidationError, Validati
|
|||||||
use zxcvbn::zxcvbn;
|
use zxcvbn::zxcvbn;
|
||||||
|
|
||||||
use crate::base::{Session, SESSION};
|
use crate::base::{Session, SESSION};
|
||||||
use crate::data::datasources::random_svg_generators::{generate_random_svg_shape, ShapeConfig};
|
use crate::infrastructure::services::random_svg_generators::{
|
||||||
|
generate_random_svg_shape, ShapeConfig,
|
||||||
|
};
|
||||||
|
|
||||||
use super::button::{LoginButton, RegisterButton};
|
use super::button::{LoginButton, RegisterButton};
|
||||||
use super::modal::{Modal, Severity};
|
use super::modal::{Modal, Severity};
|
||||||
@@ -29,7 +31,7 @@ use style::{
|
|||||||
COLOR_TERNARY_150, COLOR_TERNARY_80, COLOR_TERNARY_90,
|
COLOR_TERNARY_150, COLOR_TERNARY_80, COLOR_TERNARY_90,
|
||||||
};
|
};
|
||||||
|
|
||||||
turf::style_sheet!("src/components/login.scss");
|
turf::style_sheet!("src/ui/components/login.scss");
|
||||||
|
|
||||||
const BACKGROUND_COLORS_STR: &str = formatcp!(
|
const BACKGROUND_COLORS_STR: &str = formatcp!(
|
||||||
"{COLOR_PRIMARY_150},{COLOR_PRIMARY_140},\
|
"{COLOR_PRIMARY_150},{COLOR_PRIMARY_140},\
|
@@ -2,7 +2,7 @@ use dioxus::prelude::*;
|
|||||||
use tracing::debug;
|
use tracing::debug;
|
||||||
|
|
||||||
use crate::base::SESSION;
|
use crate::base::SESSION;
|
||||||
use crate::components::contacts_window::ContactsWindow;
|
use crate::ui::components::contacts_window::ContactsWindow;
|
||||||
|
|
||||||
pub fn MainWindow() -> Element {
|
pub fn MainWindow() -> Element {
|
||||||
debug!("MainWindow rendering");
|
debug!("MainWindow rendering");
|
13
src/ui/components/mod.rs
Normal file
13
src/ui/components/mod.rs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
pub(crate) mod avatar_selector;
|
||||||
|
pub(crate) mod button;
|
||||||
|
pub(crate) mod chats_window;
|
||||||
|
pub(crate) mod contacts_window;
|
||||||
|
pub(crate) mod header;
|
||||||
|
pub(crate) mod icons;
|
||||||
|
pub(crate) mod loading;
|
||||||
|
pub(crate) mod login;
|
||||||
|
pub(crate) mod main_window;
|
||||||
|
pub(crate) mod modal;
|
||||||
|
pub(crate) mod spinner;
|
||||||
|
pub(crate) mod text_input;
|
||||||
|
pub(crate) mod wallpaper;
|
@@ -5,7 +5,7 @@ use dioxus::prelude::*;
|
|||||||
|
|
||||||
use super::button::{ErrorButton, SuccessButton, WarningButton};
|
use super::button::{ErrorButton, SuccessButton, WarningButton};
|
||||||
|
|
||||||
use crate::data::datasources::random_svg_generators::{
|
use crate::infrastructure::services::random_svg_generators::{
|
||||||
generate_random_svg_avatar, AvatarConfig, AvatarFeeling,
|
generate_random_svg_avatar, AvatarConfig, AvatarFeeling,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ include!(concat!(env!("OUT_DIR"), "/style_vars.rs"));
|
|||||||
|
|
||||||
use style::{COLOR_CRITICAL_100, COLOR_SUCCESS_100, COLOR_WARNING_100};
|
use style::{COLOR_CRITICAL_100, COLOR_SUCCESS_100, COLOR_WARNING_100};
|
||||||
|
|
||||||
turf::style_sheet!("src/components/modal.scss");
|
turf::style_sheet!("src/ui/components/modal.scss");
|
||||||
|
|
||||||
#[derive(Clone, Copy, Eq, PartialEq, Hash)]
|
#[derive(Clone, Copy, Eq, PartialEq, Hash)]
|
||||||
pub enum Severity {
|
pub enum Severity {
|
@@ -1,7 +1,7 @@
|
|||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
use dioxus_free_icons::{Icon, IconShape};
|
use dioxus_free_icons::{Icon, IconShape};
|
||||||
|
|
||||||
turf::style_sheet!("src/components/spinner.scss");
|
turf::style_sheet!("src/ui/components/spinner.scss");
|
||||||
|
|
||||||
#[derive(Clone, PartialEq)]
|
#[derive(Clone, PartialEq)]
|
||||||
struct _Spinner;
|
struct _Spinner;
|
@@ -5,7 +5,7 @@ use dioxus_free_icons::Icon;
|
|||||||
|
|
||||||
use super::icons::Pyramid;
|
use super::icons::Pyramid;
|
||||||
|
|
||||||
turf::style_sheet!("src/components/text_input.scss");
|
turf::style_sheet!("src/ui/components/text_input.scss");
|
||||||
|
|
||||||
pub trait InputPropsData {}
|
pub trait InputPropsData {}
|
||||||
|
|
@@ -1,6 +1,6 @@
|
|||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
|
|
||||||
turf::style_sheet!("src/components/wallpaper.scss");
|
turf::style_sheet!("src/ui/components/wallpaper.scss");
|
||||||
|
|
||||||
pub fn Wallpaper() -> Element {
|
pub fn Wallpaper() -> Element {
|
||||||
rsx! {
|
rsx! {
|
1
src/ui/mod.rs
Normal file
1
src/ui/mod.rs
Normal file
@@ -0,0 +1 @@
|
|||||||
|
pub(crate) mod components;
|
Reference in New Issue
Block a user