Skip to content

Commit 69e4e4e

Browse files
authored
[Tech debt] Remove blog (#105)
1 parent 31d5253 commit 69e4e4e

23 files changed

+4
-761
lines changed

api/schema.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
11
import { CategoryResponse, DataAttributes } from '../types';
2-
import { APIResponseBlog } from '../types/Blogs';
32
import { APIResponseEvent } from '../types/Events';
43
import { MemberResponse } from '../types/Members';
54
import { APIResponseSponsor } from '../types/Sponsors';
65

76
import { CustomFetch } from './useFetch';
87

9-
const blogs = (customFetch: CustomFetch) =>
10-
({
11-
blogsList: async () => {
12-
const res = await customFetch('CMS', 'blogs?populate=*');
13-
return res.data as APIResponseBlog;
14-
},
15-
} as const);
16-
178
const events = (customFetch: CustomFetch) =>
189
({
1910
eventsList: async () => {
@@ -39,7 +30,6 @@ const sponsors = (customFetch: CustomFetch) =>
3930

4031
const config = (customFetch: CustomFetch) =>
4132
({
42-
...blogs(customFetch),
4333
...events(customFetch),
4434
...members(customFetch),
4535
...sponsors(customFetch),

components/Blogs/BlogHighlightSection.tsx

Lines changed: 0 additions & 105 deletions
This file was deleted.

components/Blogs/BlogListSection.tsx

Lines changed: 0 additions & 74 deletions
This file was deleted.

components/Common/NavBar.tsx

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import Tabs from '@mui/material/Tabs';
1010
import Typography from '@mui/material/Typography';
1111

1212
import Logo from '@public/MCSS.svg';
13-
import { getAllBlogs } from '@store/blogSlice';
1413
import { getAllEvents } from '@store/eventSlice';
1514
import { useAppDispatch, useAppSelector } from '@store/hooks';
1615
import { useIsMobile } from '@utils/hooks';
@@ -40,18 +39,15 @@ const NavBar: FC = () => {
4039
const [showDrawer, setShowDrawer] = useState(false);
4140
const router = useRouter();
4241
const { events } = useAppSelector((state) => state.events);
43-
const { blogs } = useAppSelector((state) => state.blogs);
4442
const { data: sponsors } = useSponsors();
4543
const links = [
4644
{ label: 'Events', href: '/Events' },
47-
{ label: 'Blogs', href: '/Blogs' },
4845
{ label: 'Sponsors', href: '/Sponsors' },
4946
];
50-
const searchBarWhiteList = ['/Events', '/Blogs', '/Sponsors'];
47+
const searchBarWhiteList = ['/Events', '/Sponsors'];
5148
const partialRouteMatch = searchBarWhiteList.some((route) => router.pathname.includes(route));
5249
const options = [
5350
...Object.entries(events).map(([id, { title }]) => ({ label: `Event: ${title}`, value: id })),
54-
...Object.entries(blogs).map(([id, { title }]) => ({ label: `Blog: ${title}`, value: id })),
5551
...(sponsors?.data
5652
? Object.entries(sponsors.data).map(([, { id, attributes }]) => ({
5753
label: `Sponsors: ${attributes.title}`,
@@ -64,10 +60,6 @@ const NavBar: FC = () => {
6460
if (_.isEmpty(events)) {
6561
dispatch(getAllEvents());
6662
}
67-
68-
if (_.isEmpty(blogs)) {
69-
dispatch(getAllBlogs());
70-
}
7163
// eslint-disable-next-line react-hooks/exhaustive-deps
7264
}, []);
7365

@@ -114,8 +106,6 @@ const NavBar: FC = () => {
114106
setValue(selectedOption);
115107
if (selectedOption?.label.includes('Event:')) {
116108
router.push(`/Events/${selectedOption.value}`);
117-
} else if (selectedOption?.label.includes('Blog:')) {
118-
router.push(`/Blogs/${selectedOption.value}`);
119109
} else if (selectedOption?.label.includes('Sponsors:')) {
120110
router.push(`/Sponsors/${selectedOption.value}`);
121111
}

components/Events/EventHighlightSection.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { FC } from 'react';
22

33
import EventOutlinedIcon from '@mui/icons-material/EventOutlined';
4-
import PersonOutlineOutlinedIcon from '@mui/icons-material/PersonOutlineOutlined';
5-
import Button from '@mui/material/Button';
64

75
import MaterialCard from '@components/Common/MaterialCard';
86
import MediaQueryContainer from '@components/Common/MediaQueryContainer';

components/Events/EventListSection.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { FC } from 'react';
22

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

65
import MaterialCard from '@components/Common/MaterialCard';
76
import Tag from '@components/Common/Tag';

components/Home/BlogsSection.tsx

Lines changed: 0 additions & 103 deletions
This file was deleted.

components/Home/EventSection.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { FC } from 'react';
22

33
import ArrowForwardIcon from '@mui/icons-material/ArrowForward';
44
import EventOutlinedIcon from '@mui/icons-material/EventOutlined';
5-
import PersonOutlineOutlinedIcon from '@mui/icons-material/PersonOutlineOutlined';
65
import Button from '@mui/material/Button';
76

87
import HorizontalSkeletonLoader from '@components/Common/HorizontalSkeletonLoader';

components/Sponsors/SponsorHighlightSection.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import Button from '@mui/material/Button';
55
import MaterialCard from '@components/Common/MaterialCard';
66
import MediaQueryContainer from '@components/Common/MediaQueryContainer';
77
import Slider from '@components/Common/Slider';
8-
import { formatDate } from '@utils/helper';
98
import useSponsors from 'hooks/useSponsors';
109
import Image from 'next/image';
1110
import { useRouter } from 'next/router';

0 commit comments

Comments
 (0)