Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add social media icons #329

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
7f7f8ff
1 call to api for full name
erwok Apr 19, 2022
8941f1c
Merge branch 'master' of https://github.com/HKN-UCSD/hkn-server into …
erwok Aug 28, 2022
ac73a76
Add social media icons to NavBar
erwok Aug 29, 2022
6306e02
Revert "1 call to api for full name"
erwok Aug 29, 2022
c4b68b7
removed typeorm
kyle1373 Sep 8, 2022
45dcf4a
fixed typeorm version
kyle1373 Sep 8, 2022
5a23f67
trying typeorm 0.3.6
kyle1373 Sep 8, 2022
112c4cd
fixed typeorm and types/node for tests
kyle1373 Sep 8, 2022
e748125
fixed all type dependencies
kyle1373 Sep 8, 2022
5c8e250
fixed ALL type dependencies to check tests
kyle1373 Sep 8, 2022
c941660
increased type/node version
kyle1373 Sep 8, 2022
e9779b7
pin pg version.
godwinpang Sep 20, 2022
9acf4c3
forgot to update package lock.
godwinpang Sep 20, 2022
559f982
Pinned all backend dependencies to determine test
kyle1373 Sep 26, 2022
8843042
Unpinned types/express
kyle1373 Sep 26, 2022
39b05c6
unpinned prettier
kyle1373 Sep 26, 2022
6b678c2
Downgraded node version
kyle1373 Sep 26, 2022
2186a61
logging and remove npe
godwinpang Oct 3, 2022
c13814d
Revert "Downgraded node version"
erwok Oct 14, 2022
ec85bc8
Revert "unpinned prettier"
erwok Oct 14, 2022
a8beb8e
Revert "Unpinned types/express"
erwok Oct 14, 2022
e8a8881
Revert "Pinned all backend dependencies to determine test"
erwok Oct 14, 2022
d05394e
Revert "forgot to update package lock."
erwok Oct 14, 2022
cc9cf7c
Revert "pin pg version."
erwok Oct 14, 2022
d8e3449
Revert "increased type/node version"
erwok Oct 14, 2022
c784a77
Revert "fixed ALL type dependencies to check tests"
erwok Oct 14, 2022
7b453c5
Revert "fixed all type dependencies"
erwok Oct 14, 2022
8923110
Revert "fixed typeorm and types/node for tests"
erwok Oct 14, 2022
c6600a7
Revert "trying typeorm 0.3.6"
erwok Oct 14, 2022
7d349d0
Revert "fixed typeorm version"
erwok Oct 14, 2022
3c6386b
Revert "removed typeorm"
erwok Oct 14, 2022
85df279
Move event controller test to legacy folder
erwok Oct 15, 2022
9b83632
Added Kyle suggestions
erwok Nov 3, 2022
60a938e
Merge branch 'master' into add_social_media_icons
erwok Nov 3, 2022
7986095
Fixing event controller test formatting
kyle1373 Nov 12, 2022
f7b346f
Merge branch 'master' into add_social_media_icons
kyle1373 Nov 23, 2022
eb96ae5
Revert "Merge branch 'master' into add_social_media_icons"
kyle1373 Nov 23, 2022
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
13,174 changes: 40 additions & 13,134 deletions backend/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
"pre-commit": "npx lint-staged"
}
},
"lint-staged": {
Expand Down
9,045 changes: 1,709 additions & 7,336 deletions frontend/package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@material-ui/lab": "^4.0.0-alpha.56",
"@material-ui/pickers": "^3.2.10",
"@material/layout-grid": "^0.41.0",
"@storybook/react": "^6.5.13",
"@storybook/react": "^6.3.3",
"@types/react": "^16.9.46",
"@types/react-dom": "^16.9.8",
"@types/react-router": "^5.1.8",
Expand Down Expand Up @@ -73,8 +73,8 @@
"@babel/core": "^7.11.1",
"@openapitools/openapi-generator-cli": "^1.0.15-5.0.0-beta",
"@storybook/addon-actions": "^6.0.13",
"@storybook/addon-docs": "^6.5.13",
"@storybook/addon-essentials": "^6.5.13",
"@storybook/addon-docs": "^6.3.3",
"@storybook/addon-essentials": "^6.3.3",
"@storybook/addon-links": "^6.0.13",
"@storybook/node-logger": "^6.0.13",
"@storybook/preset-create-react-app": "^3.1.4",
Expand All @@ -101,4 +101,4 @@
"pre-commit": "lint-staged"
}
}
}
}
58 changes: 0 additions & 58 deletions frontend/src/components/HomepageBanner/index.tsx

This file was deleted.

10 changes: 10 additions & 0 deletions frontend/src/components/NavBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ import {
DialogContentText,
DialogTitle,
Hidden,
Container,
} from '@material-ui/core';
import SignOutIcon from '@material-ui/icons/ExitToApp';
import MenuIcon from '@material-ui/icons/Menu';

import { OfficerTabs, InducteeTabs } from './tabs';
import { SocialButtons } from './socialButtons';
import styles from './styles';

import { UserContext } from '@Contexts';
Expand Down Expand Up @@ -81,6 +83,11 @@ class NavBar extends React.Component {
<ListItemText primary={tab.text} />
</ListItem>
));
const socialComponents = SocialButtons.map(social => (
<ListItem button component={Link} to={{ pathname: social.pathname }} target={social.target} className={classes.socialButton}>
<ListItemIcon className={classes.socialIcon}>{social.icon}</ListItemIcon>
</ListItem>
));

const drawer = (
<>
Expand All @@ -94,6 +101,9 @@ class NavBar extends React.Component {
<ListItemText primary='Logout' />
</ListItem>
</List>
<Container className={classes.socialContainer}>
<List className={classes.socialSection}>{socialComponents}</List>
</Container>

<Dialog
open={isConfirmationModalOpen}
Expand Down
37 changes: 37 additions & 0 deletions frontend/src/components/NavBar/socialButtons.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import React from 'react';
import LanguageIcon from '@material-ui/icons/Language';
import InstagramIcon from '@material-ui/icons/Instagram';
import FacebookIcon from '@material-ui/icons/Facebook';
import LinkedInIcon from '@material-ui/icons/LinkedIn';

const WebsiteButton = {
pathname: "https://hkn.ucsd.edu/",
icon: <LanguageIcon fontSize='inherit' />,
target: "_blank"
}

const FacebookButton = {
pathname: "https://www.facebook.com/hknucsd",
icon: <FacebookIcon fontSize='inherit' />,
target: "_blank"
}

const InstagramButton = {
pathname: "https://www.instagram.com/hkn_ucsd/",
icon: <InstagramIcon fontSize='inherit' />,
target: "_blank"
}

const LinkedInButton = {
pathname: "https://www.linkedin.com/company/hkn-ucsd/about/",
icon: <LinkedInIcon fontSize='inherit' />,
target: "_blank"
}


export const SocialButtons = [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's not actually exporting a Button element, it may be clearer to rename it to Info or Link instead of button, same for other instances and file name.

WebsiteButton,
FacebookButton,
InstagramButton,
LinkedInButton
];
27 changes: 27 additions & 0 deletions frontend/src/components/NavBar/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,33 @@ const styles = theme => ({
h5: {
marginBottom: theme.spacing(2),
},
socialContainer: {
width: '90%',
display: 'flex',
flexDirection: 'column-reverse',
height: '100%',
borderCollapse: 'collapse',
paddingLeft: '0',
},
socialSection: {
display: 'flex',
justifyContent: 'space-inbetween',
alignItems: 'center',
margin: '0 0 20px 0',
padding: '0'
},
socialButton: {
width: '25%',
margin: '0 3px 0 3px',
padding: '0',
fontSize: '2rem',
display: 'flex',
justifyContent: 'center'
},
socialIcon: {
display: 'flex',
justifyContent: 'center',
},
});

export default styles;
Binary file removed frontend/src/images/hkn-logo-white 2.png
Binary file not shown.
Binary file removed frontend/src/images/hkn-logo-white.png
Binary file not shown.
8 changes: 4 additions & 4 deletions frontend/src/pages/EventsPage/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import { withStyles } from '@material-ui/core/styles';
import { compose } from 'recompose';

import { HomepageBanner } from '@SharedComponents/HomepageBanner';
import { Divider } from '@material-ui/core';

import EventButtons from './eventButtons';

Expand Down Expand Up @@ -97,13 +96,14 @@ class EventsPage extends React.Component {
const { classes } = this.props;
return (
<div>
<HomepageBanner />
<div style={{ margin: '20px' }}>
{MemberRenderPermission(EventButtons)({})}
</div>

<div>
<div className={classes.contentWrapper}>
<Divider />
<h1 style={{ textAlign: 'center' }}>Upcoming Events</h1>
<Divider />
</div>
<div className={classes.root}>
<iframe
Expand Down
1 change: 0 additions & 1 deletion frontend/src/pages/InducteePointsPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { Table } from '@SharedComponents';
import { getAllInducteePoints, InducteePoint } from '@Services/PointsService';

const columns = [
{ title: 'Name', field: 'name' },
{ title: 'Email', field: 'email' },
{ title: 'Total Points', field: 'points' },
{
Expand Down
11 changes: 2 additions & 9 deletions frontend/src/services/PointsService.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { PointsApi } from './api/apis/PointsApi';
import ApiConfigStore from './ApiConfigStore';
import { InducteePointsResponse } from './api';
import { getUserById } from './UserService';

// nit: bad naming
export interface InducteePoint {
user: number;
name: string;
email: string;
points: number;
hasProfessionalRequirement: string;
Expand All @@ -21,9 +19,7 @@ export async function getAllInducteePoints(): Promise<InducteePoint[]> {
const pointsApi: PointsApi = new PointsApi(apiConfig);

const points = await pointsApi.pointsControllerGetAllInducteePoints();

const inducteePointsList = await Promise.all(points.inducteePoints.map(async (point: InducteePointsResponse) => {
const userAcc = await getUserById(point.user);
return points.inducteePoints.map((point: InducteePointsResponse) => {
return {
points: point.points,
user: point.user,
Expand All @@ -40,9 +36,6 @@ export async function getAllInducteePoints(): Promise<InducteePoint[]> {
hasSocialRequirement: point.hasSocialRequirement
? 'Complete'
: 'Incomplete',

name: userAcc.firstName + " " + userAcc.lastName,
} as InducteePoint;
}));
return inducteePointsList;
});
}
56 changes: 28 additions & 28 deletions frontend/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"noImplicitAny": false,
"jsx": "react",
"baseUrl": "."
},
"include": [
"src"
],
"extends": "./tsconfig.paths.json"
}
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"noImplicitAny": false,
"jsx": "react",
"baseUrl": "."
},
"include": [
"src"
],
"extends": "./tsconfig.paths.json"
}
3 changes: 0 additions & 3 deletions package-lock.json

This file was deleted.