Skip to content

Commit

Permalink
chore(Everywhere): Various UI Tweaks, adds secondary-darker var (#1480)
Browse files Browse the repository at this point in the history
Co-authored-by: Sara Tavares <29093946+stavares843@users.noreply.github.com>
Co-authored-by: sdwoodbury <stuartwoodbury@protonmail.ch>
  • Loading branch information
3 people authored Nov 9, 2023
1 parent a44720d commit e0e7eea
Show file tree
Hide file tree
Showing 12 changed files with 79 additions and 66 deletions.
3 changes: 2 additions & 1 deletion common/locales/en-US/main.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ friends = Friends
.copied-did = Copied ID to clipboard!
.unblock = Unblock
.request-exist = Friend request is already pending!
.add-name = ➕ Add { $name }
.add-name = Add { $name }
.already-friends = Already Friends
.nothing-to-see-here = Nothing to see here
.share = Share DID
.select-chat = Select Chat
Expand Down
2 changes: 1 addition & 1 deletion kit/src/components/context_menu/style.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.context-menu {
position: fixed;
border-radius: var(--border-radius-more);
background-color: var(--secondary-dark);
background-color: var(--secondary-darker);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
z-index: 1000;
Expand Down
7 changes: 6 additions & 1 deletion kit/src/components/embeds/file_embed/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@
max-width: 350px;
height: 100%;
max-height: 350px;
border-radius: var(--border-radius);
border-radius: var(--border-radius-inner);
transition: border-radius var(--animation-time);

&:hover {
border-radius: var(--border-radius);
}
&.big {
max-height: 700px;
max-width: 700px;
Expand Down
Empty file.
13 changes: 11 additions & 2 deletions kit/src/components/message/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ pub fn IdentityMessage(cx: Scope<IdentityMessageProps>) -> Element {
.friend_identities()
.iter()
.any(|req| req.did_key().eq(&identity.did_key()));
return cx.render(rsx!(div {
return cx.render(rsx!(div { // TODO: This needs to be moved to kit/src/components/embeds/identity_embed/mod.rs.
class: "embed-identity",
IdentityHeader {
sender_did: identity.did_key(),
Expand Down Expand Up @@ -702,7 +702,16 @@ pub fn IdentityMessage(cx: Scope<IdentityMessageProps>) -> Element {
onpress: move |_| {
ch.send(IdentityCmd::SentFriendRequest(identity.did_key().to_string(), state.read().outgoing_fr_identities()));
},
text: get_local_text_with_args("friends.add-name", vec![("name", identity.username())]),
icon: if disabled {
Icon::Check
} else {
Icon::Plus
},
text: if disabled {
get_local_text("friends.already-friends")
} else {
get_local_text_with_args("friends.add-name", vec![("name", identity.username())])
},
appearance: crate::elements::Appearance::Primary
}
}));
Expand Down
31 changes: 5 additions & 26 deletions kit/src/components/message/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
min-height: var(--height-input);
display: inline-flex;
align-items: center;
padding: var(--padding-less) var(--padding);
padding: var(--padding-less);
width: fit-content;
align-self: flex-end;
overflow: hidden;
Expand Down Expand Up @@ -57,7 +57,7 @@
.message.remote {
align-self: flex-start;
align-items: flex-start;
background: var(--secondary-dark);
background: var(--secondary-darker);
border-radius: var(--border-radius-more);
border-bottom-left-radius: var(--border-radius);
}
Expand Down Expand Up @@ -120,33 +120,12 @@
.embed-identity {
display: flex;
flex-direction: column;
.profile-container {
max-width: 300px;
}
.empty-profile {
margin-left: 0;
}
.unknown-user {
.text {
font-size: var(--text-size-more);
}
}
.unknown-user-did {
.text {
font-size: var(--text-size-less);
}
}

.btn-wrap {
padding-top: var(--padding-less);
padding-top: var(--gap);
width: 100%;
.btn {
max-width: calc(var(--height-input) * 2 + 300px);
width: 100%;
.btn-text {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
color: var(--text-color-dark);
}
}
}
}
3 changes: 2 additions & 1 deletion kit/src/components/message_reply/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
align-items: flex-end;
position: relative;
flex-direction: column;
opacity: var(--opacity-modifier);
.user-image {
transform: scale(0.75);
opacity: var(--opacity-modifier);
Expand All @@ -25,7 +26,7 @@
flex-direction: column;
color: var(--text-color);
background-color: var(--primary);
padding: var(--gap-less) var(--gap);
padding: var(--padding-less) var(--padding);
font-size: var(--text-size-less);
border-radius: var(--border-radius-more);
border-bottom-right-radius: var(--border-radius-less);
Expand Down
5 changes: 1 addition & 4 deletions kit/src/layout/chatbar/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.chatbar {
width: 100%;
border-top: 1px solid transparent;
padding: var(--padding);
padding: var(--padding) var(--gap);
position: relative;
.input-group {
flex: 1;
Expand Down Expand Up @@ -33,9 +33,6 @@
border: 1px solid var(--border-subtle-color);
background: var(--secondary-dark);

label {
color: var(--text-color-dark);
}
.content {
display: inline-flex;
padding: 0;
Expand Down
3 changes: 3 additions & 0 deletions kit/src/layout/sidebar/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
padding: var(--gap);
border-bottom: 1px solid transparent;
flex-direction: row;
.input {
padding: 0 var(--gap);
}
}
.children {
flex: 1;
Expand Down
1 change: 1 addition & 0 deletions kit/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ pre code {
--secondary: #343a40;
--secondary-light: #4c555d;
--secondary-dark: #212529;
--secondary-darker: #16191c;
--background: #000000;
--background-light: var(--secondary-light);
--background-dark: #161a21;
Expand Down
49 changes: 25 additions & 24 deletions ui/src/layouts/chats/presentation/quick_profile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use futures::{channel::oneshot, StreamExt};

use kit::{
components::context_menu::{ContextItem, ContextMenu, IdentityHeader},
elements::{input::Input, range::Range},
elements::{input::Input, label::Label, range::Range},
};

use common::{
Expand Down Expand Up @@ -368,6 +368,30 @@ pub fn QuickProfileContext<'a>(cx: Scope<'a, QuickProfileProps<'a>>) -> Element<
})
} else {
rsx!(
if state.read().configuration.developer.experimental_features && in_vc {
rsx!(
div {
class: "range-container",
Label {
text: get_local_text("quickprofile.volume")
},
Range {
aria_label: "range-quick-profile-speaker".into(),
initial_value: volume,
min: USER_VOL_MIN,
max: USER_VOL_MAX,
step: 0.1,
no_num: true,
icon_left: Icon::Speaker,
icon_right: Icon::SpeakerWave,
onchange: move |val| {
ch.send(QuickProfileCmd::AdjustVolume(did_cloned.clone(), val));
}
}
},
hr{}
)
}
/*ContextItem {
icon: Icon::UserCircle,
text: get_local_text("quickprofile.profile"),
Expand Down Expand Up @@ -407,29 +431,6 @@ pub fn QuickProfileContext<'a>(cx: Scope<'a, QuickProfileProps<'a>>) -> Element<
}
)
}
if state.read().configuration.developer.experimental_features && in_vc {
rsx!(
p {
class: "text",
aria_label: "user-volume-label",
get_local_text("quickprofile.volume")
},
Range {
aria_label: "range-quick-profile-speaker".into(),
initial_value: volume,
min: USER_VOL_MIN,
max: USER_VOL_MAX,
step: 0.1,
no_num: true,
icon_left: Icon::Speaker,
icon_right: Icon::SpeakerWave,
onchange: move |val| {
ch.send(QuickProfileCmd::AdjustVolume(did_cloned.clone(), val));
}
}
)
}
hr{},
if is_friend {
rsx!(ContextItem {
icon: Icon::UserMinus,
Expand Down
28 changes: 22 additions & 6 deletions ui/src/layouts/chats/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -626,11 +626,27 @@
}

.profile-context-items {
margin: var(--padding-less);
display: inline-flex;
gap: var(--gap);
flex-direction: column;

.input {
border-radius: var(--border-radius-more);
}

.range-container {
padding: var(--padding-less);

.range {
margin-top: var(--gap);
.range-value {
display: inline-flex;
background-color: var(--secondary-light);
}
}
}


.context-item {
width: 100%;
}
Expand Down Expand Up @@ -673,12 +689,12 @@
}

.scroll-bottom-btn {
color: var(--text-color);
background-color: var(--secondary);
border-radius: var(--border-radius);
color: var(--text-color-dark);
background-color: var(--primary);
border-radius: var(--border-radius-more);
width: calc(100% - (var(--gap) * 2));
padding: var(--gap-less);
height: fit-content;
height: var(--height-input);
position: absolute;
bottom: calc(100% + var(--gap-less));
left: 0;
Expand All @@ -690,7 +706,7 @@

&:hover {
cursor: pointer;
background-color: var(--secondary-light);
background-color: var(--primary-light);
}
}

Expand Down

0 comments on commit e0e7eea

Please sign in to comment.