Skip to content

Commit 829677e

Browse files
luka-nextcloudvinicius73
authored andcommitted
feat: improve collaborator style
Signed-off-by: Luka Trovic <luka@nextcloud.com>
1 parent 1cc7755 commit 829677e

File tree

2 files changed

+58
-7
lines changed

2 files changed

+58
-7
lines changed

src/components/EditorWrapper.vue

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,17 @@
5454
:autohide="autohide"
5555
:loaded.sync="menubarLoaded">
5656
<div class="text-editor__session-list">
57-
<div v-tooltip="lastSavedStatusTooltip" class="save-status" :class="lastSavedStatusClass">
57+
<div v-if="isMobile" v-tooltip="lastSavedStatusTooltip" :class="saveStatusClass" />
58+
<div v-else
59+
v-tooltip="lastSavedStatusTooltip"
60+
class="save-status"
61+
:class="lastSavedStatusClass">
5862
{{ lastSavedStatus }}
5963
</div>
6064
<SessionList :sessions="filteredSessions">
65+
<p slot="lastSaved" class="last-saved">
66+
{{ t('text', 'Last saved') }}: {{ lastSavedString }}
67+
</p>
6168
<GuestNameDialog v-if="isPublic && !currentSession.userId" :session="currentSession" />
6269
</SessionList>
6370
</div>
@@ -323,6 +330,12 @@ export default {
323330
},
324331
}
325332
},
333+
saveStatusClass() {
334+
if (this.syncError && this.lastSavedString !== '') {
335+
return 'save-error'
336+
}
337+
return this.dirtyStateIndicator ? 'saving-status' : 'saved-status'
338+
},
326339
},
327340
watch: {
328341
displayed() {
@@ -925,4 +938,39 @@ export default {
925938
#files-public-content {
926939
height: 100%;
927940
}
941+
942+
.saved-status,.saving-status {
943+
display: inline-flex;
944+
padding: 0;
945+
text-overflow: ellipsis;
946+
color: var(--color-text-lighter);
947+
position: relative;
948+
background-color: white;
949+
width: 38px !important;
950+
height: 38px !important;
951+
left: 25%;
952+
z-index: 2;
953+
top: 0px;
954+
}
955+
956+
.saved-status {
957+
border: 2px solid #04AA6D;
958+
border-radius: 50%;
959+
}
960+
961+
.saving-status {
962+
border: 2px solid #f3f3f3;
963+
border-top: 2px solid #3498db;
964+
border-radius: 50%;
965+
animation: spin 2s linear infinite;
966+
}
967+
968+
@keyframes spin {
969+
0% { transform: rotate(0deg); }
970+
100% { transform: rotate(360deg); }
971+
}
972+
973+
.last-saved {
974+
padding: 6px;
975+
}
928976
</style>

src/components/SessionList.vue

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@
3333
</button>
3434
<template #default>
3535
<div class="session-menu">
36+
<slot name="lastSaved" />
3637
<ul>
3738
<slot />
3839
<li v-for="session in participantsPopover"
3940
:key="session.id"
4041
:style="avatarStyle(session)">
41-
<AvatarWrapper :session="session" :size="32" />
42+
<AvatarWrapper :session="session" :size="36" />
4243
<span class="session-label">
4344
{{ session.userId ? session.displayName : (session.guestName ? session.guestName : t('text', 'Guest')) }}
4445
</span>
@@ -144,17 +145,19 @@ export default {
144145
}
145146
146147
.avatar-wrapper {
147-
margin: 0 -8px 0 0;
148+
margin: 0 -18px 0 0;
148149
z-index: 1;
149150
border-radius: 50%;
150151
overflow: hidden;
151152
box-sizing: content-box !important;
153+
height: 36px;
154+
width: 36px;
152155
}
153156
154157
.icon-more, .icon-group, .icon-settings-dark {
155158
background-color: var(--color-background-dark);
156-
width: 44px;
157-
height: 44px;
159+
width: 40px;
160+
height: 40px;
158161
margin: 0 6px 0 0;
159162
}
160163
}
@@ -170,8 +173,8 @@ export default {
170173
padding: 6px;
171174
172175
.avatar-wrapper {
173-
height: 32px;
174-
width: 32px;
176+
height: 36px;
177+
width: 36px;
175178
margin-right: 6px;
176179
}
177180

0 commit comments

Comments
 (0)