diff --git a/index.html b/index.html index 47fa12b..2730575 100644 --- a/index.html +++ b/index.html @@ -11,3 +11,13 @@ + diff --git a/public/background.jpg b/public/background.jpg index df855c2..c0fe10a 100644 Binary files a/public/background.jpg and b/public/background.jpg differ diff --git a/src/App.vue b/src/App.vue index 3ddb861..13146e1 100644 --- a/src/App.vue +++ b/src/App.vue @@ -29,5 +29,38 @@ margin-top: 8px; padding: 0 12px; overflow-y: scroll; + max-height: 620px !important; } + +body { + position: absolute; + width: 342px; + max-height: 620px !important; + top: 118px; + left: calc(50% - 174px); +} +.v-application__wrap { + width: 342px; + min-height: 708px !important; +} + +.v-toolbar { + border-radius: 36px 36px 0 0 !important; + top: 118px !important; + left: calc(50% - 174px) !important; + width: 342px !important; +} + +.v-application { + border-radius: 36px; +} + +.recommandations { + position: fixed; + bottom: calc(100vh - 825px); + width: 342px; + left: calc(50% - 174px) !important; + border-radius: 0 0 36px 36px !important; +} + diff --git a/src/components/Suggestion.vue b/src/components/Suggestion.vue index 4693849..2ca6d16 100644 --- a/src/components/Suggestion.vue +++ b/src/components/Suggestion.vue @@ -26,7 +26,7 @@ async function getSimilarBooks() { params.collection = true; } - return getBookRecommandations(book.id, params) + return getBookRecommandations(book!.id, params) .then(result => { books.value = result; }) @@ -47,7 +47,7 @@ watch(selectedOption, getSimilarBooks) - diff --git a/src/pages/BookDetails.vue b/src/pages/BookDetails.vue index c97e29a..d949cf9 100644 --- a/src/pages/BookDetails.vue +++ b/src/pages/BookDetails.vue @@ -8,16 +8,21 @@ import {storeToRefs} from "pinia"; const router = useRouter(); -watch(() => router.currentRoute, () => { - console.log("watch", router.currentRoute.value.params.id) +watch(() => router.currentRoute.value.params.id, () => { bookStore.loadBook(router.currentRoute.value.params.id as string) + shouldShowReco.value = false; },) const bookStore = useBookStore(); const {book, isLoading} = storeToRefs(bookStore) onMounted(() => { - bookStore.loadBook(router.currentRoute.value.params.id as string); + const bookId = router.currentRoute.value.params.id; + if(!bookId) { + router.push({name: "search"}) + } else { + bookStore.loadBook(bookId as string) + } }) const shouldShowReco = ref(false); @@ -116,7 +121,7 @@ const shouldShowReco = ref(false); > - + { isLoading.value = true; return getBookById(id) .then(result => { - console.log("get book") book.value = result }) .finally(() => {