Skip to content

Commit 07745ad

Browse files
committed
[feat] Initial open-library homepage, component & hook fix
1 parent 74174bd commit 07745ad

7 files changed

Lines changed: 466 additions & 4 deletions

File tree

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
npm test
1+
pnpm test

components/open-library/Footer.tsx

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import React from 'react';
2+
import { Container, Row, Col, Nav } from 'react-bootstrap';
3+
4+
const FooterComponent = () => {
5+
return (
6+
<footer className="bg-dark text-light py-4 mt-5">
7+
<Container>
8+
<Row>
9+
<Col md={4} className="mb-3 mb-md-0">
10+
<h5>Open Library</h5>
11+
<p>
12+
A community-driven library for sharing knowledge and stories.
13+
Built with open source. Powered by generosity.
14+
</p>
15+
</Col>
16+
<Col md={2} className="mb-3 mb-md-0">
17+
<h5>Quick Links</h5>
18+
<Nav className="flex-column">
19+
<Nav.Link href="#home" className="text-light px-0">
20+
Home
21+
</Nav.Link>
22+
<Nav.Link href="#catalog" className="text-light px-0">
23+
Catalog
24+
</Nav.Link>
25+
<Nav.Link href="#about" className="text-light px-0">
26+
About Us
27+
</Nav.Link>
28+
<Nav.Link href="#donate" className="text-light px-0">
29+
Donate
30+
</Nav.Link>
31+
</Nav>
32+
</Col>
33+
<Col md={3} className="mb-3 mb-md-0">
34+
<h5>Contact</h5>
35+
<p className="mb-1">Email: info@openlibrary.community</p>
36+
<p>Address: 123 Library Lane, Knowledge City, World</p>
37+
</Col>
38+
<Col md={3}>
39+
<h5>Follow Us</h5>
40+
<div>
41+
<a href="#facebook" className="text-light me-3">
42+
Facebook
43+
</a>
44+
<a href="#twitter" className="text-light me-3">
45+
Twitter
46+
</a>
47+
<a href="#instagram" className="text-light me-3">
48+
Instagram
49+
</a>
50+
<a href="#linkedin" className="text-light">
51+
Linkedin
52+
</a>
53+
</div>
54+
</Col>
55+
</Row>
56+
<Row className="mt-3">
57+
<Col className="text-center text-muted">
58+
<small>
59+
&copy; {new Date().getFullYear()} Open Library Community. All
60+
Rights Reserved.
61+
</small>
62+
</Col>
63+
</Row>
64+
</Container>
65+
</footer>
66+
);
67+
};
68+
69+
export default FooterComponent;

components/open-library/Navbar.tsx

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import React from 'react';
2+
import {
3+
Navbar,
4+
Nav,
5+
Container,
6+
Button,
7+
Form,
8+
FormControl,
9+
} from 'react-bootstrap';
10+
11+
const NavbarComponent = () => {
12+
return (
13+
<Navbar bg="light" expand="lg" sticky="top" className="mb-4 shadow-sm">
14+
<Container fluid>
15+
<Navbar.Brand href="#home" className="d-flex align-items-center">
16+
Open Library
17+
</Navbar.Brand>
18+
<Navbar.Toggle aria-controls="basic-navbar-nav" />
19+
<Navbar.Collapse id="basic-navbar-nav">
20+
<Nav className="me-auto">
21+
<Nav.Link href="#home">Home</Nav.Link>
22+
<Nav.Link href="#catalog">Catalog</Nav.Link>
23+
<Nav.Link href="#about">About</Nav.Link>
24+
<Nav.Link href="#donate">Donate</Nav.Link>
25+
<Nav.Link href="#how-to-borrow">How to Borrow</Nav.Link>
26+
<Nav.Link href="#review">Review</Nav.Link>
27+
</Nav>
28+
<Form className="d-flex">
29+
<FormControl
30+
type="search"
31+
placeholder="Search Books..."
32+
className="me-2"
33+
aria-label="Search"
34+
/>
35+
<Button variant="outline-success">Search</Button>
36+
</Form>
37+
<Button variant="primary" className="ms-lg-2 mt-2 mt-lg-0">
38+
Login/Register
39+
</Button>
40+
</Navbar.Collapse>
41+
</Container>
42+
</Navbar>
43+
);
44+
};
45+
46+
export default NavbarComponent;

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,6 @@
8181
},
8282
"lint-staged": {
8383
"*.{html,md,scss,json,yml,js,mjs,ts,tsx}": "prettier --write"
84-
}
84+
},
85+
"packageManager": "pnpm@10.8.1+sha512.c50088ba998c67b8ca8c99df8a5e02fd2ae2e2b29aaf238feaa9e124248d3f48f9fb6db2424949ff901cffbb5e0f0cc1ad6aedb602cd29450751d11c35023677"
8586
}

pages/_app.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ const App: FC<AppProps> = observer(({ Component, pageProps }) => {
4646
name: t('hackathon'),
4747
},
4848
{
49-
href: '/library', name: t('open_library'),
49+
href: '/open-library',
50+
name: t('open_library'),
5051
},
5152
];
5253
return (

0 commit comments

Comments
 (0)