Skip to content

Commit

Permalink
Merge branch 'main' into level
Browse files Browse the repository at this point in the history
  • Loading branch information
S-ishita authored Aug 10, 2023
2 parents 7a9ce09 + 4f6ab99 commit ecfaaf9
Show file tree
Hide file tree
Showing 17 changed files with 284 additions and 89 deletions.
7 changes: 6 additions & 1 deletion components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import { GlobalContext } from 'context/GlobalContext'
import { ThemeToggler } from '../ThemeToggler/themeToggler'
import { TopBar } from '../TopBar/TopBar'
import { SocialMediaIconsList } from 'components/SocialMedia/SocialMediaIconsList'
import { useResults } from 'hooks/ResultsContext'

export const Header: FC = () => {
const { toggleNav } = useContext(GlobalContext)
const { results } = useResults()

return (
<header className="fixed top-0 left-0 z-30 row-start-1 row-end-2 flex h-[76px] w-screen items-center justify-between bg-light-primary dark:bg-dark">
Expand All @@ -18,7 +20,10 @@ export const Header: FC = () => {
</Link>
</div>
<div className="bg-light-primary relative h-full grow px-8 dark:bg-dark lg:dark:bg-dark-primary">
<TopBar className="absolute left-8 hidden h-full md:flex" />
<TopBar
className="absolute left-8 hidden h-full md:flex"
results={results}
/>
<div className="absolute right-8 flex h-full gap-4">
<SocialMediaIconsList className="hidden lg:flex" />
<ThemeToggler />
Expand Down
117 changes: 93 additions & 24 deletions components/TopBar/TopBar.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,38 @@
import { FC, useState } from 'react'
import { FC, useEffect, useState } from 'react'
import { useRouter } from 'next/router'
import { FaSlackHash, FaInfoCircle } from 'react-icons/fa'
import PopupDesc from 'components/popup/popupCategoryDesc'
import { ICategoryData } from 'types'
import categoryDescriptions from './CategoryDescriptions'
import { useResults } from 'hooks/ResultsContext'
import { Tooltip } from 'react-tooltip'

export const TopBar: FC<{ className?: string | undefined }> = (props) => {
const { className } = props
interface TopBarProps {
className?: string
results: number
}

export const TopBar: FC<TopBarProps> = ({ className }) => {
const { results } = useResults()
const [isSearchFound, setIsSearchFound] = useState(false)
const [currentCategory, setCurrentCategory] = useState<ICategoryData | null>(
null
)
const router = useRouter()
const category = router.asPath.replace('/', '')
const categoryName = category.split('-').join(' ')
const regEx = /[ `!@#$%^&*()_+\=\[\]{};':"\\|,.<>\/?~]/g
const cleanedCategory = category
.replaceAll(regEx, ' ')
.replaceAll('search query ', '')

useEffect(() => {
if (results > 0) {
setIsSearchFound(true)
} else if (results === 0) {
setIsSearchFound(false)
}
}, [results])

if (router.pathname.length === 1) {
return null
Expand All @@ -33,28 +52,78 @@ export const TopBar: FC<{ className?: string | undefined }> = (props) => {
}

return (
<div
className={`flex items-center text-xl dark:text-gray-300 ${className}`}
>
<FaSlackHash className="mr-2 text-gray-600 dark:text-gray-300" />
<span className="text-gray-900 dark:text-gray-100 uppercase">
{category.split('-').join(' ')}
</span>
<button
data-tooltip-id="info-tooltip"
data-tooltip-content="Description"
data-tooltip-place="bottom"
<>
{regEx.test(category) ? (
<div
className={`flex items-center text-xl dark:text-gray-300 ${className}`}
>
<FaSlackHash className="mr-2 text-gray-600 dark:text-gray-300" />
<span className="flex uppercase text-gray-900 dark:text-gray-100">
{isSearchFound
? `${cleanedCategory}`
: `No Results Found`}
</span>
<button
data-tooltip-id="info-tooltip"
data-tooltip-content="Description"
data-tooltip-place="bottom"
>
<FaInfoCircle
className="ml-4 mt-2 text-sm cursor-pointer hover:text-theme-primary"
onClick={handleCardClick}
/>
</button>
<Tooltip
id="info-tooltip"
style={{
backgroundColor: '#8b5cf6',
fontSize: '13px',
paddingLeft: '6px',
paddingRight: '6px',
paddingTop: '2px',
paddingBottom: '2px',
}}
/>
<PopupDesc
currentCategory={currentCategory}
onClose={removeCurrentCard}
/>
</div>
) : (
<div
className={`flex items-center text-xl dark:text-gray-300 ${className}`}
>
<FaInfoCircle
className="ml-4 mt-2 text-sm cursor-pointer hover:text-theme-primary"
onClick={handleCardClick}
<FaSlackHash className="mr-2 text-gray-600 dark:text-gray-300" />
<span className="flex uppercase text-gray-900 dark:text-gray-100">
{category.split('-').join(' ')}
</span>
<button
data-tooltip-id="info-tooltip"
data-tooltip-content="Description"
data-tooltip-place="bottom"
>
<FaInfoCircle
className="ml-4 mt-2 text-sm cursor-pointer hover:text-theme-primary"
onClick={handleCardClick}
/>
</button>
<Tooltip
id="info-tooltip"
style={{
backgroundColor: '#8b5cf6',
fontSize: '13px',
paddingLeft: '6px',
paddingRight: '6px',
paddingTop: '2px',
paddingBottom: '2px',
}}
/>
</button>
<Tooltip id="info-tooltip" style={{ backgroundColor: '#8b5cf6', fontSize: '13px', paddingLeft: '6px', paddingRight: '6px', paddingTop: '2px', paddingBottom: '2px' }} />
<PopupDesc
currentCategory={currentCategory}
onClose={removeCurrentCard}
/>
</div>
<PopupDesc
currentCategory={currentCategory}
onClose={removeCurrentCard}
/>
</div>
)}
</>
)
}
7 changes: 7 additions & 0 deletions database/cloud_computing_platforms/azure.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,12 @@
"url": "https://learn.microsoft.com/en-us/azure/?product=popular",
"category": "cloud computing",
"subcategory": "azure"
},
{
"name": "Microsoft Learn & Certified",
"description": "Microsoft has certification paths for many technical job roles. Each of these certifications consists of passing a series of exams to earn them. ",
"url": "https://learn.microsoft.com/en-us/certifications/",
"category": "cloud computing",
"subcategory": "azure"
}
]
16 changes: 16 additions & 0 deletions database/competitive_programming/platforms.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[
{
"name": "LeetCode",
"description": "This site offers competitive coding challenges and interview preparation resources for software engineers and developers.",
"url": "https://leetcode.com/",
"category": "competitive_programming",
"subcategory": "platforms"
},
{
"name": "HackerRank",
"description": "This resource provides developers with competitive programming challenges to improve their skills in multiple languages. It also allows tech recruiters to assess developers on their problem-solving skills.",
"url": "https://www.hackerrank.com/",
"category": "competitive_programming",
"subcategory": "platforms"
}
]
6 changes: 6 additions & 0 deletions database/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,4 +260,10 @@ export const sidebarData: ISidebar[] = [
{ name: 'communities', url: '/communities', resources: DB.communities },
],
},
{
category: 'competitive_programming',
subcategory: [
{ name: 'platforms', url: '/platforms', resources: DB.platforms },
],
},
]
14 changes: 0 additions & 14 deletions database/frontend/online-code-editors.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,6 @@
"category": "frontend",
"subcategory": "online-code-editors"
},
{
"name": "HackerRank",
"description": "An online IDE to practice your competitive programming skills. It allows you to code in multiple languages.",
"url": "https://www.hackerrank.com/",
"category": "frontend",
"subcategory": "online-code-editors"
},
{
"name": "LeetCode",
"description": "LeetCode is the best platform to help you enhance your programming skills, and expand your knowledge.",
"url": "https://leetcode.com/",
"category": "frontend",
"subcategory": "online-code-editors"
},
{
"name": "Programiz",
"description": "Learn to program with our beginner-friendly tutorials and examples. Read tutorials, try examples, write code, and learn to program.",
Expand Down
2 changes: 2 additions & 0 deletions database/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,5 @@ export { default as devtools } from './other/devtools.json'
export { default as podcasts } from './other/podcasts.json'
export { default as otherResources } from './other/other-resources.json'
export { default as communities } from './other/communities.json'
// competitive programming
export {default as platforms } from './competitive_programming/platforms.json'
8 changes: 8 additions & 0 deletions database/other/podcasts.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,13 @@
"url": "https://www.codenewbie.org/podcast",
"category": "other",
"subcategory": "podcasts"
},
{
"name": "Stackoverflow Podcast",
"description": " In Stack Overflow Podcast, hosts Ben Popper, Cassidy Williams, and Ceora Ford explore what it means to work in software and how code is reshaping our world.",
"url": "https://stackoverflow.blog/podcast/",
"category": "other",
"subcategory": "podcasts"
}

]
8 changes: 8 additions & 0 deletions database/resources/e-book.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,13 @@
"category": "resource",
"subcategory": "e-book",
"language": "english"
},
{
"name": "Book Yard",
"description": "'The Library to the World', in which books, education materials, information, reference materials, documents, and content will be provided freely",
"url": "www.bookyards.com",
"category": "resource",
"subcategory": "e-book",
"language": "english"
}
]
18 changes: 16 additions & 2 deletions database/resources/official-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,24 @@
{
"name": "Express",
"description": "Express is a fast, unopinionated, and minimalist web framework for Node.js",
"url": "https://svelte.dev/docs/introduction",
"url": "https://expressjs.com",
"category": "resources",
"subcategory": "officialdocs"
} ,
{
"name": "Laravel",
"description": "Laravel is a web application framework with the expressive, elegant syntax",
"url": "https://laravel.com/",
"category": "resources",
"subcategory": "officialdocs"
},
{
"name": "Ember.js",
"description": "Ember.js is a productive, battle-tested JavaScript framework used for building modern web applications",
"url": "https://guides.emberjs.com/release/",
"category": "resources",
"subcategory": "officialdocs"
}
}


]
33 changes: 22 additions & 11 deletions database/youtube/data-structures.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,32 @@
},
{
"name": "CodeHelp - by Babbar",
"description": "This channel provides free placement specific DSA course in C++.",
"description": "This channel provides free placement-specific DSA courses in C++.",
"url": "https://www.youtube.com/playlist?list=PLDzeHZWIZsTryvtXdMr6rPh4IDexB5NIA",
"category": "youtube",
"subcategory": "data-structures",
"language": "hindi"
},
{
"name": "Apna College",
"description": "This channel provides free courses for DSA, Java, C++, C etc.",
"description": "This channel provides free courses for DSA, Java, C++, C, etc.",
"url": "https://www.youtube.com/watch?v=z9bZufPHFLU&list=PLfqMhTWNBTe0b2nM6JHVCnAkhQRGiZMSJ",
"category": "youtube",
"subcategory": "data-structures",
"language": "hindi"
},
{
"name": "Kunal Kushwaha",
"description": "This channel provides free Java specific DSA course with interview-preparation.",
"description": "This channel provides free Java-specific DSA course with interview preparation.",
"description": "This channel provides a free Java-specific DSA course with interview preparation.",
"url": "https://youtube.com/playlist?list=PL9gnSGHSqcnr_DxHsP7AW9ftq0AtAyYqJ",
"category": "youtube",
"subcategory": "data-structures",
"language": "english"
},
{
"name": "CodeWithHarry",
"description": "An all-in-one destination for DSA, Python, C++, JavaScript, Nodejs, Java, PHP & many more.",
"description": "An all-in-one destination for DSA, Python, C++, JavaScript, Nodejs, Java, PHP, & many more.",
"url": "https://www.youtube.com/@CodeWithHarry/playlists",
"category": "youtube",
"subcategory": "data-structures",
Expand All @@ -57,7 +58,7 @@
},
{
"name": "Pepcoding",
"description": "One of the best channels for DSA and Java. It is also helpful for both students and working professionals.",
"description": "One of the best channels for learning DSA and Java. It is also helpful for both students and working professionals.",
"url": "https://www.youtube.com/@Pepcoding/featured",
"category": "youtube",
"subcategory": "data-structures",
Expand Down Expand Up @@ -97,7 +98,7 @@
},
{
"name": "Hello World DSA",
"description": "This channel provides C++ specific DSA content. This course also provides explanations of Algorithms.",
"description": "This channel provides C++-specific DSA content. This course also provides explanations of Algorithms.",
"url": "https://www.youtube.com/@HelloWorldbyprince/playlists",
"category": "youtube",
"subcategory": "data-structures",
Expand All @@ -113,26 +114,36 @@
},
{
"name": "Data Structure & Algorithms Full Course In Hindi",
"description": "DSA playlist for understanding concepts of core coding using the c++ language",
"description": "DSA playlist for understanding concepts of core coding using the C++ language",
"url": "https://www.youtube.com/playlist?list=PLzjZaW71kMwQ1DIWTn0d_KDHU4_E52-rq",
"category": "youtube",
"subcategory": "data-structures",
"language": "hindi"
},
{
"name": "CODING NINJAS",
"description": "This channel provides DSA course in Python from beginner to advance level.",

"description": "This channel provides a DSA course about Python from beginner to advanced.",

"url": "https://youtube.com/playlist?list=PLrk5tgtnMN6TYBW0-U4YhIRyYEVpqVEnJ",
"category": "youtube",
"subcategory": "data-structures",
"language": "english"
},
{
"name": "CampusX",
"description": "Since Python is a widely used language in the tech industry, a playlist that focuses on various aspects of this programming language would be a valuable addition to this website.",
"url": "https://www.youtube.com/watch?v=f9Aje_cN_CY&list=RDCMUCCWi3hpnq_Pe03nGxuS7isg&start_radio=1&rv=f9Aje_cN_CY&t=41378",
"name": "Data Structures - Full Course Using C and C++",
"description": "Learn about DSAs and how they are implemented in C or C++ in this comprehensive course by FreeCodeCamp. ",
"url": "https://www.youtube.com/watch?v=B31LgI4Y4DQ",
"category": "youtube",
"subcategory": "data-structures",
"language": "english"
},
{
"name":"Code step by step",
"description": "A comprehensive playlist in Hindi that teaches developers data structures in Javascript from scratch.",
"url": "https://www.youtube.com/watch?v=wZHtZ_VJGKI&list=PL8p2I9GklV47TMMnPzqnkCtSOS3ebr4O7&ab_channel=CodeStepByStep",
"category":"youtube",
"subcategory":"data-structures",
"language":"hindi"
}
]
Loading

0 comments on commit ecfaaf9

Please sign in to comment.