Skip to content

Commit

Permalink
Merge branch 'main' into Json-Branch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
Nishitbaria authored Aug 10, 2023
2 parents 555dba1 + ceba809 commit a9125d2
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 52 deletions.
12 changes: 11 additions & 1 deletion components/popup/popupInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const PopupInfo: React.FC<{
</div>
<p className="">{currentCard?.description}</p>
</div>
<div className="card-actions justify-end">
<div className="card-actions justify-end mt-auto">
<a
onClick={(e) => e.stopPropagation()}
href={currentCard?.url}
Expand All @@ -66,6 +66,16 @@ export const PopupInfo: React.FC<{
Visit site
</a>
</div>

{/* Close Text */}
<div className="flex justify-center items-center">
<p
onClick={onClose}
className="cursor-pointer text-sm text-text-primary -mt-3 hover:text-theme-primary hover:underline"
>
Close
</p>
</div>
</div>,
overlayRoot
)}
Expand Down
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/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"
}
]
8 changes: 7 additions & 1 deletion database/resources/official-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,14 @@
"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"
}



]
18 changes: 9 additions & 9 deletions database/youtube/data-structures.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@
},
{
"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 a free Java-specific DSA course with interview preparation.",
"url": "https://youtube.com/playlist?list=PL9gnSGHSqcnr_DxHsP7AW9ftq0AtAyYqJ",
"category": "youtube",
"subcategory": "data-structures",
Expand Down Expand Up @@ -97,7 +97,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,24 +113,24 @@
},
{
"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"
Expand Down
8 changes: 8 additions & 0 deletions database/youtube/web-development.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,5 +302,13 @@
"category": "youtube",
"subcategory": "web-development",
"language": "english"
},
{
"name": "The Coder Coder",
"description": "This site provides practical tips for beginner web developers.",
"url": "https://www.youtube.com/c/TheCoderCoder",
"category": "youtube",
"subcategory": "web-development",
"language": "english"
}
]
52 changes: 25 additions & 27 deletions pages/search.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
import Head from 'next/head'
import React, { useEffect } from 'react'
import { useRouter } from 'next/router'

import CardsList from 'components/Cards/CardsList'
import { TopBar } from 'components/TopBar/TopBar'
import ComingSoon from 'components/NewIssue/NewIssue'

import useFilterSearch from 'hooks/useFilterSearch'
import React, { useEffect } from 'react';
import { useRouter } from 'next/router';
import Head from 'next/head';
import CardsList from 'components/Cards/CardsList';
import { TopBar } from 'components/TopBar/TopBar';
import ComingSoon from 'components/NewIssue/NewIssue';
import useFilterSearch from 'hooks/useFilterSearch';

const Search = () => {
const router = useRouter()
const title = `LinksHub - ${router.asPath
.charAt(1)
.toUpperCase()}${router.asPath.slice(2)}`
const query = router.query.query
const { filterSearch } = useFilterSearch()
const router = useRouter();
const query = router.query.query;
const { filterSearch } = useFilterSearch();

useEffect(() => {
if (!query || query === '') router.replace('/')
}, [query, router])
if (!query || query === '') router.replace('/');
}, [query, router]);

let content: JSX.Element[] | JSX.Element
const data = filterSearch(query as string);

const data = filterSearch(query as string)
const title = `LinksHub - ${
router.asPath.charAt(1).toUpperCase() + router.asPath.slice(2)
}`;

if (data.length > 0) {
content = <CardsList cards={data} />
} else {
content = <ComingSoon />
}
const content = data.length > 0 ? (
<CardsList cards={data} />
) : (
<ComingSoon />
);

return (
<>
Expand Down Expand Up @@ -88,13 +85,14 @@ const Search = () => {
property="discord:invite"
content="https://discord.com/invite/NvK67YnJX5"
/>

</Head>
<TopBar className="shadow-black-500/50 fixed top-[76px] z-30 flex w-full -translate-x-4 items-center bg-gray-100 px-4 pt-6 pb-4 shadow-xl dark:bg-gray-900 md:hidden" />
<div className="min-h-[calc(100%-68px)] w-full pt-[85px] pb-4 md:min-h-[calc(100%-76px)] md:px-10 md:pt-10">
{content}
</div>
</>
)
}
);
};

export default Search
export default Search;
3 changes: 3 additions & 0 deletions types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export type Category =
| 'youtube'
| 'other'
| 'devops'
| 'competitive_programming'

export type SubCategories = {
name: string
Expand Down Expand Up @@ -158,4 +159,6 @@ export const subcategoryArray = [
'github',
'other-resources',
'podcasts',
// competitive programming
'platforms',
]

0 comments on commit a9125d2

Please sign in to comment.