2019-07-26 18:16:37 +00:00
|
|
|
<template>
|
2019-08-04 21:49:07 +00:00
|
|
|
<div class="Bookmarks__BookmarksList">
|
|
|
|
<CreateBookmark
|
|
|
|
v-if="newBookmark"
|
|
|
|
:loading="creating"
|
|
|
|
@create-bookmark="onCreateBookmark"
|
2019-07-26 18:16:37 +00:00
|
|
|
/>
|
2019-08-04 21:49:07 +00:00
|
|
|
<template v-if="bookmarks.length">
|
|
|
|
<BookmarksListItem
|
|
|
|
v-for="bookmark in bookmarks"
|
|
|
|
:key="bookmark.id"
|
|
|
|
:bookmark="bookmark"
|
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
<div v-else-if="!loading" class="Bookmarks__BookmarksList_Empty">
|
|
|
|
<h2>No bookmarks here</h2>
|
|
|
|
<p>Try changing your query or add some using the button on the left.</p>
|
|
|
|
</div>
|
|
|
|
<div v-if="loading" class="Bookmarks__BookmarksList_Loading">
|
|
|
|
<span class="icon-loading" />
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-07-26 18:16:37 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import BookmarksListItem from './BookmarksListItem';
|
2019-08-04 21:49:07 +00:00
|
|
|
import CreateBookmark from './CreateBookmark';
|
2019-07-26 18:16:37 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'NavigationList',
|
|
|
|
components: {
|
|
|
|
BookmarksListItem,
|
2019-08-04 21:49:07 +00:00
|
|
|
CreateBookmark
|
2019-07-26 18:16:37 +00:00
|
|
|
},
|
|
|
|
props: {
|
|
|
|
bookmarks: {
|
|
|
|
type: Array,
|
|
|
|
required: true
|
2019-08-04 21:49:07 +00:00
|
|
|
},
|
|
|
|
newBookmark: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
creating: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
loading: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true
|
2019-07-26 18:16:37 +00:00
|
|
|
}
|
|
|
|
},
|
2019-08-04 21:49:07 +00:00
|
|
|
created() {},
|
|
|
|
methods: {
|
|
|
|
onCreateBookmark(url) {
|
|
|
|
this.$emit('create-bookmark', url);
|
|
|
|
}
|
|
|
|
}
|
2019-07-26 18:16:37 +00:00
|
|
|
};
|
|
|
|
</script>
|
2019-08-04 21:49:07 +00:00
|
|
|
<style>
|
|
|
|
.Bookmarks__BookmarksList
|
|
|
|
> *:first-child:not(.Bookmarks__BookmarksList_Loading):not(.Bookmarks__BookmarksList_Empty) {
|
|
|
|
border-top: 1px solid var(--color-border);
|
|
|
|
}
|
|
|
|
.Bookmarks__BookmarksList_Loading,
|
|
|
|
.Bookmarks__BookmarksList_Empty {
|
|
|
|
width: 200px;
|
|
|
|
margin: 200px auto;
|
|
|
|
}
|
|
|
|
.Bookmarks__BookmarksList_Loading {
|
|
|
|
text-align: center;
|
|
|
|
}
|
|
|
|
</style>
|