Skip to content

Commit

Permalink
refactor(sidebar): refactor styles and improve visibility of quickcha…
Browse files Browse the repository at this point in the history
…t button (#4096)

* refactor(sidebar): refactor styles and move component to better spot

* fix: use rem instead of pixels

* fix: remove bad index as key
  • Loading branch information
josephmcg authored and JustZacca committed Aug 2, 2022
1 parent e8e7eaf commit d5d3a75
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 115 deletions.
1 change: 1 addition & 0 deletions assets/styles/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ button {
border: none;
cursor: pointer;
background: transparent;
display: flex;
&:extend(.font-primary);
}
.button {
Expand Down
5 changes: 3 additions & 2 deletions assets/styles/framework/ui.less
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Navigation
@slimbar-width: 72px;
@sidebar-width: 312px;
@slimbar-width: 4.5rem;
@sidebar-width: 19.5rem;
@sidebar-controls-height: 7.5rem;
@sidebar-size-mobile: 100vw;
@servers-size: 60px;
@toolbar-height: 75px;
Expand Down
8 changes: 5 additions & 3 deletions components/views/navigation/sidebar/Sidebar.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="sidebar">
<div class="sidebar">
<div class="sidebar-inner">
<div class="sidebar-search">
<UiComingSoon
Expand Down Expand Up @@ -51,8 +51,10 @@
</InteractablesButton>
</div>
<div class="quick-toggle" v-tooltip.top="$t('pages.chat.new_chat')">
<plus-circle-icon size="1x" @click="toggleModal" />
<FriendsQuick
<button @click="toggleModal">
<plus-icon size="1.4x" />
</button>
<SidebarQuick
v-if="isQuickchatVisible"
v-click-outside="toggleModal"
@toggle="toggleModal"
Expand Down
64 changes: 34 additions & 30 deletions components/views/navigation/sidebar/Sidebar.less
Original file line number Diff line number Diff line change
@@ -1,37 +1,34 @@
@sidebar-inner-offset: 175px;
@sidebar-gradient: linear-gradient(
163.91deg,
rgba(48, 52, 71, 0.5) 0%,
rgba(42, 54, 75, 0) 100%
),
linear-gradient(163.91deg, rgba(28, 39, 58, 0.9) 0%, rgba(0, 0, 0, 0.09) 100%),
linear-gradient(
359.95deg,
rgba(36, 40, 57, 0.9) 0.04%,
rgba(34, 44, 63, 0) 99.95%
),
@darker;

#sidebar {
.sidebar {
display: flex;
flex-direction: column;
justify-content: space-between;
position: relative;
width: @sidebar-width;
margin: @normal-spacing 0;
flex-shrink: 0;

.sidebar-inner {
&:extend(.round-corners);
box-shadow: @ui-shadow;
max-height: calc(@app-height - @sidebar-inner-offset);
display: flex;
flex-direction: column;
padding: @normal-spacing;
gap: @normal-spacing;
background: linear-gradient(
163.91deg,
rgba(48, 52, 71, 0.5) 0%,
rgba(42, 54, 75, 0) 100%
),
linear-gradient(
163.91deg,
rgba(28, 39, 58, 0.9) 0%,
rgba(0, 0, 0, 0.09) 100%
),
linear-gradient(
359.95deg,
rgba(36, 40, 57, 0.9) 0.04%,
rgba(34, 44, 63, 0) 99.95%
),
#121216;
padding: @normal-spacing;
box-shadow: @ui-shadow;
max-height: calc(100% - @sidebar-controls-height);
&:extend(.round-corners);
background: @sidebar-gradient;

.sidebar-search {
display: flex;
Expand All @@ -50,12 +47,15 @@
}

.quick-toggle {
display: flex;
align-self: flex-end;
padding-left: @light-spacing;
position: relative;
svg {
cursor: pointer;
button {
align-items: center;
justify-content: center;
height: 32px;
width: 32px;
border-radius: 50%;
background-color: @foreground-alt;
}
}

Expand All @@ -70,11 +70,15 @@
}

.controls {
&:extend(.background-semitransparent-light);
&:extend(.round-corners);
padding: @light-spacing @normal-spacing @normal-spacing @normal-spacing;
display: flex;
flex-direction: column;
gap: @normal-spacing;
height: @sidebar-controls-height;
padding: @normal-spacing;
box-shadow: @ui-shadow;
margin-top: auto;
flex-shrink: 0;
&:extend(.round-corners);
background: @sidebar-gradient;
}

.label {
Expand Down
14 changes: 1 addition & 13 deletions components/views/navigation/sidebar/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,16 @@
<script lang="ts">
import Vue from 'vue'
import { mapState } from 'vuex'
import {
UsersIcon,
UserPlusIcon,
PlusIcon,
PlusCircleIcon,
FolderIcon,
MessageSquareIcon,
MenuIcon,
} from 'satellite-lucide-icons'
import { UsersIcon, PlusIcon, FolderIcon } from 'satellite-lucide-icons'
import { RootState } from '~/types/store/store'
import iridium from '~/libraries/Iridium/IridiumManager'
import type { FriendRequest } from '~/libraries/Iridium/friends/types'
export default Vue.extend({
components: {
UsersIcon,
UserPlusIcon,
PlusIcon,
PlusCircleIcon,
FolderIcon,
MessageSquareIcon,
MenuIcon,
},
data() {
return {
Expand Down
26 changes: 7 additions & 19 deletions components/views/navigation/sidebar/controls/Controls.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="controls">
<div class="call-controls">
<InteractablesButton
:type="audioMuted ? 'danger' : 'dark'"
size="small"
Expand All @@ -9,12 +9,8 @@
:loading="isLoading"
loadingText=""
>
<mic-off-icon
data-cy="sidebar-mic-muted"
v-if="audioMuted"
size="1x"
></mic-off-icon>
<mic-icon data-cy="sidebar-mic-unmuted" v-else size="1x"></mic-icon>
<mic-off-icon data-cy="sidebar-mic-muted" v-if="audioMuted" size="1x" />
<mic-icon data-cy="sidebar-mic-unmuted" v-else size="1x" />
</InteractablesButton>
<InteractablesButton
:type="audio.deafened ? 'danger' : 'dark'"
Expand All @@ -28,12 +24,8 @@
data-cy="sidebar-audio-deafened"
v-if="audio.deafened"
size="1x"
></headphones-off-icon>
<headphones-icon
data-cy="sidebar-audio-not-deafened"
v-else
size="1x"
></headphones-icon>
/>
<headphones-icon data-cy="sidebar-audio-not-deafened" v-else size="1x" />
</InteractablesButton>
<InteractablesButton
v-if="inCall"
Expand All @@ -45,11 +37,7 @@
:loading="isLoading"
loadingText=""
>
<video-off-icon
data-cy="sidebar-video-muted"
v-if="videoMuted"
size="1x"
></video-off-icon>
<video-icon data-cy="sidebar-video-unmuted" v-else size="1x"></video-icon>
<video-off-icon data-cy="sidebar-video-muted" v-if="videoMuted" size="1x" />
<video-icon data-cy="sidebar-video-unmuted" v-else size="1x"/ >
</InteractablesButton>
</div>
14 changes: 4 additions & 10 deletions components/views/navigation/sidebar/controls/Controls.less
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
#controls {
.call-controls {
display: flex;
flex-direction: row;
padding: 0.25rem 0;
margin: @light-spacing 0;

.button {
flex: 1;
&:nth-child(2) {
margin: 0 0.25rem;
}
gap: @light-spacing;
button {
flex-grow: 1;
}
}
2 changes: 1 addition & 1 deletion components/views/navigation/sidebar/list/item/Item.less
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}

&.selected {
&:extend(.background-semitransparent-lighter);
background-color: #2e303d;
}

&:hover {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
37 changes: 0 additions & 37 deletions components/views/navigation/toolbar/Toolbar.less
Original file line number Diff line number Diff line change
Expand Up @@ -71,44 +71,7 @@
}
}

@media only screen and (max-width: @mobile-breakpoint) {
#toolbar {
min-width: @viewport-width;
padding-right: @normal-spacing;
min-height: @toolbar-height;
padding-top: @light-spacing;

.circle-container {
order: 1;
margin-left: 24px;
height: auto;
}

.controls {
background: none;
box-shadow: unset;
.control-button {
padding: 2px;
width: 24px;
min-width: 24px;
height: 24px;
margin-left: 24px;
display: flex;
justify-content: center;
align-items: center;
}
.control-icon {
display: block;
margin: 0;
width: 18px;
height: 18px;
}
}
}
}

/* Only for Safari to fix lack resolution of svgs */

@media not all and (min-resolution: 0.001dpcm) {
@supports (-webkit-appearance: none) {
#toolbar .controls svg {
Expand Down

0 comments on commit d5d3a75

Please sign in to comment.