-
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 branch 'djeck1432:main' into test/add-dashboard_test
- Loading branch information
Showing
36 changed files
with
1,576 additions
and
245 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
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
presets: [['@babel/preset-env', { targets: { node: 'current' } }], '@babel/preset-react'], | ||
}; | ||
|
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
setupFiles: ['./jest.setup.js'], | ||
transform: { | ||
'^.+\\.[tj]sx?$': 'babel-jest', // Using Babel for transforming JS, JSX, TS, and TSX | ||
}, | ||
moduleNameMapper: { | ||
'\\.svg$': '<rootDir>/test/__mocks__/svgMock.js', | ||
}, | ||
transformIgnorePatterns: [ | ||
'node_modules/(?!(axios|get-starknet)/)' // Ignore transforming node_modules | ||
], | ||
|
||
testEnvironment: 'jsdom', // Use node as the test environment | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { TextEncoder, TextDecoder } from 'util'; | ||
|
||
global.TextEncoder = TextEncoder; | ||
global.TextDecoder = TextDecoder; |
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
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
Oops, something went wrong.