From e480f06b5754d78fdf0a26b5000f3390b9f23b4e Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Mon, 4 Mar 2019 13:29:59 +0100 Subject: [PATCH] Add subnavigation to routes --- client/src/components/BookSidebar.vue | 63 ------------- .../book-navigation/BookNavigation.vue | 42 +++++++++ .../book-navigation/BookNavigationItem.vue | 92 +++++++++++++++++++ .../book-navigation/BookTopicNavigation.vue | 44 +++++++++ client/src/components/icons/ChevronDown.vue | 5 + client/src/components/icons/ChevronRight.vue | 3 +- client/src/components/icons/ChevronUp.vue | 5 + client/src/layouts/DefaultLayout.vue | 9 +- client/src/pages/book.vue | 29 +++--- client/src/pages/module-base.vue | 2 +- client/src/router/index.js | 5 +- 11 files changed, 217 insertions(+), 82 deletions(-) delete mode 100644 client/src/components/BookSidebar.vue create mode 100644 client/src/components/book-navigation/BookNavigation.vue create mode 100644 client/src/components/book-navigation/BookNavigationItem.vue create mode 100644 client/src/components/book-navigation/BookTopicNavigation.vue create mode 100644 client/src/components/icons/ChevronDown.vue create mode 100644 client/src/components/icons/ChevronUp.vue diff --git a/client/src/components/BookSidebar.vue b/client/src/components/BookSidebar.vue deleted file mode 100644 index 985f5a14..00000000 --- a/client/src/components/BookSidebar.vue +++ /dev/null @@ -1,63 +0,0 @@ - - - - - diff --git a/client/src/components/book-navigation/BookNavigation.vue b/client/src/components/book-navigation/BookNavigation.vue new file mode 100644 index 00000000..60e8ad6f --- /dev/null +++ b/client/src/components/book-navigation/BookNavigation.vue @@ -0,0 +1,42 @@ + + + + + diff --git a/client/src/components/book-navigation/BookNavigationItem.vue b/client/src/components/book-navigation/BookNavigationItem.vue new file mode 100644 index 00000000..60413a61 --- /dev/null +++ b/client/src/components/book-navigation/BookNavigationItem.vue @@ -0,0 +1,92 @@ + + + + + diff --git a/client/src/components/book-navigation/BookTopicNavigation.vue b/client/src/components/book-navigation/BookTopicNavigation.vue new file mode 100644 index 00000000..bb7de545 --- /dev/null +++ b/client/src/components/book-navigation/BookTopicNavigation.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/client/src/components/icons/ChevronDown.vue b/client/src/components/icons/ChevronDown.vue new file mode 100644 index 00000000..5e15524d --- /dev/null +++ b/client/src/components/icons/ChevronDown.vue @@ -0,0 +1,5 @@ + diff --git a/client/src/components/icons/ChevronRight.vue b/client/src/components/icons/ChevronRight.vue index 086dd6e3..3b9a8885 100644 --- a/client/src/components/icons/ChevronRight.vue +++ b/client/src/components/icons/ChevronRight.vue @@ -1,6 +1,5 @@ diff --git a/client/src/components/icons/ChevronUp.vue b/client/src/components/icons/ChevronUp.vue new file mode 100644 index 00000000..21c76ead --- /dev/null +++ b/client/src/components/icons/ChevronUp.vue @@ -0,0 +1,5 @@ + diff --git a/client/src/layouts/DefaultLayout.vue b/client/src/layouts/DefaultLayout.vue index 49611e41..474c7817 100644 --- a/client/src/layouts/DefaultLayout.vue +++ b/client/src/layouts/DefaultLayout.vue @@ -7,6 +7,8 @@ + + @@ -18,6 +20,7 @@ @@ -24,19 +22,22 @@ @import "@/styles/_mixins.scss"; .book { - display: -ms-grid; - @supports (display: grid) { - display: grid; - } + &__content { + display: -ms-grid; + @supports (display: grid) { + display: grid; + } - grid-column-gap: 50px; + grid-column-gap: 50px; - justify-items: start; + justify-items: start; - padding: 0 24px; + padding: 0 24px; - @include desktop { - grid-template-columns: 305px 1fr; + @include desktop { + grid-template-columns: 1200px; + justify-content: center; + } } } diff --git a/client/src/pages/module-base.vue b/client/src/pages/module-base.vue index d3af86ef..d9e6c60d 100644 --- a/client/src/pages/module-base.vue +++ b/client/src/pages/module-base.vue @@ -26,7 +26,7 @@ justify-items: center; @include desktop { - grid-template-columns: 400px minmax(max-content, 1fr) minmax(auto, 400px); + grid-template-columns: 1fr; } /* diff --git a/client/src/router/index.js b/client/src/router/index.js index a2fbec0e..d4a1824c 100644 --- a/client/src/router/index.js +++ b/client/src/router/index.js @@ -53,8 +53,11 @@ const routes = [ path: '/book', name: 'book', component: book, + meta: { + subnavigation: true + }, children: [ - {path: 'topic/:topicSlug', component: topic} + {path: 'topic/:topicSlug', component: topic, meta: {subnavigation: true}} ] }, {path: '*', component: p404}