fix: Truncate long label names in the sidebar (#1309)

Co-authored-by: Pranav Raj S <pranav@thoughtwoot.com>
This commit is contained in:
amd-9 2020-10-10 20:10:11 +03:00 committed by GitHub
parent 3bb2d27646
commit 7d409321e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 4 deletions

View file

@ -275,6 +275,7 @@ export default {
id: label.id,
label: label.title,
color: label.color,
truncateLabel: true,
toState: frontendURL(
`accounts/${this.accountId}/label/${label.title}`
),

View file

@ -30,7 +30,7 @@
tag="li"
:to="child.toState"
>
<a href="#">
<a href="#" :class="computedChildClass(child)">
<div class="wrap">
<i
v-if="computedInboxClass(child)"
@ -42,8 +42,12 @@
class="label-color--display"
:style="{ backgroundColor: child.color }"
/>
{{ child.label }}
<div
:title="computedChildTitle(child)"
:class="computedChildClass(child)"
>
{{ child.label }}
</div>
</div>
</a>
</router-link>
@ -52,7 +56,6 @@
</template>
<script>
/* eslint no-console: 0 */
import { mapGetters } from 'vuex';
import router from '../../routes';
@ -125,6 +128,14 @@ export default {
const classByType = getInboxClassByType(type, phoneNumber);
return classByType;
},
computedChildClass(child) {
if (!child.truncateLabel) return '';
return 'text-truncate';
},
computedChildTitle(child) {
if (!child.truncateLabel) return false;
return child.label;
},
newLinkClick() {
router.push({ name: 'settings_inbox_new', params: { page: 'new' } });
},
@ -151,6 +162,7 @@ export default {
border-radius: $space-smaller;
height: $space-normal;
margin-right: $space-small;
min-width: $space-normal;
width: $space-normal;
}
</style>