Create a simple dropdown for notifications

This commit is contained in:
Robert Schäfer 2019-04-08 14:26:08 +02:00
parent 35e2640f37
commit d0812dae09
2 changed files with 27 additions and 0 deletions

View File

@ -303,6 +303,7 @@ When('open the notification menu and click on the first item', () => {
}) })
Then('see {int} unread notifications in the top menu', count => { Then('see {int} unread notifications in the top menu', count => {
cy.find('.notifications-menu').should('contain', count)
}) })
Then('I get to the post page of {string}', path => { Then('I get to the post page of {string}', path => {

View File

@ -31,6 +31,27 @@
/> />
</no-ssr> </no-ssr>
<template v-if="isLoggedIn"> <template v-if="isLoggedIn">
<no-ssr>
<dropdown class="notifications-menu">
<template
slot="default"
slot-scope="{toggleMenu}"
>
<ds-button
primary
icon="bell"
@click.prevent="toggleMenu"
>
7
</ds-button>
</template>
<template
slot="popover"
>
<h1> I am a notification </h1>
</template>
</dropdown>
</no-ssr>
<no-ssr> <no-ssr>
<dropdown class="avatar-menu"> <dropdown class="avatar-menu">
<template <template
@ -239,6 +260,11 @@ export default {
flex: 1; flex: 1;
} }
.notifications-menu {
display: flex;
align-items: center;
}
.avatar-menu-trigger { .avatar-menu-trigger {
user-select: none; user-select: none;
display: flex; display: flex;