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

[Tech debt] Remove blog #105

Merged
merged 2 commits into from
Nov 10, 2024
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
10 changes: 0 additions & 10 deletions api/schema.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
import { CategoryResponse, DataAttributes } from '../types';
import { APIResponseBlog } from '../types/Blogs';
import { APIResponseEvent } from '../types/Events';
import { MemberResponse } from '../types/Members';
import { APIResponseSponsor } from '../types/Sponsors';

import { CustomFetch } from './useFetch';

const blogs = (customFetch: CustomFetch) =>
({
blogsList: async () => {
const res = await customFetch('CMS', 'blogs?populate=*');
return res.data as APIResponseBlog;
},
} as const);

const events = (customFetch: CustomFetch) =>
({
eventsList: async () => {
Expand All @@ -39,7 +30,6 @@ const sponsors = (customFetch: CustomFetch) =>

const config = (customFetch: CustomFetch) =>
({
...blogs(customFetch),
...events(customFetch),
...members(customFetch),
...sponsors(customFetch),
Expand Down
105 changes: 0 additions & 105 deletions components/Blogs/BlogHighlightSection.tsx

This file was deleted.

74 changes: 0 additions & 74 deletions components/Blogs/BlogListSection.tsx

This file was deleted.

12 changes: 1 addition & 11 deletions components/Common/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import Tabs from '@mui/material/Tabs';
import Typography from '@mui/material/Typography';

import Logo from '@public/MCSS.svg';
import { getAllBlogs } from '@store/blogSlice';
import { getAllEvents } from '@store/eventSlice';
import { useAppDispatch, useAppSelector } from '@store/hooks';
import { useIsMobile } from '@utils/hooks';
Expand Down Expand Up @@ -40,18 +39,15 @@ const NavBar: FC = () => {
const [showDrawer, setShowDrawer] = useState(false);
const router = useRouter();
const { events } = useAppSelector((state) => state.events);
const { blogs } = useAppSelector((state) => state.blogs);
const { data: sponsors } = useSponsors();
const links = [
{ label: 'Events', href: '/Events' },
{ label: 'Blogs', href: '/Blogs' },
{ label: 'Sponsors', href: '/Sponsors' },
];
const searchBarWhiteList = ['/Events', '/Blogs', '/Sponsors'];
const searchBarWhiteList = ['/Events', '/Sponsors'];
const partialRouteMatch = searchBarWhiteList.some((route) => router.pathname.includes(route));
const options = [
...Object.entries(events).map(([id, { title }]) => ({ label: `Event: ${title}`, value: id })),
...Object.entries(blogs).map(([id, { title }]) => ({ label: `Blog: ${title}`, value: id })),
...(sponsors?.data
? Object.entries(sponsors.data).map(([, { id, attributes }]) => ({
label: `Sponsors: ${attributes.title}`,
Expand All @@ -64,10 +60,6 @@ const NavBar: FC = () => {
if (_.isEmpty(events)) {
dispatch(getAllEvents());
}

if (_.isEmpty(blogs)) {
dispatch(getAllBlogs());
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

Expand Down Expand Up @@ -114,8 +106,6 @@ const NavBar: FC = () => {
setValue(selectedOption);
if (selectedOption?.label.includes('Event:')) {
router.push(`/Events/${selectedOption.value}`);
} else if (selectedOption?.label.includes('Blog:')) {
router.push(`/Blogs/${selectedOption.value}`);
} else if (selectedOption?.label.includes('Sponsors:')) {
router.push(`/Sponsors/${selectedOption.value}`);
}
Expand Down
2 changes: 0 additions & 2 deletions components/Events/EventHighlightSection.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { FC } from 'react';

import EventOutlinedIcon from '@mui/icons-material/EventOutlined';
import PersonOutlineOutlinedIcon from '@mui/icons-material/PersonOutlineOutlined';
import Button from '@mui/material/Button';

import MaterialCard from '@components/Common/MaterialCard';
import MediaQueryContainer from '@components/Common/MediaQueryContainer';
Expand Down
1 change: 0 additions & 1 deletion components/Events/EventListSection.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { FC } from 'react';

import EventOutlinedIcon from '@mui/icons-material/EventOutlined';
import PersonOutlineOutlinedIcon from '@mui/icons-material/PersonOutlineOutlined';

import MaterialCard from '@components/Common/MaterialCard';
import Tag from '@components/Common/Tag';
Expand Down
103 changes: 0 additions & 103 deletions components/Home/BlogsSection.tsx

This file was deleted.

1 change: 0 additions & 1 deletion components/Home/EventSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { FC } from 'react';

import ArrowForwardIcon from '@mui/icons-material/ArrowForward';
import EventOutlinedIcon from '@mui/icons-material/EventOutlined';
import PersonOutlineOutlinedIcon from '@mui/icons-material/PersonOutlineOutlined';
import Button from '@mui/material/Button';

import HorizontalSkeletonLoader from '@components/Common/HorizontalSkeletonLoader';
Expand Down
1 change: 0 additions & 1 deletion components/Sponsors/SponsorHighlightSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Button from '@mui/material/Button';
import MaterialCard from '@components/Common/MaterialCard';
import MediaQueryContainer from '@components/Common/MediaQueryContainer';
import Slider from '@components/Common/Slider';
import { formatDate } from '@utils/helper';
import useSponsors from 'hooks/useSponsors';
import Image from 'next/image';
import { useRouter } from 'next/router';
Expand Down
Loading
Loading