Skip to content

Commit

Permalink
Fix section links
Browse files Browse the repository at this point in the history
  • Loading branch information
KojoBailey committed Nov 28, 2024
1 parent f15abeb commit c16b42d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^7.0.1",
"react-router-hash-link": "^2.4.3",
"react-scripts": "^5.0.1",
"web-vitals": "^2.1.4"
},
Expand Down
11 changes: 9 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { HashRouter as Router, Routes, Route, Link } from "react-router-dom";
import { HashLink } from 'react-router-hash-link';
import React from 'react';
import ReactDOM from 'react-dom/client';
import reportWebVitals from './reportWebVitals';
Expand Down Expand Up @@ -26,6 +27,12 @@ const UseDebounce = (callback, delay) => {
};
};

const URLs = {
eng: "/",
spa: "/es",
jpn: "/jp"
};

const text_content = {
eng : {
navbar : {
Expand Down Expand Up @@ -120,7 +127,7 @@ function Home({lang}) {
<a href="https://jojomodding.miraheze.org/wiki/JoJo%27s_Bizarre_Modding_Wiki#tabber-Roadmaps" target="_blank">{GrabText("navbar", "roadmaps")}</a>
{nav_pipe}
<span className="no-mobile">
<a href="#about-us">{GrabText("navbar", "about")}</a>
<HashLink to={`${URLs[lang]}#about-us`}>{GrabText("navbar", "about")}</HashLink>
{nav_pipe}
</span>
<div className="flag">
Expand Down Expand Up @@ -157,7 +164,7 @@ function Home({lang}) {
</div>
</div>

<div className={`footer ${showFooter ? 'visible' : 'hidden'}`}><a href="#top">{GrabText("navbar", "top")}</a></div>
<div className={`footer ${showFooter ? 'visible' : 'hidden'}`}><HashLink to={`${URLs[lang]}#top`}>{GrabText("navbar", "top")}</HashLink></div>
</>
);
}
Expand Down

0 comments on commit c16b42d

Please sign in to comment.