improve ui

This commit is contained in:
taehoon 2019-04-02 13:18:41 -04:00
parent 787737c80d
commit fd4289e45a
2 changed files with 25 additions and 3 deletions

View file

@ -1,6 +1,6 @@
<template> <template>
<input v-model="query" placeholder="Search..." />
<div class="user-autosuggest" v-click-outside="onClickOutside"> <div class="user-autosuggest" v-click-outside="onClickOutside">
<input v-model="query" placeholder="Search whom you want to block" @click="onInputClick" class="user-autosuggest-input" />
<div class="user-autosuggest-results" v-if="resultsVisible"> <div class="user-autosuggest-results" v-if="resultsVisible">
<BasicUserCard v-for="user in results" :key="user.id" :user="user"/> <BasicUserCard v-for="user in results" :key="user.id" :user="user"/>
</div> </div>
@ -10,15 +10,31 @@
<script src="./user_autosuggest.js"></script> <script src="./user_autosuggest.js"></script>
<style lang="scss"> <style lang="scss">
@import '../../_variables.scss';
.user-autosuggest { .user-autosuggest {
position: relative; position: relative;
&-input {
display: block;
width: 100%;
}
&-results { &-results {
position: absolute; position: absolute;
left: 0; left: 0;
top: 100%; top: 100%;
right: 0; right: 0;
background: #FFF; background-color: $fallback--lightBg;
background-color: var(--lightBg, $fallback--lightBg);
border-style: solid;
border-width: 1px;
border-color: $fallback--border;
border-color: var(--border, $fallback--border);
border-radius: $fallback--inputRadius;
border-radius: var(--inputRadius, $fallback--inputRadius);
border-top-left-radius: 0;
border-top-right-radius: 0;
max-height: 400px; max-height: 400px;
overflow-y: auto; overflow-y: auto;
z-index: 1; z-index: 1;

View file

@ -195,7 +195,9 @@
</div> </div>
<div :label="$t('settings.blocks_tab')"> <div :label="$t('settings.blocks_tab')">
<UserAutoSuggest /> <div class="profile-edit-usersearch-wrapper">
<UserAutoSuggest />
</div>
<block-list :refresh="true"> <block-list :refresh="true">
<template slot="empty">{{$t('settings.no_blocks')}}</template> <template slot="empty">{{$t('settings.no_blocks')}}</template>
</block-list> </block-list>
@ -263,5 +265,9 @@
text-align: right; text-align: right;
} }
} }
&-usersearch-wrapper {
padding: 1em;
}
} }
</style> </style>