diff --git a/api/config/config.example.json b/api/config/config.example.json index b0f786da7..3e65ddb1b 100644 --- a/api/config/config.example.json +++ b/api/config/config.example.json @@ -35,5 +35,8 @@ "membershipPayment": { "API_KEY": "GO_AWAY_LOL" }, - "secretKey": "super duper secret key" + "secretKey": "super duper secret key", + "SCEvents": { + "ENABLED": false + } } \ No newline at end of file diff --git a/src/Components/Navbar/UserNavbar.js b/src/Components/Navbar/UserNavbar.js index 301860e9d..af0b5330c 100644 --- a/src/Components/Navbar/UserNavbar.js +++ b/src/Components/Navbar/UserNavbar.js @@ -1,6 +1,7 @@ import React, { useState, useEffect, useRef } from 'react'; import { membershipState } from '../../Enums'; import { useSCE } from '../context/SceContext'; +import config from '../../config/config.json'; export default function UserNavbar(props) { const { user, authenticated } = useSCE(); @@ -14,6 +15,7 @@ export default function UserNavbar(props) { { title: 'About', route: '/about' }, { title: 'Projects', route: '/projects' }, { title: 'Summer Internship', route: '/s/internship', newTab: true }, + ...(config.SCEvents?.ENABLED ? [{ title: 'SCEvents', route: '/events' }] : []), ]; const authedRoutes = [ diff --git a/src/Pages/Events/Events.js b/src/Pages/Events/Events.js new file mode 100644 index 000000000..0da2fb2ff --- /dev/null +++ b/src/Pages/Events/Events.js @@ -0,0 +1,8 @@ + +import config from '../../config/config.json'; +import NotFoundPage from '../NotFoundPage/NotFoundPage.js'; +import { Redirect } from 'react-router-dom'; + +export default function EventsPage() { + return config.SCEvents.ENABLED ?