Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance: Change night and day mode icon #71

Closed
wants to merge 1 commit into from
Closed
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
14 changes: 9 additions & 5 deletions src/Navbar.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from "react";
import daynight from './day-and-night.png'

import React, { useState } from "react";
import day from './day.png'
import night from './night.png'

const Navbar = (props) => {
const [nightMode ,setNightMode] = useState(true);
return (

<nav className={`navbar`} id="navbar" style={{ backgroundColor: "#8250DF" }}>
Expand All @@ -13,9 +14,12 @@ const Navbar = (props) => {
>
tru Weather
</span>
<div className="form-check form-switch">
<div className="form-check form-switch" onClick={() => setNightMode(!nightMode)}>
{/* <input className="form-check-input" onClick={props.toggleMode} type="checkbox" role="switch" id="flexSwitchCheckDefault" /> */}
<img src={daynight} onClick={props.toggleMode} className="mx-2" style={{ width: '40px', cursor: 'pointer' , filter: 'drop-shadow(rgb(34, 34, 34) 1px 2px 4px)' }} alt="" />
{
nightMode ? <img src={day} onClick={props.toggleMode} className="mx-2" style={{ width: '30px', cursor: 'pointer' }} alt="" /> :
<img src={night} onClick={props.toggleMode} className="mx-2 bg-white p-2 rounded-sm" style={{ width: '40px', cursor: 'pointer' }} alt="" />
}
{/* <label className="form-check-label" htmlFor="flexSwitchCheckDefault" style={{ color: 'white' }} id="toggle-label" >Enable Dark Mode</label> */}

</div>
Expand Down
Binary file removed src/day-and-night.png
Binary file not shown.
Binary file added src/day.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/night.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading