Skip to content

Commit

Permalink
task(improvements): Improve chat modal styles (#1903)
Browse files Browse the repository at this point in the history
  • Loading branch information
Flemmli97 authored Mar 6, 2024
1 parent 2e23bfa commit 4c69090
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 54 deletions.
4 changes: 2 additions & 2 deletions kit/src/layout/modal/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

.close-btn {
position: absolute;
top: var(--gap-less);
left: var(--gap-less);
top: var(--gap);
left: var(--gap);
visibility: hidden;
display: inline-block;
}
Expand Down
55 changes: 29 additions & 26 deletions ui/src/components/friends/friends_list/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,38 +509,41 @@ pub fn ShareFriendsModal(cx: Scope<FriendProps>) -> Element {
let selected = chats_selected.read().contains(&id);
rsx!(div {
class: format_args!("modal-share-friend {}", if selected {"share-friend-selected"} else {""}),
Checkbox {
disabled: false,
width: "1em".into(),
height: "1em".into(),
is_checked: selected,
on_click: move |_| {
chats_selected.with_mut(|v|{
if !selected {
v.push(id);
} else {
v.retain(|c|!c.eq(&id));
}
});
}
}
User {
username: participants_name,
subtext: subtext_val,
timestamp: raygun::Message::default().date(),
active: false,
user_image: cx.render(rsx!(
match chat.conversation_type {
ConversationType::Direct => rsx!(UserImage {
platform: platform,
status: user.identity_status().into(),
image: user.profile_picture(),
typing: false,
}),
_ => rsx!(UserImageGroup {
participants: build_participants(&participants),
typing: false,
})
div {
class: "modal-share-friend-image-group",
Checkbox {
disabled: false,
width: "1em".into(),
height: "1em".into(),
is_checked: selected,
on_click: move |_| {
chats_selected.with_mut(|v|{
if !selected {
v.push(id);
} else {
v.retain(|c|!c.eq(&id));
}
});
}
},
match chat.conversation_type {
ConversationType::Direct => rsx!(UserImage {
platform: platform,
status: user.identity_status().into(),
image: user.profile_picture(),
typing: false,
}),
_ => rsx!(UserImageGroup {
participants: build_participants(&participants),
typing: false,
})
}
}
)),
onpress: move |_| {
Expand Down
7 changes: 7 additions & 0 deletions ui/src/components/friends/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@
.user {
height: calc(3.5 * var(--text-size));
}
.modal-share-friend-image-group {
display: flex;
flex-direction: row;
gap: var(--gap);
height: fit-content;
align-items: center;
}
}
}

Expand Down
53 changes: 28 additions & 25 deletions ui/src/layouts/storage/send_files_layout/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,38 +162,41 @@ fn ChatsToSelect<'a>(cx: Scope<'a, ChatsToSelectProps<'a>>) -> Element<'a> {

rsx!(div {
id: "chat-selector-to-send-files",
Checkbox {
disabled: false,
width: "1em".into(),
height: "1em".into(),
is_checked: is_checked,
on_click: move |_| {
if is_checked {
cx.props.storage_controller.with_mut(|f| f.chats_selected_to_send.retain(|uuid| chat.id != *uuid));
} else {
cx.props.storage_controller.with_mut(|f| f.chats_selected_to_send.push(chat.id));
}
}
}
User {
username: participants_name,
subtext: subtext_val,
timestamp: raygun::Message::default().date(),
active: false,
user_image: cx.render(rsx!(
if chat.conversation_type == ConversationType::Direct {rsx! (
UserImage {
platform: platform,
status: user.identity_status().into(),
image: user.profile_picture(),
typing: false,
div {
class: "chat-selector-to-send-image-group",
Checkbox {
disabled: false,
width: "1em".into(),
height: "1em".into(),
is_checked: is_checked,
on_click: move |_| {
if is_checked {
cx.props.storage_controller.with_mut(|f| f.chats_selected_to_send.retain(|uuid| chat.id != *uuid));
} else {
cx.props.storage_controller.with_mut(|f| f.chats_selected_to_send.push(chat.id));
}
}
}
)} else {rsx! (
UserImageGroup {
participants: build_participants(&participants),
typing: false,
}
)}
if chat.conversation_type == ConversationType::Direct {rsx! (
UserImage {
platform: platform,
status: user.identity_status().into(),
image: user.profile_picture(),
typing: false,
}
)} else {rsx! (
UserImageGroup {
participants: build_participants(&participants),
typing: false,
}
)}
}
)),
with_badge: "".into(),
onpress: move |_| {
Expand Down
9 changes: 8 additions & 1 deletion ui/src/layouts/storage/send_files_layout/style.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
#chat-selector-to-send-files {
padding: 16px;
padding: var(--padding-less) 16px;
display: inline-flex;
gap: var(--gap-less);
.user {
height: calc(3.5 * var(--text-size));
}
.chat-selector-to-send-image-group {
display: flex;
flex-direction: row;
gap: var(--gap);
height: fit-content;
align-items: center;
}
}

0 comments on commit 4c69090

Please sign in to comment.