Added component
This commit is contained in:
parent
27d1dbeb52
commit
5a37090ca4
2
custom.d.ts
vendored
2
custom.d.ts
vendored
@ -2,3 +2,5 @@ declare module "*.module.css" {
|
|||||||
const classes: { [key: string]: string };
|
const classes: { [key: string]: string };
|
||||||
export default classes;
|
export default classes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
declare module "*.svg";
|
||||||
|
25
src/Bookshelf/AddBook/AddBook.module.css
Normal file
25
src/Bookshelf/AddBook/AddBook.module.css
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
.container {
|
||||||
|
width: 300px;
|
||||||
|
padding-left: 10px;
|
||||||
|
transition: border-left-width 0.2s cubic-bezier(0.45, 0.05, 0.55, 0.95),
|
||||||
|
padding-left 0.2s cubic-bezier(0.45, 0.05, 0.55, 0.95);
|
||||||
|
border: 1px lightgrey solid;
|
||||||
|
background: none;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-family: Inter, system-ui, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container:hover {
|
||||||
|
padding-left: 20px;
|
||||||
|
border-left-width: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container > * {
|
||||||
|
line-height: 70vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.plus {
|
||||||
|
height: 30px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
13
src/Bookshelf/AddBook/index.tsx
Normal file
13
src/Bookshelf/AddBook/index.tsx
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import React from "react";
|
||||||
|
|
||||||
|
import plusIcon from "./plus.svg";
|
||||||
|
import styles from "./AddBook.module.css";
|
||||||
|
|
||||||
|
export const AddBook = () => {
|
||||||
|
return (
|
||||||
|
<button className={styles.container}>
|
||||||
|
<img src={plusIcon} className={styles.plus} />
|
||||||
|
<h1 className={styles.caption}>Add book</h1>
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
};
|
28
src/Bookshelf/AddBook/plus.svg
Normal file
28
src/Bookshelf/AddBook/plus.svg
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
width="120"
|
||||||
|
height="120"
|
||||||
|
viewBox="0 0 31.75 31.75"
|
||||||
|
version="1.1"
|
||||||
|
id="svg5"
|
||||||
|
inkscape:version="1.1 (c68e22c387, 2021-05-23)"
|
||||||
|
sodipodi:docname="plus.svg"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg">
|
||||||
|
<defs
|
||||||
|
id="defs2" />
|
||||||
|
<g
|
||||||
|
inkscape:label="Layer 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1">
|
||||||
|
<path
|
||||||
|
id="rect31"
|
||||||
|
style="fill:#000;fill-rule:evenodd;stroke-width:0.707104"
|
||||||
|
d="M 55 0 L 55 55 L 0 55 L 0 65 L 55 65 L 55 120 L 65 120 L 65 65 L 120 65 L 120 55 L 65 55 L 65 0 L 55 0 z "
|
||||||
|
transform="scale(0.26458333)" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 884 B |
@ -1,6 +1,6 @@
|
|||||||
.bookCard {
|
.bookCard {
|
||||||
width: 300px;
|
width: 300px;
|
||||||
border: 1px lightgray solid;
|
border: 1px lightgrey solid;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: stretch;
|
justify-content: stretch;
|
||||||
@ -19,7 +19,6 @@
|
|||||||
height: auto;
|
height: auto;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
transition: height 0.3s;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.cardHeading > * {
|
.cardHeading > * {
|
||||||
@ -28,7 +27,7 @@
|
|||||||
|
|
||||||
.imageContainer {
|
.imageContainer {
|
||||||
max-height: 0%;
|
max-height: 0%;
|
||||||
transition: max-height 0.3s;
|
transition: max-height 0.3s cubic-bezier(0.45, 0.05, 0.55, 0.95);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import styles from "./Bookshelf.module.css";
|
|||||||
|
|
||||||
import list from "../assets/bookList.json";
|
import list from "../assets/bookList.json";
|
||||||
import { BookItem } from "./BookItem";
|
import { BookItem } from "./BookItem";
|
||||||
|
import { AddBook } from "./AddBook";
|
||||||
|
|
||||||
export const Bookshelf = () => {
|
export const Bookshelf = () => {
|
||||||
const [books, setBooks] = useState<IBook[]>(list);
|
const [books, setBooks] = useState<IBook[]>(list);
|
||||||
@ -12,6 +13,7 @@ export const Bookshelf = () => {
|
|||||||
return (
|
return (
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<div className={styles.scrollContainer}>
|
<div className={styles.scrollContainer}>
|
||||||
|
<AddBook />
|
||||||
{books.map((book, index) => (
|
{books.map((book, index) => (
|
||||||
<BookItem key={book.hash} {...book} />
|
<BookItem key={book.hash} {...book} />
|
||||||
))}
|
))}
|
||||||
|
@ -15,10 +15,11 @@ body {
|
|||||||
font-family: Inter, system-ui, sans-serif;
|
font-family: Inter, system-ui, sans-serif;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
background: rgba(54, 54, 69, 0.05) none repeat scroll 0% 0%;
|
background: rgba(0, 0, 0, 0.05) none repeat scroll 0% 0%;
|
||||||
color: rgb(54, 54, 69);
|
color: #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
code {
|
code {
|
||||||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
|
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
|
||||||
}
|
monospace;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user