Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion api/config/config.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,8 @@
"membershipPayment": {
"API_KEY": "GO_AWAY_LOL"
},
"secretKey": "super duper secret key"
"secretKey": "super duper secret key",
"SCEvents": {
"ENABLED": false
}
}
2 changes: 2 additions & 0 deletions src/Components/Navbar/UserNavbar.js
Original file line number Diff line number Diff line change
@@ -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();
Expand All @@ -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 = [
Expand Down
8 changes: 8 additions & 0 deletions src/Pages/Events/Events.js
Original file line number Diff line number Diff line change
@@ -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 ? <h1>Events Page</h1> : <Redirect to="/notfound" />;
}
6 changes: 6 additions & 0 deletions src/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import Home from './Pages/Home/Home.js';
import CardReader from './Pages/CardReader/CardReader.js';
import AuditLogsPage from './Pages/AuditLog/AuditLog.js';
import PermissionRequestPage from './Pages/PermissionRequest/PermissionRequest.js';
import EventsPage from './Pages/Events/Events.js';

// Declare an enum for permission check
export const allowedIf = {
Expand Down Expand Up @@ -197,6 +198,11 @@ export const signedOutRoutes = [
path: '/projects',
pageName: 'Projects'
},
{
Component: EventsPage,
path: '/events',
pageName: 'Events'
},
{
Component: EmailPreferencesPage,
path: '/emailPreferences',
Expand Down
5 changes: 4 additions & 1 deletion src/config/config.example.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"sitekey": "super secret key",
"TINYMCE_API_KEY": "XXXXXXXXXXXXXXXXXXXXX",
"GOOGLE_API_CLIENT_ID": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.apps.googleusercontent.com"
"GOOGLE_API_CLIENT_ID": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.apps.googleusercontent.com",
"SCEvents": {
"ENABLED": false
}
}
Loading