diff --git a/components/SideNavbar/SideNavbarCategory.tsx b/components/SideNavbar/SideNavbarCategory.tsx index 605b50126..48dea0fae 100644 --- a/components/SideNavbar/SideNavbarCategory.tsx +++ b/components/SideNavbar/SideNavbarCategory.tsx @@ -37,6 +37,7 @@ export const SideNavbarCategory: FC<{ listRef: MutableRefObject; }> = ({ categoryData, expand, listRef }) => { const [isOpen, setIsOpen] = useState(expand); + // const [hasUpdated, setHasUpdated] = useState(categoryData); const router = useRouter(); const { category, subcategory } = categoryData; const sortedSubcategoryList = subcategory @@ -49,7 +50,8 @@ export const SideNavbarCategory: FC<{ useEffect(() => { setIsOpen(expand); - }, [expand]); + // setHasUpdated(categoryData); + }, [expand, categoryData]); const handleToggle = () => { setIsOpen(!isOpen); @@ -59,6 +61,12 @@ export const SideNavbarCategory: FC<{ setIsOpen(false); router.replace('/'); }; + + // const handleUpdate = () => { + // setHasUpdated(!hasUpdated); + // handleUpdate(); + // }; + useOnClickOutside(listRef, handleClickOutside); return ( @@ -74,6 +82,7 @@ export const SideNavbarCategory: FC<{ category.length < 4 ? 'uppercase' : 'capitalize' }`} > + {/* { category === 'open-source' ? 'New' : capitalizeCategory(category)} */} {capitalizeCategory(category)} 0 || category === categoryData.category} - /> + expand={query.length > 0 || category === categoryData.category} /> ))} ) diff --git a/components/TopBar/CategoryDescriptions.ts b/components/TopBar/CategoryDescriptions.ts index a4fca52aa..2191e4210 100644 --- a/components/TopBar/CategoryDescriptions.ts +++ b/components/TopBar/CategoryDescriptions.ts @@ -106,6 +106,8 @@ const categoryDescriptions: CategoryDescriptions = { // Open-source articles: 'There are many open source blogging platforms available for developers. Some of the most popular ones include WordPress, Joomla, and Drupal1. Other open source blogging platforms include Ghost, Serendipity, SilverStripe, and Jekyll', + hacktoberfest: + 'A month-long celebration of open-source projects, their maintainers, and the entire community of contributors.', projects: 'Anyone can contribute to the projects are called OpenSource Projects. There are many open source projects available for developers. Some of the most popular ones include Linux, Git, and Apache1. Other open source projects include Kubernetes, TensorFlow, and React Native', tools: diff --git a/database/data.ts b/database/data.ts index f4e2bd466..2580ecd16 100644 --- a/database/data.ts +++ b/database/data.ts @@ -136,6 +136,11 @@ export const sidebarData: ISidebar[] = [ url: '/articles', resources: DB.openSourceArticles, }, + { + name: 'Hacktoberfest', + url: '/hacktoberfest', + resources: DB.openSourceHacktoberfest, + }, { name: 'Programs', url: '/os_programs', diff --git a/database/index.ts b/database/index.ts index 149fb0b47..4085e3bf8 100644 --- a/database/index.ts +++ b/database/index.ts @@ -90,6 +90,7 @@ export { default as tensorflow } from './ai_tools/tensorflow.json' // Open-source export { default as openSourceArticles } from './open_source/articles.json' +export { default as openSourceHacktoberfest} from './open_source/hacktoberfest.json' export { default as openSourcePrograms } from './open_source/os_programs.json' export { default as openSourceProjects } from './open_source/projects.json' export { default as openSourceTools } from './open_source/tools.json' diff --git a/database/open_source/hacktoberfest.json b/database/open_source/hacktoberfest.json new file mode 100644 index 000000000..04180383a --- /dev/null +++ b/database/open_source/hacktoberfest.json @@ -0,0 +1,7 @@ +[{ + "name": "Hacktoberfest Official Site", + "description": "Hacktoberfest: a month-long celebration of open-source projects, their maintainers, and the entire community of contributors.", + "url": "https://hacktoberfest.com/", + "category": "open-source", + "subcategory": "hacktoberfest" +}] \ No newline at end of file