Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ogerly committed Jun 29, 2024
2 parents 170b548 + 7aff150 commit 045aefb
Show file tree
Hide file tree
Showing 15 changed files with 88 additions and 41 deletions.
1 change: 1 addition & 0 deletions frontend/renderer/plugins/vuetify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function makeThemeFromCssModule(theme: CSSModuleClasses, isDark: boolean): Theme
error: theme.errorColor,
font: theme.fontColor,
icon: theme.iconColor,
'dropdown-background': theme.dropdownBackgroundColor,
},
variables: {
'border-color': theme.borderColor,
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/assets/icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Bell from './bell.svg?component'
import Camera from './camera.svg?component'
import Cockpit from './cockpit.svg?component'
import Ellipsis from './ellipsis.svg?component'
import Logout from './logout.svg?component'
import Mall from './mall.svg?component'
import Message from './message.svg?component'
import WorldCafe from './worldCafe.svg?component'
Expand All @@ -13,6 +14,7 @@ const aliases: Partial<IconAliases> = {
camera: Camera,
cockpit: Cockpit,
ellipsis: Ellipsis,
logout: Logout,
mall: Mall,
message: Message,
'world-cafe': WorldCafe,
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/assets/icons/logout.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions frontend/src/assets/scss/dark.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ $icon-color: #F5F5F5;
$icon-background: rgb(61 71 83 / 85%);
$bottom-menu-background: rgb(78 91 107 / 60%);
$sidebar-background: rgb(61 71 83 / 60%);
$dropdown-background-color: #3D4753;

:export {
backgroundColor: $background-color;
Expand All @@ -30,4 +31,5 @@ $sidebar-background: rgb(61 71 83 / 60%);
iconBackground: $icon-background;
bottomMenuBackground: $bottom-menu-background;
sidebarBackground: $sidebar-background;
dropdownBackgroundColor: $dropdown-background-color;
}
2 changes: 2 additions & 0 deletions frontend/src/assets/scss/light.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ $icon-color: #3D4753;
$icon-background: rgb(255 255 255);
$bottom-menu-background: rgb(225 230 237 / 60%);
$sidebar-background: rgb(225 230 237);
$dropdown-background-color: #fff;

:export {
backgroundColor: $background-color;
Expand All @@ -30,5 +31,6 @@ $sidebar-background: rgb(225 230 237);
iconBackground: $icon-background;
bottomMenuBackground: $bottom-menu-background;
sidebarBackground: $sidebar-background;
dropdownBackgroundColor: $dropdown-background-color;
}

49 changes: 35 additions & 14 deletions frontend/src/components/menu/UserDropdown.vue
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
<template>
<MainButton class="sign-out mr-4" variant="third" label="Sign Out" size="auto" @click="signOut"
>{{ $t('buttons.signout') }}
</MainButton>
<MainButton
v-if="auth.isAdmin"
class="admin-button mr-4"
variant="third"
label="To Admin"
size="auto"
@click="enterAdmin"
>
{{ $t('buttons.toAdmin') }}
</MainButton>
<ul class="dropdown border-sm pa-3 pb-2 my-2 bg-dropdown-background">
<li>
<button class="sign-out" @click="signOut">
<v-icon icon="$logout"></v-icon>{{ $t('buttons.signout') }}
</button>
</li>
<li v-if="auth.isAdmin">
<button class="admin-button" @click="enterAdmin">
<v-icon icon="$logout"></v-icon>{{ $t('buttons.toAdmin') }}
</button>
</li>
</ul>
</template>

<script lang="ts" setup>
import { inject } from 'vue'
import MainButton from '#components/buttons/MainButton.vue'
import GlobalErrorHandler from '#plugins/globalErrorHandler'
import { AUTH } from '#src/env'
import AuthService from '#src/services/AuthService'
Expand All @@ -39,3 +37,26 @@ const enterAdmin = async () => {
window.location.href = AUTH.ADMIN_REDIRECT_URI
}
</script>

<style scoped lang="scss">
.dropdown {
font-size: 14px;
list-style: none;
border-radius: 20px;
}
.dropdown li {
padding: 5px;
}
.dropdown button {
display: flex;
align-items: center;
width: 100%;
}
.dropdown button i {
margin-top: -2px;
margin-right: 8px;
}
</style>
24 changes: 20 additions & 4 deletions frontend/src/components/menu/UserInfo.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<v-menu>
<v-menu v-model="isOpen">
<template #activator="{ props }">
<button
v-bind="props"
Expand All @@ -10,8 +10,13 @@
<v-img v-if="userImage" :src="userImage" />
<span v-else>{{ initals?.toUpperCase() }}</span>
</v-avatar>
<div class="d-flex flex-column justify-center text-right pa-3 pl-4 w-100">
<v-icon icon="$ellipsis" data-test="user-dropdown"></v-icon>
<div class="d-flex flex-column justify-center text-right pa-1 pl-3 w-100">
<v-icon
icon="$ellipsis"
data-test="user-dropdown"
class="ellipsis-icon"
:class="isOpen && 'rotated'"
></v-icon>
</div>
</button>
</template>
Expand All @@ -20,6 +25,8 @@
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import { useAuthStore } from '#stores/authStore'
import UserDropdown from './UserDropdown.vue'
Expand All @@ -32,6 +39,8 @@ const initals = name
.map((n) => n.charAt(0))
.join('')
const userImage = authStore.user?.profile.picture
const isOpen = ref(false)
</script>

<style scoped lang="scss">
Expand All @@ -55,5 +64,12 @@ const userImage = authStore.user?.profile.picture
margin: 3px !important;
border-color: rgb(var(--v-theme-border) 0.8);
}
.ellipsis-icon {
transition: transform 0.3s;
}
.rotated {
transform: rotate(90deg);
}
</style>
m
Original file line number Diff line number Diff line change
Expand Up @@ -1257,12 +1257,12 @@ exports[`BottomMenu > renders BottomMenu 1`] = `
</div>
<div
class="d-flex flex-column justify-center text-right pa-3 pl-4 w-100"
class="d-flex flex-column justify-center text-right pa-1 pl-3 w-100"
data-v-607bdd70=""
>
<i
aria-hidden="true"
class="v-icon notranslate v-theme--light v-icon--size-default"
class="v-icon notranslate v-theme--light v-icon--size-default ellipsis-icon"
data-test="user-dropdown"
data-v-607bdd70=""
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -662,12 +662,12 @@ exports[`TopMenu > renders 1`] = `
</div>
<div
class="d-flex flex-column justify-center text-right pa-3 pl-4 w-100"
class="d-flex flex-column justify-center text-right pa-1 pl-3 w-100"
data-v-607bdd70=""
>
<i
aria-hidden="true"
class="v-icon notranslate v-theme--light v-icon--size-default"
class="v-icon notranslate v-theme--light v-icon--size-default ellipsis-icon"
data-test="user-dropdown"
data-v-607bdd70=""
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ exports[`UserInfo > renders 1`] = `
</div>
<div
class="d-flex flex-column justify-center text-right pa-3 pl-4 w-100"
class="d-flex flex-column justify-center text-right pa-1 pl-3 w-100"
data-v-607bdd70=""
>
<i
aria-hidden="true"
class="v-icon notranslate v-theme--light v-icon--size-default"
class="v-icon notranslate v-theme--light v-icon--size-default ellipsis-icon"
data-test="user-dropdown"
data-v-607bdd70=""
>
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/layouts/__snapshots__/DefaultLayout.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -668,12 +668,12 @@ exports[`DefaultLayout > renders 1`] = `
</div>
<div
class="d-flex flex-column justify-center text-right pa-3 pl-4 w-100"
class="d-flex flex-column justify-center text-right pa-1 pl-3 w-100"
data-v-607bdd70=""
>
<i
aria-hidden="true"
class="v-icon notranslate v-theme--light v-icon--size-default"
class="v-icon notranslate v-theme--light v-icon--size-default ellipsis-icon"
data-test="user-dropdown"
data-v-607bdd70=""
>
Expand Down Expand Up @@ -2100,12 +2100,12 @@ exports[`DefaultLayout > renders 1`] = `
</div>
<div
class="d-flex flex-column justify-center text-right pa-3 pl-4 w-100"
class="d-flex flex-column justify-center text-right pa-1 pl-3 w-100"
data-v-607bdd70=""
>
<i
aria-hidden="true"
class="v-icon notranslate v-theme--light v-icon--size-default"
class="v-icon notranslate v-theme--light v-icon--size-default ellipsis-icon"
data-test="user-dropdown"
data-v-607bdd70=""
>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"buttons": {
"newProject": "Neues Projekt",
"newTable": "Neuer Tisch",
"signout": "Sign Out",
"signout": "Logout",
"toAdmin": "Zum Admin",
"toAssistant": "Assistent",
"toRoom": "Zum Treffen"
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/pages/index/__snapshots__/Page.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -668,12 +668,12 @@ exports[`IndexPage > without apollo error > renders 1`] = `
</div>
<div
class="d-flex flex-column justify-center text-right pa-3 pl-4 w-100"
class="d-flex flex-column justify-center text-right pa-1 pl-3 w-100"
data-v-607bdd70=""
>
<i
aria-hidden="true"
class="v-icon notranslate v-theme--light v-icon--size-default"
class="v-icon notranslate v-theme--light v-icon--size-default ellipsis-icon"
data-test="user-dropdown"
data-v-607bdd70=""
>
Expand Down Expand Up @@ -2732,12 +2732,12 @@ exports[`IndexPage > without apollo error > renders 1`] = `
</div>
<div
class="d-flex flex-column justify-center text-right pa-3 pl-4 w-100"
class="d-flex flex-column justify-center text-right pa-1 pl-3 w-100"
data-v-607bdd70=""
>
<i
aria-hidden="true"
class="v-icon notranslate v-theme--light v-icon--size-default"
class="v-icon notranslate v-theme--light v-icon--size-default ellipsis-icon"
data-test="user-dropdown"
data-v-607bdd70=""
>
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/pages/join-room/__snapshots__/Page.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -668,12 +668,12 @@ exports[`JoinRoomPage > renders 1`] = `
</div>
<div
class="d-flex flex-column justify-center text-right pa-3 pl-4 w-100"
class="d-flex flex-column justify-center text-right pa-1 pl-3 w-100"
data-v-607bdd70=""
>
<i
aria-hidden="true"
class="v-icon notranslate v-theme--light v-icon--size-default"
class="v-icon notranslate v-theme--light v-icon--size-default ellipsis-icon"
data-test="user-dropdown"
data-v-607bdd70=""
>
Expand Down Expand Up @@ -2304,12 +2304,12 @@ exports[`JoinRoomPage > renders 1`] = `
</div>
<div
class="d-flex flex-column justify-center text-right pa-3 pl-4 w-100"
class="d-flex flex-column justify-center text-right pa-1 pl-3 w-100"
data-v-607bdd70=""
>
<i
aria-hidden="true"
class="v-icon notranslate v-theme--light v-icon--size-default"
class="v-icon notranslate v-theme--light v-icon--size-default ellipsis-icon"
data-test="user-dropdown"
data-v-607bdd70=""
>
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/pages/room/__snapshots__/Page.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -669,12 +669,12 @@ exports[`Room Page > renders 1`] = `
</div>
<div
class="d-flex flex-column justify-center text-right pa-3 pl-4 w-100"
class="d-flex flex-column justify-center text-right pa-1 pl-3 w-100"
data-v-607bdd70=""
>
<i
aria-hidden="true"
class="v-icon notranslate v-theme--light v-icon--size-default"
class="v-icon notranslate v-theme--light v-icon--size-default ellipsis-icon"
data-test="user-dropdown"
data-v-607bdd70=""
>
Expand Down Expand Up @@ -2107,12 +2107,12 @@ exports[`Room Page > renders 1`] = `
</div>
<div
class="d-flex flex-column justify-center text-right pa-3 pl-4 w-100"
class="d-flex flex-column justify-center text-right pa-1 pl-3 w-100"
data-v-607bdd70=""
>
<i
aria-hidden="true"
class="v-icon notranslate v-theme--light v-icon--size-default"
class="v-icon notranslate v-theme--light v-icon--size-default ellipsis-icon"
data-test="user-dropdown"
data-v-607bdd70=""
>
Expand Down

0 comments on commit 045aefb

Please sign in to comment.