Chore: UI fixes and enhancements (#796)

Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
This commit is contained in:
Nithin David Thomas 2020-05-02 09:47:36 +05:30 committed by GitHub
parent 8906fd808d
commit a951fb20cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 335 additions and 250 deletions

View file

@ -1,6 +1,10 @@
<template>
<transition-group name="toast-fade" tag="div" class="ui-snackbar-container">
<woot-snackbar :message="snackMessage" v-for="snackMessage in snackMessages" v-bind:key="snackMessage" />
<woot-snackbar
v-for="snackMessage in snackMessages"
:key="snackMessage"
:message="snackMessage"
/>
</transition-group>
</template>
@ -9,8 +13,12 @@
import WootSnackbar from './Snackbar';
export default {
components: {
WootSnackbar,
},
props: {
duration: {
type: Number,
default: 2500,
},
},
@ -22,16 +30,12 @@ export default {
},
mounted() {
bus.$on('newToastMessage', (message) => {
bus.$on('newToastMessage', message => {
this.snackMessages.push(message);
window.setTimeout(() => {
this.snackMessages.splice(0, 1);
}, this.duration);
});
},
components: {
WootSnackbar,
},
};
</script>

View file

@ -44,12 +44,12 @@ export default {
.file {
display: flex;
flex-direction: row;
padding: $space-normal;
padding: $space-smaller 0;
cursor: pointer;
.icon-wrap {
font-size: $font-size-giga;
color: $color-woot;
color: $color-white;
line-height: 1;
margin-left: $space-smaller;
margin-right: $space-slab;
@ -57,15 +57,22 @@ export default {
.text-block-title {
margin: 0;
color: $color-white;
font-weight: $font-weight-bold;
}
.button {
padding: 0;
margin: 0;
color: $color-primary-light;
}
.meta {
padding-right: $space-two;
}
.time {
min-width: $space-larger;
}
}
</style>

View file

@ -1,7 +1,7 @@
<template>
<span class="message-text__wrap">
<span class="time">{{ readableTime }}</span>
<span v-html="message"></span>
<span class="time">{{ readableTime }}</span>
</span>
</template>