Skip to content

Commit 0fbbd58

Browse files
author
Nabarun
committed
Merge branch 'main' into 'fix/issue-188'
2 parents b37ca05 + 00850b8 commit 0fbbd58

20 files changed

+152
-46
lines changed

.all-contributorsrc

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"login": "max-programming",
1010
"name": "Max Programming",
1111
"avatar_url": "https://avatars.githubusercontent.com/u/51731966?v=4",
12-
"profile": "https://usman-s.me",
12+
"profile": "https://usmans.me",
1313
"contributions": [
1414
"code"
1515
]
@@ -362,6 +362,56 @@
362362
"code",
363363
"design"
364364
]
365+
},
366+
{
367+
"login": "Mohit030802",
368+
"name": "Mohit",
369+
"avatar_url": "https://avatars.githubusercontent.com/u/80634689?v=4",
370+
"profile": "https://bright-ganache-eb99ae.netlify.app/",
371+
"contributions": [
372+
"code",
373+
"ideas"
374+
]
375+
},
376+
{
377+
"login": "tmsagarofficial",
378+
"name": "S A G A R",
379+
"avatar_url": "https://avatars.githubusercontent.com/u/110724849?v=4",
380+
"profile": "https://github.com/tmsagarofficial",
381+
"contributions": [
382+
"ideas",
383+
"code"
384+
]
385+
},
386+
{
387+
"login": "prithvi2k2",
388+
"name": "Prithvi Reddy",
389+
"avatar_url": "https://avatars.githubusercontent.com/u/72189314?v=4",
390+
"profile": "https://prithvi2k2.github.io/",
391+
"contributions": [
392+
"code",
393+
"design"
394+
]
395+
},
396+
{
397+
"login": "inderharrysingh",
398+
"name": "Inderjot Singh",
399+
"avatar_url": "https://avatars.githubusercontent.com/u/112561014?v=4",
400+
"profile": "https://github.com/inderharrysingh",
401+
"contributions": [
402+
"design",
403+
"code"
404+
]
405+
},
406+
{
407+
"login": "Keith-Web3",
408+
"name": "Olorunnishola Olamilekan",
409+
"avatar_url": "https://avatars.githubusercontent.com/u/96974022?v=4",
410+
"profile": "https://github.com/Keith-Web3",
411+
"contributions": [
412+
"ideas",
413+
"code"
414+
]
365415
}
366416
],
367417
"contributorsPerLine": 7,

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# Hacktoberfest Projects 🎉
22

3-
A Web app that lets you find eligible repositories for Hacktoberfest 2022!
3+
4+
A Web app that lets you find eligible repositories for Hacktoberfest!
45

56
Use it here - https://finder.usmans.me
67

78
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
8-
[![All Contributors](https://img.shields.io/badge/all_contributors-37-orange.svg?style=flat-square)](#contributors-)
9+
[![All Contributors](https://img.shields.io/badge/all_contributors-42-orange.svg?style=flat-square)](#contributors-)
910
<!-- ALL-CONTRIBUTORS-BADGE:END -->
1011
<a href="https://gitmoji.dev">
1112
<img src="https://img.shields.io/badge/gitmoji-%20😜%20😍-FFDD67.svg?style=flat-square" alt="Gitmoji">
@@ -75,7 +76,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
7576
<table>
7677
<tbody>
7778
<tr>
78-
<td align="center" valign="top" width="14.28%"><a href="https://usman-s.me"><img src="https://avatars.githubusercontent.com/u/51731966?v=4?s=100" width="100px;" alt="Max Programming"/><br /><sub><b>Max Programming</b></sub></a><br /><a href="https://github.com/max-programming/hacktoberfest-projects/commits?author=max-programming" title="Code">💻</a></td>
79+
<td align="center" valign="top" width="14.28%"><a href="https://usmans.me"><img src="https://avatars.githubusercontent.com/u/51731966?v=4?s=100" width="100px;" alt="Max Programming"/><br /><sub><b>Max Programming</b></sub></a><br /><a href="https://github.com/max-programming/hacktoberfest-projects/commits?author=max-programming" title="Code">💻</a></td>
7980
<td align="center" valign="top" width="14.28%"><a href="https://sunritjana.now.sh"><img src="https://avatars.githubusercontent.com/u/56873669?v=4?s=100" width="100px;" alt="Sunrit Jana"/><br /><sub><b>Sunrit Jana</b></sub></a><br /><a href="https://github.com/max-programming/hacktoberfest-projects/commits?author=janaSunrise" title="Code">💻</a></td>
8081
<td align="center" valign="top" width="14.28%"><a href="https://medium.com/@geeknees"><img src="https://avatars.githubusercontent.com/u/701242?v=4?s=100" width="100px;" alt="Masumi Kawasaki"/><br /><sub><b>Masumi Kawasaki</b></sub></a><br /><a href="https://github.com/max-programming/hacktoberfest-projects/commits?author=geeknees" title="Code">💻</a> <a href="#content-geeknees" title="Content">🖋</a></td>
8182
<td align="center" valign="top" width="14.28%"><a href="http://rishit-khandelwal.github.io"><img src="https://avatars.githubusercontent.com/u/65018379?v=4?s=100" width="100px;" alt="Rishit Khandelwal"/><br /><sub><b>Rishit Khandelwal</b></sub></a><br /><a href="https://github.com/max-programming/hacktoberfest-projects/commits?author=rishit-khandelwal" title="Code">💻</a> <a href="#content-rishit-khandelwal" title="Content">🖋</a></td>
@@ -122,6 +123,11 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
122123
<tr>
123124
<td align="center" valign="top" width="14.28%"><a href="https://maitri-vv.github.io/Maitri-sPortfolio/"><img src="https://avatars.githubusercontent.com/u/87691594?v=4?s=100" width="100px;" alt="maitri-vv"/><br /><sub><b>maitri-vv</b></sub></a><br /><a href="https://github.com/max-programming/hacktoberfest-projects/commits?author=maitri-vv" title="Code">💻</a></td>
124125
<td align="center" valign="top" width="14.28%"><a href="https://dev.to/nidble/"><img src="https://avatars.githubusercontent.com/u/1447119?v=4?s=100" width="100px;" alt="Antonino Bertulla"/><br /><sub><b>Antonino Bertulla</b></sub></a><br /><a href="https://github.com/max-programming/hacktoberfest-projects/commits?author=nidble" title="Code">💻</a> <a href="#design-nidble" title="Design">🎨</a></td>
126+
<td align="center" valign="top" width="14.28%"><a href="https://bright-ganache-eb99ae.netlify.app/"><img src="https://avatars.githubusercontent.com/u/80634689?v=4?s=100" width="100px;" alt="Mohit"/><br /><sub><b>Mohit</b></sub></a><br /><a href="https://github.com/max-programming/hacktoberfest-projects/commits?author=Mohit030802" title="Code">💻</a> <a href="#ideas-Mohit030802" title="Ideas, Planning, & Feedback">🤔</a></td>
127+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tmsagarofficial"><img src="https://avatars.githubusercontent.com/u/110724849?v=4?s=100" width="100px;" alt="S A G A R"/><br /><sub><b>S A G A R</b></sub></a><br /><a href="#ideas-tmsagarofficial" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/max-programming/hacktoberfest-projects/commits?author=tmsagarofficial" title="Code">💻</a></td>
128+
<td align="center" valign="top" width="14.28%"><a href="https://prithvi2k2.github.io/"><img src="https://avatars.githubusercontent.com/u/72189314?v=4?s=100" width="100px;" alt="Prithvi Reddy"/><br /><sub><b>Prithvi Reddy</b></sub></a><br /><a href="https://github.com/max-programming/hacktoberfest-projects/commits?author=prithvi2k2" title="Code">💻</a> <a href="#design-prithvi2k2" title="Design">🎨</a></td>
129+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/inderharrysingh"><img src="https://avatars.githubusercontent.com/u/112561014?v=4?s=100" width="100px;" alt="Inderjot Singh"/><br /><sub><b>Inderjot Singh</b></sub></a><br /><a href="#design-inderharrysingh" title="Design">🎨</a> <a href="https://github.com/max-programming/hacktoberfest-projects/commits?author=inderharrysingh" title="Code">💻</a></td>
130+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Keith-Web3"><img src="https://avatars.githubusercontent.com/u/96974022?v=4?s=100" width="100px;" alt="Olorunnishola Olamilekan"/><br /><sub><b>Olorunnishola Olamilekan</b></sub></a><br /><a href="#ideas-Keith-Web3" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/max-programming/hacktoberfest-projects/commits?author=Keith-Web3" title="Code">💻</a></td>
125131
</tr>
126132
</tbody>
127133
</table>

components/Card.tsx

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { emojify } from '@twuni/emojify';
2-
import { GoStar, GoRepoForked } from 'react-icons/go';
2+
import { GoStar, GoRepoForked, GoIssueOpened } from 'react-icons/go';
33
import { RepoItem } from 'types';
44

55
interface Props {
@@ -61,11 +61,11 @@ function Card({ repo }: Props) {
6161
</div>
6262

6363
{/* stars and forks cards */}
64-
<div className="w-full flex gap-3 xl:gap-5 text-neutral-100 cursor-pointer mt-8">
64+
<div className="container-query flex flex-wrap justify-between gap-3 xl:gap-5 text-neutral-100 cursor-pointer mt-8">
6565
<a
6666
href={`${repo.html_url}/stargazers`}
6767
target="_blank"
68-
className="group w-full border rounded-xl p-3 xl:px-4 flex items-center gap-2 xl:gap-3 relative"
68+
className="group w-full flex-shrink-0 flex-grow-1 basis-[120px] border rounded-xl p-3 xl:px-4 flex items-center gap-2 xl:gap-3 relative"
6969
>
7070
<GoStar className="text-yellow-200 text-2xl" />
7171
<div className="flex flex-col">
@@ -76,15 +76,15 @@ function Card({ repo }: Props) {
7676
</div>
7777
<div
7878
id="tooltip"
79-
className="hidden group-hover:block absolute bg-2023-void-2 text-2023-bavarian-gold-2 px-2 py-1 rounded-md"
79+
className="hidden group-hover:block text-sm absolute bg-2023-void-2 text-2023-bavarian-gold-2 px-2 py-1 rounded-md"
8080
>
8181
Checkout all the stars here!
8282
</div>
8383
</a>
8484
<a
8585
href={`${repo.html_url}/forks`}
8686
target="_blank"
87-
className="group w-full border rounded-xl p-3 flex items-center gap-3 relative"
87+
className="group flex-shrink-0 flex-grow-1 basis-[120px] border rounded-xl p-3 flex items-center gap-3 relative"
8888
>
8989
<GoRepoForked className="text-yellow-200 text-2xl" />
9090
<div className="flex flex-col">
@@ -95,11 +95,30 @@ function Card({ repo }: Props) {
9595
</div>
9696
<div
9797
id="tooltip"
98-
className="hidden group-hover:block absolute bg-2023-void-2 text-2023-bavarian-gold-2 px-2 py-1 rounded-md"
98+
className="hidden group-hover:block absolute text-sm bg-2023-void-2 text-2023-bavarian-gold-2 px-2 py-1 rounded-md"
9999
>
100100
Checkout all the forks here!
101101
</div>
102102
</a>
103+
<a
104+
href={`${repo.html_url}/issues`}
105+
target="_blank"
106+
className="group issues-btn flex-shrink-0 flex-grow-1 basis-[120px] border rounded-xl p-3 flex items-center gap-3 relative"
107+
>
108+
<GoIssueOpened className="text-yellow-200 text-2xl" />
109+
<div className="flex flex-col">
110+
<div className="text-lg xl:text-2xl font-semibold mb-0.5">
111+
{repo.open_issues_count}
112+
</div>
113+
<div className="text-neutral-300 text-xs lg:text-sm">Issues</div>
114+
</div>
115+
<div
116+
id="tooltip"
117+
className="hidden group-hover:block absolute text-sm bg-2023-void-2 text-2023-bavarian-gold-2 px-2 py-1 rounded-md"
118+
>
119+
Checkout all open issues here!
120+
</div>
121+
</a>
103122
</div>
104123
</div>
105124
</section>

components/Header.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ function Header() {
2828

2929
<SearchBar searchBarWrapperStyles="hidden sm:inline-flex flex-1 max-w-md px-6" />
3030

31-
<div className="flex-none">
31+
<div className="flex-none lg:ml-40 md:10">
3232
<Link
3333
href="/contributors"
34-
className="btn btn-square btn-ghost umami--click--contributors-button"
34+
className="btn btn-square btn-ghost umami--click--contributors-button "
3535
>
3636
<BsPeopleFill size="1.5rem" color='white' title="Contributors" />
3737
</Link>
@@ -40,7 +40,7 @@ function Header() {
4040
href="https://github.com/max-programming/hacktoberfest-projects"
4141
target="_blank"
4242
rel="noreferrer"
43-
className="btn btn-square btn-ghost umami--click--github-button"
43+
className="btn btn-square btn-ghost umami--click--github-button ml-"
4444
>
4545
<IoLogoGithub size="1.5rem" color='white' title="GitHub" />
4646
</a>
@@ -53,4 +53,4 @@ function Header() {
5353
);
5454
}
5555

56-
export default Header;
56+
export default Header;

components/Hero.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FormEventHandler } from 'react';
1+
import { FormEventHandler, useState } from 'react';
22
import Link from 'next/link';
33

44
import languages from 'assets/languages.json';
@@ -10,11 +10,19 @@ import Button from './Button';
1010
const { main: mainLanguages, others: otherLanguages } = languages;
1111

1212
function Hero() {
13+
const [errorMessage, setErrorMessage] = useState<string | null>(null);
1314
const router = useRouter();
1415
const handleSubmit: FormEventHandler = e => {
1516
e.preventDefault();
1617
const formData = new FormData(e.target as HTMLFormElement);
17-
const search = formData.get('search');
18+
const search = (formData.get('search') as string).trim();
19+
// Check if the input is empty or contains only spaces
20+
if (search === '') {
21+
setErrorMessage('Empty search terms invalid!');
22+
return;
23+
}
24+
// Clear any previous error message & proceed to search
25+
setErrorMessage(null);
1826
router.push(`/repos/${search}`);
1927
};
2028
return (

components/Search.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface FormValues {
66
searchQuery: string;
77
}
88
export interface SearchProps {
9-
searchBarWrapperStyles?: string
9+
searchBarWrapperStyles?: string;
1010
}
1111

1212
export default function Search({ searchBarWrapperStyles }: SearchProps) {
@@ -19,7 +19,11 @@ export default function Search({ searchBarWrapperStyles }: SearchProps) {
1919
});
2020

2121
const onSubmit: SubmitHandler<FormValues> = ({ searchQuery }) => {
22-
router.push({ query: { ...router.query, q: searchQuery } });
22+
let trimmedQuery = searchQuery.trim();
23+
//Performs search only with non-empty strings
24+
if (trimmedQuery !== '') {
25+
router.push({ query: { ...router.query, q: trimmedQuery } });
26+
}
2327
};
2428

2529
return (
@@ -40,7 +44,7 @@ export default function Search({ searchBarWrapperStyles }: SearchProps) {
4044
type="button"
4145
onClick={() => reset()}
4246
>
43-
<GoX />
47+
<GoX color="white" />
4448
</button>
4549
</div>
4650
</form>

components/Sort.tsx

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,38 +25,37 @@ export default function Sort() {
2525

2626
const navigationItems = [
2727
{
28-
name: "Best match",
28+
name: 'Best match',
2929
href: { query: { ...router.query } }
3030
},
3131
{
32-
name: "Most stars",
32+
name: 'Most stars',
3333
href: { query: { ...router.query, s: 'stars', o: 'desc' } }
3434
},
3535
{
36-
name: "Fewest stars",
36+
name: 'Fewest stars',
3737
href: { query: { ...router.query, s: 'stars', o: 'asc' } }
3838
},
3939
{
40-
name: "Most forks",
40+
name: 'Most forks',
4141
href: { query: { ...router.query, s: 'forks', o: 'desc' } }
4242
},
4343
{
44-
name: "Fewest forks",
44+
name: 'Fewest forks',
4545
href: { query: { ...router.query, s: 'forks', o: 'asc' } }
4646
},
4747
{
48-
name: "Most help wanted issues",
48+
name: 'Most help wanted issues',
4949
href: { query: { ...router.query, s: 'help-wanted-issues', o: 'desc' } }
5050
},
5151
{
52-
name: "Recently updated",
52+
name: 'Recently updated',
5353
href: { query: { ...router.query, s: 'updated', o: 'desc' } }
5454
},
5555
{
56-
name: "Least recently updated",
56+
name: 'Least recently updated',
5757
href: { query: { ...router.query, s: 'updated', o: 'asc' } }
58-
},
59-
58+
}
6059
];
6160

6261
const selectedSort = (): SortTypes => {
@@ -110,9 +109,7 @@ export default function Sort() {
110109
<ul tabIndex={0} className="menu menu-vertical">
111110
{navigationItems.map((item, index) => (
112111
<li key={index}>
113-
<Link href={{ query: item.href.query }}>
114-
{item.name}
115-
</Link>
112+
<Link href={{ query: item.href.query }}>{item.name}</Link>
116113
</li>
117114
))}
118115
</ul>

components/StarsFilter.tsx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
1+
import { useEffect } from 'react';
12
import { useRouter } from 'next/router';
23
import { SubmitHandler, Controller, useForm } from 'react-hook-form';
3-
import { GoX } from 'react-icons/go';
44

55
interface FormValues {
6-
startStars: number;
7-
endStars: number | string;
6+
startStars: number | '';
7+
endStars: number | '';
88
}
99

1010
export default function StarsFilter() {
1111
const router = useRouter();
1212
const { handleSubmit, control, reset } = useForm<FormValues>({
1313
defaultValues: {
1414
startStars: !router.query.startStars
15-
? undefined
15+
? ''
1616
: +(router.query.startStars as string),
17-
endStars: !router.query.endStars
18-
? undefined
19-
: +(router.query.endStars as string)
17+
endStars: !router.query.endStars ? '' : +(router.query.endStars as string)
2018
}
2119
});
2220

2321
const onSubmit: SubmitHandler<FormValues> = ({ startStars, endStars }) => {
2422
let query;
25-
if (typeof endStars === 'number' && endStars < startStars) {
23+
if (
24+
typeof endStars === 'number' &&
25+
typeof startStars === 'number' &&
26+
endStars < startStars
27+
) {
2628
reset({ startStars, endStars: '' });
2729
query = { startStars };
2830
const { endStars, ...rest } = router.query;
@@ -36,6 +38,10 @@ export default function StarsFilter() {
3638
}
3739
};
3840

41+
useEffect(() => {
42+
reset();
43+
}, [router.query?.language, reset]);
44+
3945
return (
4046
<form
4147
className="w-full m-2 mx-auto mb-4 lg:w-2/4 form-control px-2"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@
4141
"tailwindcss": "^3.3.3",
4242
"typescript": "5.2.2"
4343
}
44-
}
44+
}

pages/_app.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import '@fontsource/poppins';
99
import '../styles/globals.css';
1010

1111
import type { AppProps } from 'next/app';
12+
import Footer from 'components/Footer';
1213

1314
function MyApp({ Component, pageProps, router }: AppProps) {
1415
return (
@@ -31,12 +32,13 @@ function MyApp({ Component, pageProps, router }: AppProps) {
3132
async
3233
defer
3334
data-website-id="2529a688-ee5c-4869-9f85-7bb8fa5b6518"
34-
src="https://insights.usman-s.me/umami.js"
35+
src="https://insights.usmans.me/umami.js"
3536
></script>
3637
</Head>
3738
<DefaultSeo {...SEO} />
3839
<NextNProgress color="#ffd74d" options={{ showSpinner: false }} />
3940
<Component {...pageProps} />
41+
<Footer />
4042
</motion.div>
4143
);
4244
}

0 commit comments

Comments
 (0)