diff options
Diffstat (limited to 'frontend/src/components/pages/summary.js')
| -rw-r--r-- | frontend/src/components/pages/summary.js | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/frontend/src/components/pages/summary.js b/frontend/src/components/pages/summary.js index 0bd26af..9957c5d 100644 --- a/frontend/src/components/pages/summary.js +++ b/frontend/src/components/pages/summary.js | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | import React from 'react'; | 1 | import React, { useEffect } from 'react'; |
| 2 | import { useLocation } from "react-router-dom"; | 2 | import { useLocation, Link } from "react-router-dom"; |
| 3 | import ReactMarkdown from 'react-markdown' | 3 | import ReactMarkdown from 'react-markdown' |
| 4 | 4 | ||
| 5 | import "./summary.css"; | 5 | import "./summary.css"; |
| @@ -317,8 +317,18 @@ if(window.confirm(`Are you sure you want to remove post: ${post.title}?`)){ | |||
| 317 | } | 317 | } |
| 318 | 318 | ||
| 319 | 319 | ||
| 320 | |||
| 321 | if(data!==null){ | 320 | if(data!==null){ |
| 321 | |||
| 322 | let current_chapter = data.map.chapter_name | ||
| 323 | let isCoop = false; | ||
| 324 | if (data.map.game_name == "Portal 2 - Cooperative") { | ||
| 325 | isCoop = true | ||
| 326 | } | ||
| 327 | |||
| 328 | current_chapter = data.map.chapter_name.split(" ") | ||
| 329 | // current_chapter = current_chapter.split("-") | ||
| 330 | current_chapter = current_chapter[1] | ||
| 331 | |||
| 322 | return ( | 332 | return ( |
| 323 | <> | 333 | <> |
| 324 | {token!==null?mod===true?<Modview selectedRun={selectedRun} data={data} token={token}/>:"":""} | 334 | {token!==null?mod===true?<Modview selectedRun={selectedRun} data={data} token={token}/>:"":""} |
| @@ -329,8 +339,8 @@ return ( | |||
| 329 | <main> | 339 | <main> |
| 330 | <section id='section1' className='summary1'> | 340 | <section id='section1' className='summary1'> |
| 331 | <div> | 341 | <div> |
| 332 | <button className='nav-button'><i className='triangle'></i><span>{data.map.game_name}</span></button> | 342 | <Link to="/games"><button className='nav-button' style={{borderRadius: "20px 0px 0px 20px"}}><i className='triangle'></i><span>Games list</span></button></Link> |
| 333 | <button className='nav-button'><i className='triangle'></i><span>{data.map.chapter_name}</span></button> | 343 | <Link to={`/games/${data.map.game_name == "Portal 2 - Singleplayer" ? "game?game=1" : data.map.game_name == "Portal 2 - Cooperative" ? "game?game=2" : "psm"}&chapter=${current_chapter}`}><button className='nav-button' style={{borderRadius: "0px 20px 20px 0px", marginLeft: "2px"}}><i className='triangle'></i><span>{data.map.chapter_name}</span></button></Link> |
| 334 | <br/><span><b>{data.map.map_name}</b></span> | 344 | <br/><span><b>{data.map.map_name}</b></span> |
| 335 | </div> | 345 | </div> |
| 336 | 346 | ||