Skip to content

Commit

Permalink
added navigation to different page
Browse files Browse the repository at this point in the history
  • Loading branch information
vasantisuthar committed May 20, 2022
1 parent ca78ee2 commit afcec42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@
},
"devDependencies": {
"react-snap": "^1.23.0",
"typescript": "^4.6.4"
"typescript": "^4.6.4",
"react-snap": "^1.23.0",
"puppeteer": "^13.7.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useCallback, useState } from "react";
// import { useNavigate } from "react-router-dom";
import React, { useState } from "react";
import MoviePage from "../../pages/moviePage/moviePage.component";

import './menu-item.styles.css'
Expand All @@ -12,8 +11,8 @@ const MenuItem = ({title, imageUrl, linkUrl}) => {
}

const handleLocation = () => {
if(window.location.pathname === '/movie'){
<MoviePage categoryId={linkUrl}/>
if(window.location.pathname === '/plays/quizeo/movie'){
return <MoviePage categoryId={linkUrl}/>
}
}

Expand All @@ -22,7 +21,7 @@ const MenuItem = ({title, imageUrl, linkUrl}) => {
<div className="image-container" style={{backgroundImage:`url(${imageUrl})`}}/>
<div className="image-content"
onClick={handleClick}>
{isClicked ? {handleLocation}: null}
{isClicked ? handleLocation(): null}
<h1>{title}</h1>
</div>
</div>
Expand Down

0 comments on commit afcec42

Please sign in to comment.