|
20 | 20 | <div class="user-selected">
|
21 | 21 | <!-- eslint-disable vue/no-mutating-props -->
|
22 | 22 | <ms-checkbox
|
| 23 | + :class="{ 'checkbox-mobile': isSmallDisplay }" |
23 | 24 | v-model="user.isSelected"
|
24 | 25 | v-show="user.isSelected || isHovered || showCheckbox"
|
25 | 26 | v-if="!user.isRevoked() && !user.isCurrent"
|
|
30 | 31 | </div>
|
31 | 32 |
|
32 | 33 | <!-- user name -->
|
33 |
| - <div class="user-name"> |
| 34 | + <div |
| 35 | + class="user-name" |
| 36 | + v-if="isLargeDisplay" |
| 37 | + > |
34 | 38 | <ion-label class="user-name__label cell">
|
35 | 39 | <user-avatar-name
|
36 |
| - class="main-cell" |
37 | 40 | :user-avatar="user.humanHandle.label"
|
38 | 41 | :user-name="user.humanHandle.label"
|
39 | 42 | />
|
|
45 | 48 | </span>
|
46 | 49 | </ion-label>
|
47 | 50 | </div>
|
| 51 | + <div |
| 52 | + class="user-mobile" |
| 53 | + v-if="isSmallDisplay" |
| 54 | + > |
| 55 | + <user-avatar-name |
| 56 | + :user-avatar="user.humanHandle.label" |
| 57 | + class="user-mobile-avatar" |
| 58 | + :class="{ |
| 59 | + 'hide-avatar': showCheckbox && !user.isRevoked() && !user.isCurrent, |
| 60 | + 'disable-avatar': user.isRevoked() || user.isCurrent, |
| 61 | + }" |
| 62 | + /> |
| 63 | + <div class="user-mobile-text"> |
| 64 | + <ion-text class="button-medium user-mobile-text__name">{{ user.humanHandle.label }}</ion-text> |
| 65 | + <ion-text class="cell user-mobile-text__email"> |
| 66 | + {{ user.humanHandle.email }} |
| 67 | + </ion-text> |
| 68 | + <tag-profile |
| 69 | + :profile="user.currentProfile" |
| 70 | + class="user-mobile-text__profile" |
| 71 | + /> |
| 72 | + </div> |
| 73 | + </div> |
48 | 74 |
|
49 | 75 | <!-- user profile -->
|
50 | 76 | <div class="user-profile">
|
|
80 | 106 | <!-- options -->
|
81 | 107 | <div class="user-options ion-item-child-clickable">
|
82 | 108 | <ion-button
|
83 |
| - v-show="(isHovered || menuOpened) && !user.isCurrent" |
| 109 | + v-show="((isHovered || menuOpened) && !user.isCurrent) || isSmallDisplay" |
84 | 110 | fill="clear"
|
85 | 111 | class="options-button"
|
86 | 112 | @click.stop="onOptionsClick($event)"
|
|
96 | 122 | </template>
|
97 | 123 |
|
98 | 124 | <script setup lang="ts">
|
99 |
| -import { formatTimeSince, MsCheckbox } from 'megashark-lib'; |
| 125 | +import { formatTimeSince, MsCheckbox, useWindowSize } from 'megashark-lib'; |
100 | 126 | import TagProfile from '@/components/users/TagProfile.vue';
|
101 | 127 | import UserAvatarName from '@/components/users/UserAvatarName.vue';
|
102 | 128 | import UserStatusTag from '@/components/users/UserStatusTag.vue';
|
103 | 129 | import { UserModel } from '@/components/users/types';
|
104 |
| -import { IonButton, IonIcon, IonItem, IonLabel } from '@ionic/vue'; |
| 130 | +import { IonButton, IonIcon, IonItem, IonLabel, IonText } from '@ionic/vue'; |
105 | 131 | import { ellipsisHorizontal } from 'ionicons/icons';
|
106 | 132 | import { ref } from 'vue';
|
107 | 133 |
|
108 | 134 | const isHovered = ref(false);
|
109 | 135 | const menuOpened = ref(false);
|
| 136 | +const { isLargeDisplay, isSmallDisplay } = useWindowSize(); |
110 | 137 |
|
111 | 138 | const props = defineProps<{
|
112 | 139 | user: UserModel;
|
@@ -134,93 +161,57 @@ async function onOptionsClick(event: Event): Promise<void> {
|
134 | 161 | </script>
|
135 | 162 |
|
136 | 163 | <style scoped lang="scss">
|
137 |
| -.user-selected { |
138 |
| - min-width: 4rem; |
139 |
| - justify-content: end; |
140 |
| - width: auto; |
141 |
| -} |
142 |
| - |
143 | 164 | .user-name {
|
144 |
| - padding: 0.5rem 1rem; |
145 |
| - width: auto; |
146 |
| - flex-grow: 1; |
147 |
| - min-width: 11.25rem; |
148 |
| - max-width: 25rem; |
149 |
| - |
150 | 165 | &__label {
|
151 | 166 | display: flex;
|
152 | 167 | align-items: center;
|
153 | 168 | gap: 0.5rem;
|
154 | 169 | overflow: hidden;
|
155 |
| - |
156 |
| - .main-cell { |
157 |
| - white-space: nowrap; |
158 |
| - overflow: hidden; |
159 |
| - } |
160 | 170 | }
|
161 | 171 |
|
162 | 172 | &__you {
|
163 | 173 | color: var(--parsec-color-light-primary-600);
|
164 | 174 | }
|
165 | 175 | }
|
166 | 176 |
|
167 |
| -.user-profile { |
168 |
| - min-width: 11.5rem; |
169 |
| - max-width: 10vw; |
170 |
| - width: auto; |
171 |
| - flex-grow: 2; |
172 |
| -} |
| 177 | +.user-mobile { |
| 178 | + display: flex; |
| 179 | + align-items: center; |
| 180 | + width: 100%; |
| 181 | + gap: 0.75rem; |
| 182 | + padding: 0.75rem 0.5rem; |
173 | 183 |
|
174 |
| -.user-email { |
175 |
| - max-width: 16rem; |
176 |
| - min-width: 16rem; |
177 |
| - flex-grow: 0; |
178 |
| - color: var(--parsec-color-light-secondary-grey); |
179 |
| - overflow: hidden; |
| 184 | + .user-mobile-avatar { |
| 185 | + padding: 0.5rem; |
180 | 186 |
|
181 |
| - &__label { |
182 |
| - overflow: hidden; |
183 |
| - text-overflow: ellipsis; |
184 |
| - white-space: nowrap; |
185 |
| - } |
186 |
| -} |
187 |
| - |
188 |
| -.user-status { |
189 |
| - min-width: 8rem; |
190 |
| - width: auto; |
191 |
| - flex-grow: 0; |
192 |
| - color: var(--parsec-color-light-secondary-grey); |
193 |
| -} |
194 |
| - |
195 |
| -.user-join { |
196 |
| - min-width: 11.25rem; |
197 |
| - flex-grow: 0; |
198 |
| - overflow: hidden; |
199 |
| - color: var(--parsec-color-light-secondary-grey); |
200 |
| -} |
201 |
| - |
202 |
| -.user-options { |
203 |
| - min-width: 4rem; |
204 |
| - width: auto; |
205 |
| - flex-grow: 0; |
206 |
| - margin-left: auto; |
| 187 | + &.hide-avatar { |
| 188 | + opacity: 0; |
| 189 | + } |
207 | 190 |
|
208 |
| - ion-button::part(native) { |
209 |
| - padding: 0; |
| 191 | + &.disable-avatar { |
| 192 | + filter: grayscale(100%); |
| 193 | + opacity: 0.6; |
| 194 | + } |
210 | 195 | }
|
211 | 196 |
|
212 |
| - .options-button { |
213 |
| - --background-hover: none; |
| 197 | + &-text { |
| 198 | + display: flex; |
| 199 | + flex-direction: column; |
| 200 | + gap: 0.375rem; |
214 | 201 |
|
215 |
| - &__icon { |
216 |
| - color: var(--parsec-color-light-secondary-grey); |
| 202 | + &__name { |
| 203 | + color: var(--parsec-color-light-secondary-text); |
217 | 204 | }
|
218 | 205 |
|
219 |
| - &:hover { |
220 |
| - .options-button__icon { |
221 |
| - color: var(--parsec-color-light-primary-500); |
222 |
| - } |
| 206 | + &__email { |
| 207 | + color: var(--parsec-color-light-secondary-grey); |
223 | 208 | }
|
224 | 209 | }
|
225 | 210 | }
|
| 211 | + |
| 212 | +.user-status, |
| 213 | +.user-join, |
| 214 | +.user-email { |
| 215 | + color: var(--parsec-color-light-secondary-grey); |
| 216 | +} |
226 | 217 | </style>
|
0 commit comments