From 23a1cbc55117753f0ea5618899084f0de5ad5942 Mon Sep 17 00:00:00 2001 From: Ashish Padhy <100484401+Shurtu-gal@users.noreply.github.com> Date: Mon, 30 Jan 2023 18:17:19 +0530 Subject: [PATCH] fix: add sac posts (#409) --- client/src/components/guide/Options.js | 19 ++- client/src/components/widgets/PostHolder.js | 41 ++++-- .../src/components/widgets/SacInfoNavbar.js | 133 +++++++++++++----- client/src/components/widgets/SocietyCards.js | 31 ++-- client/src/screens/Sac.js | 14 +- 5 files changed, 159 insertions(+), 79 deletions(-) diff --git a/client/src/components/guide/Options.js b/client/src/components/guide/Options.js index 380b21dc..4409fba6 100644 --- a/client/src/components/guide/Options.js +++ b/client/src/components/guide/Options.js @@ -1,25 +1,22 @@ import React from 'react'; + +import Image from 'next/image'; import Link from 'next/link'; -import makeStyles from '@mui/styles/makeStyles'; -import { Typography, Grid, Button } from '@mui/material'; import DownloadIcon from '@mui/icons-material/Download'; - -// placeholder -import { OPTIONS } from '../../assets/placeholder/guide'; +import { Button, Grid, Typography } from '@mui/material'; +import makeStyles from '@mui/styles/makeStyles'; // images import icon1 from '../../assets/images/guide/optIcon1.png'; import icon2 from '../../assets/images/guide/optIcon2.png'; -import icon3 from '../../assets/images/guide/optIcon3.png'; import icon4 from '../../assets/images/guide/optIcon4.png'; - -// components -import SubCategories from '../widgets/SubCategory'; - +// placeholder +import { OPTIONS } from '../../assets/placeholder/guide'; // theme import theme from '../../config/themes/light'; -import Image from 'next/image'; +// components +import SubCategories from '../widgets/SubCategory'; const Options = () => { const classes = useStyles(theme); diff --git a/client/src/components/widgets/PostHolder.js b/client/src/components/widgets/PostHolder.js index f5bd66d1..ea6f4c60 100644 --- a/client/src/components/widgets/PostHolder.js +++ b/client/src/components/widgets/PostHolder.js @@ -1,11 +1,10 @@ import React from 'react'; -import { Typography, Grid } from '@mui/material'; -import makeStyles from '@mui/styles/makeStyles'; - import { PhoneOutlined } from '@mui/icons-material'; +import { Grid, Typography } from '@mui/material'; +import makeStyles from '@mui/styles/makeStyles'; -const PostHolders = () => { +const PostHolders = ({ position, name, email, phone }) => { const classes = useStyles(); return ( { alignItems='flex-start' > - Second year + {position} - - name: Anish Patro + + {name} - Roll: 121CE0877 + Email:- {email} -
- - - 9999999999 - -
+ {phone ? ( +
+ + + {phone} + +
+ ) : ( + <> + )}
); }; @@ -39,9 +42,10 @@ const useStyles = makeStyles((theme) => ({ position: { color: theme.palette.secondary.neutral80, fontFamily: 'Source Sans Pro', - fontSize: '16px', + fontSize: '20px', marginBottom: '5px', marginTop: '5px', + fontWeight: '600', }, holderDetails: { fontFamily: theme.typography.fontFamily, @@ -49,6 +53,13 @@ const useStyles = makeStyles((theme) => ({ color: '#000', marginBottom: '5px', }, + name: { + fontFamily: theme.typography.fontFamily, + fontSize: '20px', + color: '#000', + marginBottom: '5px', + fontWeight: '600', + }, phoneDetails: { display: 'flex', flexDirection: 'row', diff --git a/client/src/components/widgets/SacInfoNavbar.js b/client/src/components/widgets/SacInfoNavbar.js index df502731..0508a2f2 100644 --- a/client/src/components/widgets/SacInfoNavbar.js +++ b/client/src/components/widgets/SacInfoNavbar.js @@ -1,72 +1,137 @@ import React, { useState } from 'react'; + import { ButtonBase, Container, Typography, useMediaQuery, } from '@mui/material'; -import theme from '../../config/themes/light'; - import makeStyles from '@mui/styles/makeStyles'; + +import theme from '../../config/themes/light'; +import PostHolders from './PostHolder'; import SocietyCards from './SocietyCards'; const STAGE = { + DSW: 'Dean SW', + SP: 'Sac President', SOB: 'SAC Office Bearers', - DNF: 'Dean’s Nominee for Fests', - DNS: 'Dean’s Nominee for societies', - FC: 'Fest Convenors', +}; + +const POSTS = { + FMS: [ + { + position: 'Vice President', + name: 'Prof. Binod Bihari Sahu', + phone: '0661-2462782', + email: 'sahub@nitrkl.ac.in', + }, + { + position: 'Vice President', + name: 'Dr. Balaji P.S.', + phone: '0661-2462528', + email: 'psbalaji@nitrkl.ac.in', + }, + ], + LCS: [ + { + position: 'Vice President', + name: 'Dr. Akshaya Kumar Rath', + phone: '0661-2462697', + email: 'ratha@nitrkl.ac.in', + }, + { + position: 'Vice President', + name: 'Dr. Winny Routray', + phone: '', + email: 'routrayw@nitrkl.ac.in', + }, + ], + GSS: [ + { + position: 'Vice President', + name: 'Prof. Ramesh Kumar Mohapatra', + phone: '0661-2462366', + email: 'mohapatrark@nitrkl.ac.in', + }, + { + position: 'Vice President', + name: 'Dr. Mayank Yadav', + phone: '', + email: 'yadavm@nitrkl.ac.in', + }, + ], + TS: [ + { + position: 'Vice President', + name: 'Dr. Kaustav Chaudhury', + phone: '0661-2462535 ', + email: 'chaudhuryk@nitrkl.ac.in', + }, + { + position: 'Vice President', + name: 'Dr. Prasun Chongder', + phone: '', + email: 'chongderp@nitrkl.ac.in', + }, + ], }; const SacInfoNavbar = () => { - const [stage, setStage] = useState(STAGE.SOB); + const [stage, setStage] = useState(STAGE.DSW); const classes = useStyles(); const matches = useMediaQuery(theme.breakpoints.down('md')); const renderTeam = () => { switch (stage) { - case STAGE.SOB: + case STAGE.DSW: return ( <> - - {' '} - - {' '} + ); - case STAGE.DNF: + case STAGE.SP: return ( <> - - - - {' '} + ); - case STAGE.DNS: - return ( - <> - - {' '} - - {' '} - - ); - case STAGE.FC: + case STAGE.SOB: return ( <> - - {' '} - - {' '} + + {' '} + + {' '} ); default: return ( <> - - {' '} - - {' '} + + {' '} + + {' '} ); } diff --git a/client/src/components/widgets/SocietyCards.js b/client/src/components/widgets/SocietyCards.js index bf50534f..31ae15e5 100644 --- a/client/src/components/widgets/SocietyCards.js +++ b/client/src/components/widgets/SocietyCards.js @@ -1,19 +1,21 @@ import React, { useState } from 'react'; import clsx from 'clsx'; + +import { ExpandMore } from '@mui/icons-material'; import { - Typography, Card, CardActions, - IconButton, - Collapse, CardContent, + Collapse, + IconButton, + Typography, } from '@mui/material'; import makeStyles from '@mui/styles/makeStyles'; -import { ExpandMore } from '@mui/icons-material'; -import PostHolders from '../widgets/PostHolder'; -const SocietyCards = ({ society }) => { +import PostHolders from './PostHolder'; + +const SocietyCards = ({ society, posts }) => { const classes = useStyles(); const [expanded, setExpanded] = useState(false); @@ -37,14 +39,19 @@ const SocietyCards = ({ society }) => { {society} - {/* + - - - - + {posts?.map(({ position, name, email, phone }) => ( + + ))} - */} + ); }; diff --git a/client/src/screens/Sac.js b/client/src/screens/Sac.js index 5be1e976..dcd17d24 100644 --- a/client/src/screens/Sac.js +++ b/client/src/screens/Sac.js @@ -1,13 +1,13 @@ import React from 'react'; -import { Container, Typography } from '@mui/material'; -import BackButton from '../components/shared/button/BackButton'; -import makeStyles from '@mui/styles/makeStyles'; import Image from 'next/dist/client/image'; +import { Container, Typography } from '@mui/material'; +import makeStyles from '@mui/styles/makeStyles'; + // images import SACimagexs from '../assets/images/contact/sac2.png'; - +import BackButton from '../components/shared/button/BackButton'; // import import ClubInfoNavbar from '../components/widgets/ClubInfoNavbar'; import SacInfoNavbar from '../components/widgets/SacInfoNavbar'; @@ -49,13 +49,13 @@ const SacAndClub = () => { - {/*
+
SAC Info
-
*/} - {/* */} +
+
Club Info