Skip to content

Commit

Permalink
Merge pull request #2519 from RJPalmer/work_2024_10_02
Browse files Browse the repository at this point in the history
feat(navbar): Created a subcategory Hacktoberfest under open-source c…
  • Loading branch information
rupali-codes authored Oct 12, 2024
2 parents 8e68328 + ed451f8 commit b55fc26
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 3 deletions.
11 changes: 10 additions & 1 deletion components/SideNavbar/SideNavbarCategory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const SideNavbarCategory: FC<{
listRef: MutableRefObject<HTMLUListElement | null>;
}> = ({ categoryData, expand, listRef }) => {
const [isOpen, setIsOpen] = useState(expand);
// const [hasUpdated, setHasUpdated] = useState(categoryData);
const router = useRouter();
const { category, subcategory } = categoryData;
const sortedSubcategoryList = subcategory
Expand All @@ -49,7 +50,8 @@ export const SideNavbarCategory: FC<{

useEffect(() => {
setIsOpen(expand);
}, [expand]);
// setHasUpdated(categoryData);
}, [expand, categoryData]);

const handleToggle = () => {
setIsOpen(!isOpen);
Expand All @@ -59,6 +61,12 @@ export const SideNavbarCategory: FC<{
setIsOpen(false);
router.replace('/');
};

// const handleUpdate = () => {
// setHasUpdated(!hasUpdated);
// handleUpdate();
// };

useOnClickOutside(listRef, handleClickOutside);

return (
Expand All @@ -74,6 +82,7 @@ export const SideNavbarCategory: FC<{
category.length < 4 ? 'uppercase' : 'capitalize'
}`}
>
{/* { category === 'open-source' ? '<strong>New' : capitalizeCategory(category)} */}
{capitalizeCategory(category)}
</h1>
<Icons.angleDown
Expand Down
3 changes: 1 addition & 2 deletions components/SideNavbar/SideNavbarCategoryList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ export const SideNavbarCategoryList: FC<{
listRef={listRef}
key={categoryData.category}
categoryData={categoryData}
expand={query.length > 0 || category === categoryData.category}
/>
expand={query.length > 0 || category === categoryData.category} />
))}
</ul>
)
Expand Down
2 changes: 2 additions & 0 deletions components/TopBar/CategoryDescriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions database/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions database/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
7 changes: 7 additions & 0 deletions database/open_source/hacktoberfest.json
Original file line number Diff line number Diff line change
@@ -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"
}]

0 comments on commit b55fc26

Please sign in to comment.