Skip to content

Commit

Permalink
feat: rebase with main (#474)
Browse files Browse the repository at this point in the history
* chore: update CC info 2023 (#451)

* feat(home): increase number of displayed articles on the home page (#453)

chore(home): increase display articles

* chore: delete repo docs (#455)

* chore: delete repo docs

* chore: format html templete

* fix(home): remove duplicate article in home page (#456)

* fix(photostory): optimise the state update in photostory (#444)

* fix(photostory): optimise the state update

* fix(photostory): update right side image in carousel

* chore: update sac info page (#467)

* fix: search bar (#460)

* fix: search bar

* fix: serach bar

* fix: search bar

---------

Co-authored-by: Anish Sarawgi <98693953+Anish-Sarawgi@users.noreply.github.com>
Co-authored-by: Dibendu Sahani <112952404+dibendusahani@users.noreply.github.com>
Co-authored-by: SUNNY KUMAR <123469525+SUNNYKUMAR1232@users.noreply.github.com>
  • Loading branch information
4 people authored Oct 15, 2023
1 parent d459c6c commit 25dbd2e
Show file tree
Hide file tree
Showing 34 changed files with 81 additions and 11,360 deletions.
7 changes: 4 additions & 3 deletions client/public/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,12 @@
as="style"
onload="this.onload=null;this.rel='stylesheet'"
/>
<noscript
><link
<noscript>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css"
/></noscript>
/>
</noscript>
<style>
.wrapper {
width: 100vw;
Expand Down
6 changes: 3 additions & 3 deletions client/src/assets/placeholder/contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ export const DETAILS = Object.freeze({
],
cc_title: 'Chief Coordinators:',
CCs: [
{ name: 'Rashmi Ranjan Samantaray', number: '9556074595' },
{ name: 'Rishika Shah', number: '9667521704' },
{ name: 'Sunil Urmal', number: '9938287481' },
{ name: 'Arpan Vihan', number: '6398454922' },
{ name: 'Aditya Bharambe', number: '7039267530' },
{ name: 'Preeti Priyadarshini', number: '7656980495' },
],
socialMedia: {
title: 'Social Media Handles',
Expand Down
8 changes: 5 additions & 3 deletions client/src/components/marginals/DesktopNavbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,9 @@ const useStyles = makeStyles((theme) => ({
searchField: {
width: '100%',
color: theme.palette.primary.blue50,
paddingBottom: '0px',
'& input': {
paddingLeft: '20px',
},
},
trendingArticles: {
position: 'absoulte',
Expand All @@ -304,18 +306,18 @@ const useStyles = makeStyles((theme) => ({
position: 'absolute',
background: '#FEFEFF',
width: '100%',
padding: '20px',
zIndex: '20022',
borderRadius: '0px 0px 5px 5px',
border: '1px #ECEDEC',
borderStyle: 'none solid solid',
boxShadow: '0px 0px 5px grey',
display: (_) => (_.isSearchActive ? 'block' : 'none'),
paddingLeft: '20px',
},
trendingList: {
fontFamily: theme.typography.fontFamily,
alignItems: 'center',
paddingBottom: '8px',
paddingBottom: '12px',
paddingTop: '8px',
cursor: 'pointer',
},
Expand Down
8 changes: 5 additions & 3 deletions client/src/components/marginals/MobileNavbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,9 @@ const useStyles = makeStyles((theme) => ({
searchField: {
width: '100%',
color: theme.palette.primary.blue50,
paddingBottom: '0px',
'& input': {
paddingLeft: '20px',
},
},
trendingArticles: {
position: 'absoulte',
Expand All @@ -301,18 +303,18 @@ const useStyles = makeStyles((theme) => ({
position: 'absolute',
background: '#FEFEFF',
width: '100%',
padding: '20px',
zIndex: '20022',
borderRadius: '0px 0px 5px 5px',
border: '1px #ECEDEC',
borderStyle: 'none solid solid',
boxShadow: '0px 0px 5px grey',
display: (_) => (_.isSearchActive ? 'block' : 'none'),
paddingLeft: '20px',
},
trendingList: {
fontFamily: theme.typography.fontFamily,
alignItems: 'center',
paddingBottom: '8px',
paddingBottom: '12px',
paddingTop: '8px',
cursor: 'pointer',
},
Expand Down
8 changes: 2 additions & 6 deletions client/src/components/photostory/Carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,15 @@ const Carousel = ({ content }) => {
const classes = useStyles();
const length = content.length;

const [left, setLeft] = useState(length - 1);
const [current, setCurrent] = useState(0);
const [right, setRight] = useState(1);
const left = current === 0 ? length - 1 : current - 1;
const right = current === length - 1 ? 0 : current + 1;

const nextSlide = () => {
setLeft(left === length - 1 ? 0 : left + 1);
setCurrent(current === length - 1 ? 0 : current + 1);
setRight(right === length - 1 ? 0 : right + 1);
};
const prevSlide = () => {
setLeft(left === 0 ? length - 1 : left - 1);
setCurrent(current === 0 ? length - 1 : current - 1);
setRight(right === 0 ? length - 1 : right - 1);
};

if (!Array.isArray(content) || content.length <= 0) {
Expand Down
26 changes: 13 additions & 13 deletions client/src/components/widgets/SacInfoNavbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import SocietyCards from './SocietyCards';

const STAGE = {
DSW: 'Dean SW',
SP: 'Sac President',
SP: 'SAC President',
SOB: 'SAC Office Bearers',
};

Expand All @@ -28,17 +28,17 @@ const POSTS = {
},
{
position: 'Vice President',
name: 'Dr. Balaji P.S.',
phone: '0661-2462528',
email: 'psbalaji@nitrkl.ac.in',
name: 'Prof. Kumud Kant Mehta',
phone: '9492573480',
email: 'mehtakk@nitrkl.ac.in',
},
],
LCS: [
{
position: 'Vice President',
name: 'Dr. Akshaya Kumar Rath',
phone: '0661-2462697',
email: 'ratha@nitrkl.ac.in',
name: 'Prof. Sivaraman J.',
phone: '9492573480',
email: 'jsiva@nitrkl.ac.in',
},
{
position: 'Vice President',
Expand Down Expand Up @@ -70,9 +70,9 @@ const POSTS = {
},
{
position: 'Vice President',
name: 'Dr. Prasun Chongder',
phone: '',
email: 'chongderp@nitrkl.ac.in',
name: 'Prof. Tirthankar Sarkar',
phone: '9547960987',
email: 'sarkart@nitrkl.ac.in',
},
],
};
Expand All @@ -98,9 +98,9 @@ const SacInfoNavbar = () => {
return (
<>
<PostHolders
position='Sac President'
name='Prof. Poonam Singh'
email='psingh@nitrkl.ac.in'
position='SAC President'
name='Prof. Rajeev Kumar Panda'
email='rkpanda@nitrkl.ac.in'
/>
</>
);
Expand Down
23 changes: 11 additions & 12 deletions client/src/pages/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ export async function getStaticProps({ preview }) {
data: { getLatestIssues: issues },
} = await graphClient.query({
query: getLatestIssues,
variables: { limit: 2 },
variables: { limit: 4 },
});

if (!issues || issues.length !== 2) {
if (!issues) {
return {
redirect: {
destination: '/error/internal-server-error',
Expand Down Expand Up @@ -222,23 +222,22 @@ export async function getStaticProps({ preview }) {
variables: { categoryNumbers: 62, limit: 1 },
});

const youtubeResponse = await fetch(
`https://youtube.googleapis.com/youtube/v3/playlistItems?part=snippet%2CcontentDetails&maxResults=25&playlistId=${process.env.YOUTUBE_PLAYLIST_ID}&key=${process.env.YOUTUBE_API_KEY}`,
);
const youtubeData = await youtubeResponse?.json();
const youtubeLinks =
youtubeData?.items?.map(
(item) =>
'https://www.youtube.com/embed/' + item.snippet.resourceId.videoId,
) ?? [];
// const youtubeResponse = await fetch(
// `https://youtube.googleapis.com/youtube/v3/playlistItems?part=snippet%2CcontentDetails&maxResults=25&playlistId=${process.env.YOUTUBE_PLAYLIST_ID}&key=${process.env.YOUTUBE_API_KEY}`,
// );
// const youtubeData = await youtubeResponse.json();
// const youtubeLinks = youtubeData.items.map(
// (item) =>
// 'https://www.youtube.com/embed/' + item.snippet.resourceId.videoId,
// );

return {
props: {
issues,
squiggles,
witsdom,
photostory,
youtubeLinks,
// youtubeLinks,
},
revalidate:
preview || new Date(Date.now()).getDay() < 3
Expand Down
75 changes: 38 additions & 37 deletions client/src/screens/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import ArticleCardStack from '../components/widgets/article/ArticleCardStack';
// import Calendar from '../components/homepage/Calendar';
import Banner from '../components/homepage/Banner';
import Trending from '../components/homepage/Trending';
import SocialMedia from '../components/homepage/SocialMedia';
// import SocialMedia from '../components/homepage/SocialMedia';
import ArticleGrid from '../components/widgets/article/ArticleGrid';

function Home({ issues, squiggles, witsdom, photostory, youtubeLinks }) {
Expand Down Expand Up @@ -39,18 +39,18 @@ function Home({ issues, squiggles, witsdom, photostory, youtubeLinks }) {
);
}

const articles = [
...latestIssue.articles.filter(
(item1) =>
item1 !== null &&
!featuredArticles.some((item2) => item1?.id === item2?.id),
),
...secondLatestIssue.articles.filter(
(item1) =>
item1 !== null &&
!featuredArticles.some((item2) => item1?.id === item2?.id),
),
];
const articles = [].concat(
...issues.map((issue) => {
return issue.articles.filter((article) => {
return (
article !== null &&
!featuredArticles.some(
(featuredArticle) => featuredArticle.id === article.id,
)
);
});
}),
);

const numberOfStacks = Math.floor(articles.length / (!tabletMatches ? 3 : 4));

Expand All @@ -59,40 +59,41 @@ function Home({ issues, squiggles, witsdom, photostory, youtubeLinks }) {
<Container>
<ArticleGrid articles={featuredArticles} />
<Squiggles data={squiggles} />
<>

<ArticleCardStack
articleList={articles.slice(0, !tabletMatches ? 3 : 4)}
title='This Issue'
/>
{articles.length >= (!tabletMatches ? 6 : 8) && (
<ArticleCardStack
articleList={articles.slice(0, !tabletMatches ? 3 : 4)}
title='This Issue'
articleList={
!tabletMatches ? articles.slice(3, 6) : articles.slice(4, 8)
}
/>
{articles.length >= (!tabletMatches ? 6 : 8) && (
<ArticleCardStack
articleList={
!tabletMatches ? articles.slice(3, 6) : articles.slice(4, 8)
}
/>
)}
{/* <Grid container spacing={4} style={{ marginTop: 25 }}>
)}
</Container>
{/* <Grid container spacing={4} style={{ marginTop: 25 }}>
<Grid item sm={8}>
<Pulse />
</Grid>
<Grid item sm={4}>
<Calendar />
</Grid>
</Grid> */}
{Array.from(Array(numberOfStacks).keys())
.slice(2)
.map((index) => (
<ArticleCardStack
key={`home-article-card-stack-${index}`}
articleList={articles.slice(
!tabletMatches ? 3 * index : 4 * index,
!tabletMatches ? 3 * (index + 1) : 4 * (index + 1),
)}
/>
))}
</>
</Container>
<Banner photostory={photostory} witsdom={witsdom} />
<Container>
{Array.from(Array(numberOfStacks).keys())
.slice(2)
.map((index) => (
<ArticleCardStack
key={index}
articleList={articles.slice(
!tabletMatches ? 3 * index : 4 * index,
!tabletMatches ? 3 * (index + 1) : 4 * (index + 1),
)}
/>
))}
</Container>
<Container>
{/* <div style={{ marginTop: 35 }}> */}
{/* <SocialMedia youtubeLinks={youtubeLinks} /> */}
Expand Down
20 changes: 0 additions & 20 deletions docs/.gitignore

This file was deleted.

33 changes: 0 additions & 33 deletions docs/README.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/babel.config.js

This file was deleted.

11 changes: 0 additions & 11 deletions docs/blog/2019-05-28-hola.md

This file was deleted.

Loading

0 comments on commit 25dbd2e

Please sign in to comment.