-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #129 from PoulavBhowmick03/test/dashboard
Modified the Logout button CSS, state change for navbar elements
- Loading branch information
Showing
2 changed files
with
74 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,46 @@ | ||
import React from 'react'; | ||
import './header.css' | ||
import { ReactComponent as Logo } from "../../assets/images/logo.svg"; | ||
import { Link } from 'react-router-dom'; | ||
import { NavLink } from 'react-router-dom'; | ||
|
||
function Header({ walletId, onConnectWallet, onLogout }) { | ||
return ( | ||
<nav> | ||
<div className='list-items'> | ||
<div className='logo'> | ||
<Link to="/"> | ||
<Logo/> | ||
</Link> | ||
<nav> | ||
<div className='list-items'> | ||
<div className='logo'> | ||
<NavLink to="/"> | ||
<Logo/> | ||
</NavLink> | ||
</div> | ||
<div className='nav-items'> | ||
<NavLink to="/" end className={({ isActive }) => (isActive ? 'active-link' : '')}> | ||
Home | ||
</NavLink> | ||
<NavLink to="/dashboard" className={({ isActive }) => (isActive ? 'active-link' : '')}> | ||
Dashboard | ||
</NavLink> | ||
</div> | ||
<div className='wallet-section'> | ||
{walletId ? ( | ||
<div className='wallet-container'> | ||
<button className='logout-button' onClick={onLogout}> | ||
Log out | ||
</button> | ||
<div className='wallet-id'> | ||
{`${walletId.slice(0, 4)}...${walletId.slice(-4)}`} | ||
</div> | ||
<div className='nav-items'> | ||
<a href="/">Home</a> | ||
<Link to="/dashboard">Dashboard</Link> | ||
</div> | ||
<div className='wallet-section'> | ||
{walletId ? ( | ||
<div className='wallet-container'> | ||
<div className='wallet-id'> | ||
{`${walletId.slice(0, 4)}...${walletId.slice(-4)}`} | ||
</div> | ||
<button className='gradient-button' | ||
onClick={onLogout} | ||
> | ||
Log Out | ||
</button> | ||
</div> | ||
) : ( | ||
<button className='gradient-button' | ||
onClick={onConnectWallet} | ||
> | ||
<span>Connect Wallet</span> | ||
</button> | ||
)} | ||
</div> | ||
</div> | ||
</nav> | ||
</div> | ||
) : ( | ||
<button className='gradient-button' | ||
onClick={onConnectWallet} | ||
> | ||
<span>Connect Wallet</span> | ||
</button> | ||
)} | ||
</div> | ||
</div> | ||
</nav> | ||
); | ||
} | ||
|
||
export default Header; | ||
export default Header; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters