Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@ function App() {

const[mode,setMode]=useState('light');

const toggleMode=()=>{
if(mode==='light'){
setMode('dark');
document.body.style.backgroundColor='#042743';
}
else{
setMode('light');
document.body.style.backgroundColor = '#fff';
}
const toggleMode = () => {
setMode(prevMode => (prevMode === 'light' ? 'dark' : 'light'));
};
// else{
// setMode('light');
// document.body.style.backgroundColor = '#fff';
// }
}

return (
Expand All @@ -48,6 +46,6 @@ function App() {
</div>
</>
);
}


export default App;
20 changes: 13 additions & 7 deletions src/assets/styles/App.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
/*

.app-container.light {
background-color: white;
color: black;
} */
--bg-color: #ffffff;
--text-color: #000000;
}

/* Dark mode styles */
.app-container.dark {
background-color: #042743;
color: white;
--bg-color: #042743;
--text-color: #ffffff;
}

.app-container {
background-color: var(--bg-color);
color: var(--text-color);
min-height: 100vh;
transition: all 0.3s ease;
}


Expand Down
17 changes: 17 additions & 0 deletions src/assets/styles/Books.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,23 @@
border: 2px solid #0aa5ff;
}

/* Container for search status messages */
.search-status-container {
text-align: center;
margin: 20px 0;
font-family: 'Poppins', sans-serif;
}

.status-text {
font-size: 1.5rem;
color: var(--text-color);
text-transform: capitalize;
border-bottom: 2px solid #2ecc71;
display: inline-block;
padding-bottom: 5px;
}


@media (max-width: 900px) {

.searchBook-div input {
Expand Down
8 changes: 8 additions & 0 deletions src/pages/Books.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ const Books = ({mode,changeMode}) => {
/>
</div>
</form>
{/* Container for search status messages */}
<div className="search-status-container">
{isLoading ? (
<h2 className="status-text">Searching for "{search}"...</h2>
) : (
<h2 className="status-text">{searchResult}</h2>
)}
</div>

<BookList/>
<Footer/>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const Login=({mode,changeMode})=>{
return (
<div className='login-container'>
<Navbar mode={mode} changeMode={changeMode}/>
<section className={`sectionclass {$mode}`}>
<section className={`sectionclass ${mode}`}>
<form>
<h1>Login</h1>
<label htmlFor="username">
Expand Down