-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #98 from Valik3201/refactor/api-functions
Refactor/api functions
- Loading branch information
Showing
7 changed files
with
153 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export const createBookMarkup = ({ _id, title, author, book_image }) => { | ||
const placeholderImageURL = new URL('/src/images/placeholder.jpg', import.meta.url).href; | ||
|
||
return ` | ||
<div class="books__book" data-book-id="${_id}"> | ||
<div class="books__book--cover"> | ||
<img class="lazyload" | ||
src="${placeholderImageURL}" | ||
data-src="${book_image}" | ||
alt="${title}"> | ||
<div class="books__book--cover-overlay"> | ||
<div class="books__book--cover-overlay-text">Quick View</div> | ||
</div> | ||
</div> | ||
<div class="books__book--title">${title}</div> | ||
<div class="books__book--author">${author}</div> | ||
</div> | ||
`; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters