Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(ui): top bar: responsive + no favorites message
  • Loading branch information
Guillaume Chau committed May 30, 2018
commit af7bf1021d0a50f6555517ef9dcc6516b1f55adc
3 changes: 3 additions & 0 deletions packages/@vue/cli-ui/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@
"scroll": "Scroll to bottom"
}
},
"top-bar": {
"no-favorites": "No favorite projects"
},
"view-badge": {
"labels": {
"tasks": {
Expand Down
10 changes: 8 additions & 2 deletions packages/@vue/cli-ui/src/components/TopBar.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template>
<div class="top-bar">
<VueDropdown
v-if="$responsive.wide"
:label="projectCurrent ? projectCurrent.name : $t('components.status-bar.project.empty')"
class="current-project"
icon-right="arrow_drop_down"
Expand All @@ -14,6 +15,8 @@
@click="openProject(project)"
/>

<div v-if="!favoriteProjects.length" class="vue-ui-empty">{{ $t('components.top-bar.no-favorites') }}</div>

<div class="dropdown-separator"/>

<VueDropdownButton
Expand Down Expand Up @@ -46,7 +49,7 @@ export default {
favoriteProjects () {
if (!this.projects) return []
return this.projects.filter(
p => p.favorite
p => p.favorite && (!this.projectCurrent || this.projectCurrent.id !== p.id)
)
}
},
Expand Down Expand Up @@ -84,6 +87,7 @@ export default {

.current-project
min-width (180px - $padding-item * 2)
margin-right ($padding-item * 2)

>>> .trigger
.vue-ui-button
Expand All @@ -92,8 +96,10 @@ export default {
width 20px
height @width

.vue-ui-empty
padding 6px

.title
font-size 22px
font-weight lighter
margin-left $padding-item
</style>
2 changes: 1 addition & 1 deletion packages/@vue/cli-ui/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Vue.use(Responsive, {
return !this.tablet
},
wide () {
return this.width >= 1600
return this.width >= 1300
}
}
})
Expand Down