Skip to content

Commit

Permalink
Made changes to index.html and App.js to change the text and color of…
Browse files Browse the repository at this point in the history
… the darkmode toggle label
  • Loading branch information
MiliMade committed Oct 6, 2022
1 parent 0f429ab commit 26897d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,19 @@ function App() {
if (Mode === 'light') {
setMode('dark');
document.body.style.backgroundColor = '#042743';
document.getElementById('darkmode-id').style.color='white'
document.getElementById('darkmode-id').innerText = "Enable Lightmode"
showAlert(" Dark mode has been enabled", "primary");
document.title = 'TextEdit-Dark Mode';

}
else {
else
{
setMode('light');
document.body.style.backgroundColor = 'white';
showAlert(" Light mode has been enabled", "success");
document.getElementById('darkmode-id').style.color='#042743'
document.getElementById('darkmode-id').innerText = "Enable Darkmode"
showAlert("Light mode has been enabled", "primary");
document.title = 'TextEdit-Light Mode';

}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function Navbar(props) {
</ul>
<div className={`form-check form-switch text-${props.Mode==='light'?'black':'white'}`}>
<input className="form-check-input" onClick={props.toggleMode} type="checkbox" role="switch" id="flexSwitchCheckDefault" />
<label className="form-check-label" htmlfor="flexSwitchCheckDefault">Enable LightMode</label>
<label className="form-check-label" htmlfor="flexSwitchCheckDefault" id='darkmode-id'>Enable LightMode</label>
</div>
</div>
</div>
Expand Down

0 comments on commit 26897d6

Please sign in to comment.