-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: fixes URL so it's the roomName not just room
- Loading branch information
Showing
3 changed files
with
42 additions
and
31 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 |
---|---|---|
@@ -1,15 +1,32 @@ | ||
import './LandingPage.css' | ||
import { Link } from "react-router-dom"; | ||
import React from 'react'; | ||
import './LandingPage.css'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
export default function LandingPage() { | ||
return ( | ||
<div className="landing-page">Welcome to EscapeLink! Choose your room | ||
<div className="buttons"> | ||
<Link to={'/roomID'} className="Room-One">Alien Escape!</Link> | ||
<button>Coming Soon</button> | ||
<button>Coming Soon</button> | ||
<button>Coming Soon</button> | ||
<button>Coming Soon</button> | ||
const navigate = useNavigate(); | ||
let displayedRoomName = ''; // This is the variable you wanted to set. | ||
|
||
const goToRoom = (roomName) => { | ||
displayedRoomName = roomName; | ||
navigate(`/${displayedRoomName}`); | ||
}; | ||
|
||
return ( | ||
<div className="landing-page"> | ||
Welcome to EscapeLink! Choose your room | ||
<div className="buttons"> | ||
<button onClick={() => goToRoom('wheres-bob')} className="Room-One">Alien Escape!</button> | ||
<button>Coming Soon</button> | ||
<button>Coming Soon</button> | ||
<button>Coming Soon</button> | ||
<button>Coming Soon</button> | ||
</div> | ||
</div> | ||
</div>) | ||
); | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
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