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
function isDesktopSize(){ | |
window.innerWidth > 1400 ? true : false; | |
} | |
var navbar = { | |
isOpen: true | |
}; | |
classes = `header ${ isDesktopSize() ? '' : | |
`icon-${navbar.isOpen ? 'collapse' : 'expand'}` }`; |
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
var guy = 'Paul'; | |
var age = 96; | |
function myTag(strings, personExp, ageExp) { | |
var str0 = strings[0]; // "That " | |
var str1 = strings[1]; // " is a " | |
var ageStr; | |
if (ageExp > 99){ | |
ageStr = 'centenarian'; |
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
function tag(strings) { | |
console.log(strings.raw[0]); | |
} | |
tag`I'd like this line 1 \n to ignore the newline and be in line with 1 | |
\n even though I should be on line 3 at this point`; | |
/* prints: I'd like this line 1 \n to ignore the newline and be in line with 1 | |
\n even though I should be on line 3 at this point */ |
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
var str = String.raw`What's up \n${4+7}?`; | |
console.log(str); | |
// prints: What's up \n11? | |
console.log(str.length); | |
// prints: 15 | |
console.log(str.split('').join(',')); | |
// prints: W,h,a,t,',s, ,u,p, ,\,n,1,1,? |
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
// just a normal string in one line - not much different from a traditional string | |
const simpleString = `a template literal is surrounded by backticks`; | |
// a string spread across multiple lines | |
const multiLineString = `it can be spread across | |
multiple lines with just | |
one set of enclosing backticks`; | |
const name = "Paige"; |
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
import React from 'react'; | |
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'; | |
import { BreakpointProvider } from 'react-socks'; | |
import NowPlaying from './containers/NowPlaying/NowPlaying'; | |
import Dashboard from './containers/Dashboard/Dashboard'; | |
import Upcoming from './containers/Upcoming/Upcoming'; | |
import MovieSearch from './containers/MovieSearch/MovieSearch'; | |
import Genres from './containers/Genres/Genres'; | |
import Header from './containers/Header/Header'; | |
import './App.css'; |
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
return ( | |
<div className="genres-page"> | |
<h1>Choose a Genre</h1> | |
{(error || loading) && <h3 className="genre-info">{info}</h3>} | |
<Breakpoint large up> | |
<div className="genre-list"> | |
{this.renderRedirect()} | |
{genreInfo} | |
</div> | |
</Breakpoint> |
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
.genre-list { | |
display: grid; | |
grid-template-columns: repeat(4, 1fr); | |
max-width: 1200px; | |
grid-gap: 15px; | |
justify-items: center; | |
margin: auto; | |
h3 { | |
margin: 200px auto; | |
} |
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
const Header = () => { | |
return ( | |
<nav className="navbar-wrapper"> | |
<Breakpoint medium up> | |
<ul className="navbar-links"> | |
<li className="navbar-link-logo"> | |
<NavLink to="/"> | |
<img src={TmdbIcon} alt="logo" /> | |
</NavLink> | |
</li> |