From 5c117dc216fee3b9571deee89e75168c81acff36 Mon Sep 17 00:00:00 2001 From: Liam <67254223+RealFascinated@users.noreply.github.com> Date: Wed, 19 Oct 2022 16:52:50 +0100 Subject: [PATCH] Add github link --- pages/index.js | 28 ++++++++++++++++++---------- src/utils/utils.js | 4 ++++ 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/pages/index.js b/pages/index.js index 4c91ece..32a4b79 100644 --- a/pages/index.js +++ b/pages/index.js @@ -17,6 +17,7 @@ import NavBar from "../src/components/Navbar"; import { toast, ToastContainer } from "react-toastify"; import "react-toastify/dist/ReactToastify.css"; +import Utils from "../src/utils/utils"; import styles from "../styles/main.module.css"; export default class Home extends Component { @@ -293,16 +294,23 @@ export default class Home extends Component { - {this.state.overlayUrl !== undefined ? ( - <> - Url - - {this.state.overlayUrl} - - - ) : ( - <> - )} + + { + event.preventDefault(); + Utils.openInNewTab( + "https://github.com/RealFascinated/beatsaber-overlay" + ); + }} + > + If you like this project and want to support it. Come + check out the project on GitHub! + + diff --git a/src/utils/utils.js b/src/utils/utils.js index c6c3fb7..ccde4ea 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -12,4 +12,8 @@ export default class Utils { static getWebsiteApi(website) { return WebsiteTypes[website]; } + + static openInNewTab(url) { + window.open(url, "_blank"); + } }