forked from LfxB/copyfi
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
11,069 additions
and
203 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 |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
"baseUrl": "src" | ||
}, | ||
"include": ["src"] | ||
} | ||
} |
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 +1 @@ | ||
google-site-verification: googleab27cd38daab0cc8.html | ||
google-site-verification: googleab27cd38daab0cc8.html |
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
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,62 +1,49 @@ | ||
import React from 'react'; | ||
import React, { useState, useCallback } from 'react'; | ||
import { NavLink } from 'react-router-dom'; | ||
|
||
import './NavBar.css'; | ||
|
||
export default class NavBar extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
navbarClassName: 'main-nav' | ||
}; | ||
} | ||
export default function NavBar() { | ||
const [navbarClassName, setNavbarClassName] = useState('main-nav'); | ||
|
||
toggleResponsiveMenu = () => { | ||
const { navbarClassName } = this.state; | ||
const toggleResponsiveMenu = useCallback(() => { | ||
if (navbarClassName === 'main-nav') { | ||
this.setState({ | ||
navbarClassName: 'main-nav navbar-mobile' | ||
}); | ||
setNavbarClassName('main-nav navbar-mobile'); | ||
} else { | ||
this.setState({ | ||
navbarClassName: 'main-nav' | ||
}); | ||
setNavbarClassName('main-nav'); | ||
} | ||
}; | ||
}, [navbarClassName]); | ||
|
||
render = () => { | ||
const { navbarClassName } = this.state; | ||
return ( | ||
<nav className="navbar"> | ||
<span className="navbar-toggle" onClick={this.toggleResponsiveMenu}> | ||
<i className="material-icons">menu</i> | ||
</span> | ||
<NavLink to="/" className="logo"> | ||
copyfi | ||
</NavLink> | ||
<ul className={navbarClassName}> | ||
<li> | ||
<a | ||
href="https://open.spotify.com" | ||
className="nav-links" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Go To Spotify | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
href="https://github.com/LfxB/copyfi" | ||
className="nav-links" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Source | ||
</a> | ||
</li> | ||
</ul> | ||
</nav> | ||
); | ||
}; | ||
return ( | ||
<nav className="navbar"> | ||
<span className="navbar-toggle" onClick={toggleResponsiveMenu}> | ||
<i className="material-icons">menu</i> | ||
</span> | ||
<NavLink to="/" className="logo"> | ||
copyfi | ||
</NavLink> | ||
<ul className={navbarClassName}> | ||
<li> | ||
<a | ||
href="https://open.spotify.com" | ||
className="nav-links" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Go To Spotify | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
href="https://github.com/LfxB/copyfi" | ||
className="nav-links" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Source | ||
</a> | ||
</li> | ||
</ul> | ||
</nav> | ||
); | ||
} |
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
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.