Skip to content

Commit e6a8f9d

Browse files
fix: 404 on refresh
Replaced the BrowserRouter with HashRouter to make the entire app use a single route. closes #27, closes #28
1 parent c167e1b commit e6a8f9d

3 files changed

Lines changed: 9 additions & 10 deletions

File tree

frontend/src/components/aboutUs/index.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from "react";
2-
import { Link } from "react-router-dom";
32
import styles from "./style.module.css";
43

54
const AboutUs: React.FC = () => {
@@ -15,11 +14,8 @@ const AboutUs: React.FC = () => {
1514
</span>
1615
aim to help students and as a community we want to grow as much as
1716
possible in many domains of coding and development, be it
18-
Competitive Programming, Android, Web, Open Source
19-
<Link className={styles.hide} to="/bangbang">
20-
,
21-
</Link>{" "}
22-
AI/ML, Ethical Hacking .
17+
Competitive Programming, Android, Web, Open Source , AI/ML, Ethical
18+
Hacking .
2319
</p>
2420
<p className={styles.para}>
2521
We try to help each other learn new programming skills organize

frontend/src/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import ReactDOM from "react-dom";
22
import "./index.css";
33
import App from "./App";
4-
import { BrowserRouter } from "react-router-dom";
4+
import { HashRouter } from "react-router-dom";
55
import { MuiThemeProvider } from "@material-ui/core";
66
import Theme from "./theme/theme";
77

88
ReactDOM.render(
99
<MuiThemeProvider theme={Theme}>
10-
<BrowserRouter
10+
<HashRouter
1111
basename={
1212
window.location.hostname === "iiitdmj.ac.in" ||
1313
window.location.hostname === "www.iiitdmj.ac.in"
@@ -16,7 +16,7 @@ ReactDOM.render(
1616
}
1717
>
1818
<App />
19-
</BrowserRouter>
19+
</HashRouter>
2020
</MuiThemeProvider>,
2121
document.getElementById("root")
2222
);

frontend/src/pages/homePage/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ const HomePage: React.FC = () => {
2323
An Open Coding Community to explore and do a lot more with your
2424
friends and members.
2525
</span>
26-
<a href="#about">
26+
<a
27+
href="#"
28+
onClick={() => window.scrollTo(0, document.body.scrollHeight)}
29+
>
2730
<button className={styles.primaryBtn}>Explore Now</button>
2831
</a>
2932
</div>

0 commit comments

Comments
 (0)