Skip to content

Commit

Permalink
Add script for installing dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
sidlak-c137 committed Oct 1, 2023
1 parent 9c78e52 commit 128be65
Show file tree
Hide file tree
Showing 4 changed files with 522 additions and 672 deletions.
110 changes: 22 additions & 88 deletions components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,94 +18,28 @@ export default function Sidebar(props: ISideBar) {
const { show, handleShow } = props;
const { currentUser, isAdmin } = useAuth()

let buttons : ISidebarButton[] = []
{!currentUser ? (
buttons = [
{
path: '/',
text: 'Home',
},
{
path: '/about',
text: 'About Us',
},
{
path: '/projects',
text: 'Projects',
},
{
path: '/events',
text: 'Events',
},
{
path: '/join',
text: 'Join Us',
}
]
) : (

isAdmin ? (

buttons = [
{
path: '/',
text: 'Home',
},
{
path: '/admin',
text: 'Admin',
},
{
path: '/resources',
text: 'Resources',
},
{
path: '/dashboard',
text: 'Dashboard',
},
{
path: '/profile',
text: 'Profile Maintenance',
},
{
path: '/private_project',
text: 'Project Maintenance',
},
{
path: '/join',
text: 'Join Us',
}
]
) : (
buttons = [
{
path: '/',
text: 'Home',
},
{
path: '/resources',
text: 'Resources',
},
{
path: '/dashboard',
text: 'Dashboard',
},
{
path: '/profile',
text: 'Profile Maintenance',
},
{
path: '/private_project',
text: 'Project Maintenance',
},
{
path: '/join',
text: 'Join Us',
}
]
)

)}
const buttons : ISidebarButton[] = [
{
path: '/',
text: 'Home',
},
{
path: '/about',
text: 'About Us',
},
{
path: '/projects',
text: 'Projects',
},
{
path: '/events',
text: 'Events',
},
{
path: '/join',
text: 'Join Us',
}
];

return (
<Flex
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"export": "next export",
"start": "next start",
"lint": "rome check .",
"fmt": "rome format . --write"
"fmt": "rome format . --write",
"deps": "yarn install; cd ./backend; npm install; cd ..;"
},
"dependencies": {
"@chakra-ui/react": "^2.5.1",
Expand Down
18 changes: 9 additions & 9 deletions utils/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { parseEvents, parsePeople, parseProjects } from './parsers';
// );

export const getFeaturedEvents = async (callback) => {
var data = await events.getEventsBasedOnTime(true);
const data = await events.getEventsBasedOnTime(true);
if (data) {
callback(parseEvents(data).slice(0, 3));
} else {
Expand All @@ -21,7 +21,7 @@ export const getFeaturedEvents = async (callback) => {
};

export const getAllEvents = async (callback, upcoming) => {
var data = await events.getEventsBasedOnTime(upcoming);
const data = await events.getEventsBasedOnTime(upcoming);
if (data) {
callback(parseEvents(data));
} else {
Expand All @@ -30,7 +30,7 @@ export const getAllEvents = async (callback, upcoming) => {
};

export const getPeople = async (callback) => {
var data = await leads.getActiveLeads();
const data = await leads.getActiveLeads();
if (data) {
callback(parsePeople(data));
} else {
Expand All @@ -39,7 +39,7 @@ export const getPeople = async (callback) => {
};

export const getProjects = async (callback, active) => {
var data = await projects.getActiveProjects(active);
const data = await projects.getActiveProjects(active);
if (data) {
callback(parseProjects(data));
} else {
Expand All @@ -48,7 +48,7 @@ export const getProjects = async (callback, active) => {
};

export const getAllProjects = async (callback) => {
var data = await projects.getProjects();
const data = await projects.getProjects();
if (data) {
callback(parseProjects(data));
} else {
Expand Down Expand Up @@ -83,7 +83,7 @@ export const sendEmail = async (name, email, notes) => {
};

export const exchangeAuth = async (user) => {
var github_access_token = await auth.exchangeAuth(user);
const github_access_token = await auth.exchangeAuth(user);
if (github_access_token) {
return github_access_token;
} else {
Expand All @@ -92,7 +92,7 @@ export const exchangeAuth = async (user) => {
}

export const getGithubUser = async (token) => {
var username = await auth.getGithubUser(token);
const username = await auth.getGithubUser(token);

if (username) {
return username;
Expand All @@ -102,12 +102,12 @@ export const getGithubUser = async (token) => {
};

export const checkMembership = async (username) => {
var member = await auth.checkMembership(username);
const member = await auth.checkMembership(username);
return member;
};

export const checkAdmin = async (authObject) => {
var isAdmin = await auth.checkAdmin(authObject);
const isAdmin = await auth.checkAdmin(authObject);
return isAdmin;
}

Loading

0 comments on commit 128be65

Please sign in to comment.