Skip to content

Commit 02652e9

Browse files
Merge branch 'main' into feature/docker
2 parents c0a9337 + cca2203 commit 02652e9

17 files changed

+3055
-1930
lines changed

.all-contributorsrc

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,46 @@
423423
"design",
424424
"code"
425425
]
426+
},
427+
{
428+
"login": "Dhruvn-patel",
429+
"name": "Dhruv Patel",
430+
"avatar_url": "https://avatars.githubusercontent.com/u/87563885?v=4",
431+
"profile": "https://github.com/Dhruvn-patel",
432+
"contributions": [
433+
"code",
434+
"design"
435+
]
436+
},
437+
{
438+
"login": "jolbol1",
439+
"name": "James Shopland",
440+
"avatar_url": "https://avatars.githubusercontent.com/u/5064896?v=4",
441+
"profile": "http://jamesshopland.com",
442+
"contributions": [
443+
"code",
444+
"bug"
445+
]
446+
},
447+
{
448+
"login": "Alone-Y154",
449+
"name": "Yashwanth Krishna",
450+
"avatar_url": "https://avatars.githubusercontent.com/u/72192888?v=4",
451+
"profile": "https://alone-y154.github.io/Portfolio-Website/",
452+
"contributions": [
453+
"design",
454+
"code"
455+
]
456+
},
457+
{
458+
"login": "massdx",
459+
"name": "Massahoud",
460+
"avatar_url": "https://avatars.githubusercontent.com/u/63166764?v=4",
461+
"profile": "https://github.com/massdx",
462+
"contributions": [
463+
"code",
464+
"ideas"
465+
]
426466
}
427467
],
428468
"contributorsPerLine": 7,

.github/workflows/check-linting-and-format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
push:
77
branches:
88
- main
9-
pull_request:
9+
pull_request_target:
1010
branches:
1111
- main
1212

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ yarn-error.log*
3232

3333
# vercel
3434
.vercel
35+
.env*.local

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A Web app that lets you find eligible repositories for Hacktoberfest!
66
Use it here - https://finder.usmans.me
77

88
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
9-
[![All Contributors](https://img.shields.io/badge/all_contributors-43-orange.svg?style=flat-square)](#contributors-)
9+
[![All Contributors](https://img.shields.io/badge/all_contributors-47-orange.svg?style=flat-square)](#contributors-)
1010
<!-- ALL-CONTRIBUTORS-BADGE:END -->
1111
<a href="https://gitmoji.dev">
1212
<img src="https://img.shields.io/badge/gitmoji-%20😜%20😍-FFDD67.svg?style=flat-square" alt="Gitmoji">
@@ -49,6 +49,28 @@ pnpm dev
4949

5050
This project provides a development and production Dockerfiles for your needs and a docker-compose to deploy locally the project with the required configuration. The development Dockerfile creates a volume pointing to /node_modules so you can match the files between your machine and the container, while the production Dockerfile will simply compile the code. There's a Makefile to build, run, stop the containers and remove their volumes if needed, or you can execute the commands directly from the project's root.
5151

52+
### Setup Xata
53+
54+
You will need to sign up with Xata and set up a database for the build. After registering for an account, please proceed with the following steps.
55+
56+
#### Installation
57+
58+
```
59+
npm install -g @xata.io/cli@latest
60+
```
61+
#### Authentication
62+
```
63+
xata auth login
64+
```
65+
66+
#### Migration
67+
68+
Change DB settings in xata.ts and .xatarc (do not commit this) and run migration
69+
70+
```
71+
xata push main
72+
```
73+
5274
## Tech Stack
5375

5476
- [Next.js](https://nextjs.org/)
@@ -135,6 +157,10 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
135157
</tr>
136158
<tr>
137159
<td align="center" valign="top" width="14.28%"><a href="https://nabarun.xyz"><img src="https://avatars.githubusercontent.com/u/64539836?v=4?s=100" width="100px;" alt="Nabarun"/><br /><sub><b>Nabarun</b></sub></a><br /><a href="#ideas-nabarvn" title="Ideas, Planning, & Feedback">🤔</a> <a href="#design-nabarvn" title="Design">🎨</a> <a href="https://github.com/max-programming/hacktoberfest-projects/commits?author=nabarvn" title="Code">💻</a></td>
160+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Dhruvn-patel"><img src="https://avatars.githubusercontent.com/u/87563885?v=4?s=100" width="100px;" alt="Dhruv Patel"/><br /><sub><b>Dhruv Patel</b></sub></a><br /><a href="https://github.com/max-programming/hacktoberfest-projects/commits?author=Dhruvn-patel" title="Code">💻</a> <a href="#design-Dhruvn-patel" title="Design">🎨</a></td>
161+
<td align="center" valign="top" width="14.28%"><a href="http://jamesshopland.com"><img src="https://avatars.githubusercontent.com/u/5064896?v=4?s=100" width="100px;" alt="James Shopland"/><br /><sub><b>James Shopland</b></sub></a><br /><a href="https://github.com/max-programming/hacktoberfest-projects/commits?author=jolbol1" title="Code">💻</a> <a href="https://github.com/max-programming/hacktoberfest-projects/issues?q=author%3Ajolbol1" title="Bug reports">🐛</a></td>
162+
<td align="center" valign="top" width="14.28%"><a href="https://alone-y154.github.io/Portfolio-Website/"><img src="https://avatars.githubusercontent.com/u/72192888?v=4?s=100" width="100px;" alt="Yashwanth Krishna"/><br /><sub><b>Yashwanth Krishna</b></sub></a><br /><a href="#design-Alone-Y154" title="Design">🎨</a> <a href="https://github.com/max-programming/hacktoberfest-projects/commits?author=Alone-Y154" title="Code">💻</a></td>
163+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/massdx"><img src="https://avatars.githubusercontent.com/u/63166764?v=4?s=100" width="100px;" alt="Massahoud"/><br /><sub><b>Massahoud</b></sub></a><br /><a href="https://github.com/max-programming/hacktoberfest-projects/commits?author=massdx" title="Code">💻</a> <a href="#ideas-massdx" title="Ideas, Planning, & Feedback">🤔</a></td>
138164
</tr>
139165
</tbody>
140166
</table>

assets/languages.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
"Pascal",
7777
"CoffeeScript",
7878
"Crystal",
79-
"Clojure"
79+
"Clojure",
80+
"Solidity"
8081
]
8182
}

components/ContributorCard.tsx

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { env } from 'env.mjs';
22
import { CldImage, getCldImageUrl } from 'next-cloudinary';
3+
import { useRouter } from 'next/router';
4+
import { useEffect, useRef } from 'react';
35
import { IoLogoGithub } from 'react-icons/io';
46

57
interface Contributor {
@@ -15,6 +17,9 @@ interface Props {
1517
}
1618

1719
export default function ContributorCard({ contributor }: Props) {
20+
const router = useRouter();
21+
const cardRef = useRef<HTMLButtonElement>(null);
22+
const hash = router.asPath.split('#')[1];
1823
const url = env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME
1924
? getCldImageUrl({
2025
src: contributor.avatar_url,
@@ -24,37 +29,51 @@ export default function ContributorCard({ contributor }: Props) {
2429
})
2530
: contributor.avatar_url;
2631

32+
useEffect(() => {
33+
if (!hash) return;
34+
if (hash.toLowerCase() === contributor.login.toLowerCase()) {
35+
cardRef.current?.scrollIntoView({
36+
behavior: 'smooth',
37+
block: 'center'
38+
});
39+
cardRef.current?.focus();
40+
}
41+
}, [hash, contributor.login]);
42+
2743
return (
28-
<div className="text-center shadow-2xl card">
29-
<a
30-
href={`https://github.com/${contributor.login}`}
31-
target="_blank"
32-
rel="noreferrer"
33-
>
34-
<figure className="px-10 pt-10 h-[351px] md:h-[336px] lg:h-[204px] xl:h-[268px]">
44+
<button
45+
className="justify-center min-w-full text-center shadow-2xl card focus-within:outline-sky-300"
46+
id={contributor.login}
47+
onClick={() => router.replace({ hash: contributor.login })}
48+
ref={cardRef}
49+
>
50+
<div className="w-full pt-5 mx-auto">
51+
<figure className="w-full h-full">
3552
<img src={url} alt={contributor.name} className="rounded-xl" />
3653
</figure>
37-
</a>
38-
<div className="card-body items-center text-center">
39-
<h2 className="card-title text-neutral-100">{contributor.name}</h2>
54+
</div>
55+
<div className="w-full gap-3 text-center card-body">
56+
<h2 className="text-2xl font-bold text-center text-2023-bavarian-blue-1">
57+
{contributor.name}
58+
</h2>
4059
<a
4160
href={contributor.profile}
42-
className="link text-neutral-100 hover:text-[#dbe8d9]"
61+
className="link text-2023-bavarian-blue-1 hover:text-2023-bavarian-blue-2"
4362
>
4463
{contributor.profile}
4564
</a>
46-
<div className="justify-center card-actions mt-auto">
65+
<div className="justify-center mt-auto card-actions">
4766
<a
48-
className="text-white btn border-[#dbe8d9] hover:border-[#dbe8d9] btn-outline border-2 hover:bg-[#dbe8d9] hover:text-slate-900"
67+
className="border-2 text-2023-bavarian-blue-1 btn border-2023-bavarian-blue-2 hover:border-2023-bavarian-blue-2 btn-outline hover:bg-2023-bavarian-blue-2 hover:text-2023-bavarian-blue-4"
4968
href={`https://github.com/${contributor.login}`}
5069
target="_blank"
5170
rel="noreferrer"
5271
>
53-
<IoLogoGithub />
72+
<IoLogoGithub className="w-5 h-5" />
5473
&nbsp; Profile
5574
</a>
5675
</div>
5776
</div>
58-
</div>
77+
</button>
5978
);
6079
}

components/Header.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ function Header() {
3232

3333
<div className="flex gap-2 lg:ml-40">
3434
<button
35-
className="btn btn-ghost capitalize"
35+
36+
className="btn btn-ghost text-white border-1 border-white"
3637
onClick={() => {
3738
if (!session.data) signIn('github');
3839
else signOut();

components/Hero.tsx

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

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

1212
function Hero() {
1313
const [errorMessage, setErrorMessage] = useState<string | null>(null);
14+
const [isSearchEmpty, setIsSearchEmpty] = useState(true);
15+
const formRef = useRef<HTMLFormElement | null>(null);
1416
const router = useRouter();
17+
const handleClear: MouseEventHandler<HTMLButtonElement> = () => {
18+
if (formRef.current && !isSearchEmpty) {
19+
formRef.current.reset();
20+
setIsSearchEmpty(true);
21+
setErrorMessage(null);
22+
}
23+
};
1524
const handleSubmit: FormEventHandler = e => {
1625
e.preventDefault();
1726
const formData = new FormData(e.target as HTMLFormElement);
@@ -34,19 +43,34 @@ function Hero() {
3443
Search your language
3544
</h1>
3645
<form
46+
ref={formRef}
3747
className="form-control w-full max-w-xs mx-auto items-center mt-10 mb-12"
3848
onSubmit={handleSubmit}
3949
>
4050
<div className="flex w-full">
41-
<input
42-
type="text"
43-
placeholder="Search for your language"
44-
className="input input-bordered w-full text-neutral-100 border-2023-bavarian-gold-2 focus:outline-2023-bavarian-gold-2 max-w-xs rounded-tr-none rounded-br-none bg-transparent"
45-
name="search"
46-
/>
51+
<div className="flex relative w-full ">
52+
<input
53+
type="text"
54+
placeholder="Search for your language"
55+
className="input input-bordered w-full text-neutral-100 border-2023-bavarian-gold-2 focus:outline-2023-bavarian-gold-2 max-w-xs rounded-tr-none rounded-br-none bg-transparent"
56+
name="search"
57+
onChange={e => {
58+
setIsSearchEmpty(e.target.value.trim() === '');
59+
}}
60+
/>
61+
62+
{!isSearchEmpty && (
63+
<button
64+
onClick={handleClear}
65+
className="absolute right-0 top-0 bottom-0 p-2"
66+
>
67+
<ClearIcon />
68+
</button>
69+
)}
70+
</div>
4771
<button
4872
type="submit"
49-
className="group btn btn-square rounded-tl-none rounded-bl-none bg-transparent border-2023-manga-3 hover:bg-2023-manga-2 hover:text-2023-void-2 hover:border-2023-manga-2"
73+
className="group btn btn-square rounded-tl-none rounded-bl-none bg-transparent border-2023-bavarian-gold-2 hover:bg-2023-manga-2 hover:text-2023-void-2 hover:border-2023-manga-2"
5074
>
5175
<SearchIcon />
5276
</button>
@@ -106,5 +130,23 @@ const SearchIcon = () => (
106130
/>
107131
</svg>
108132
);
133+
const ClearIcon = () => {
134+
return (
135+
<svg
136+
xmlns="http://www.w3.org/2000/svg"
137+
fill="none"
138+
viewBox="0 0 24 24"
139+
strokeWidth={1.5}
140+
stroke="currentColor"
141+
className="w-4 h-4 text-white "
142+
>
143+
<path
144+
strokeLinecap="round"
145+
strokeLinejoin="round"
146+
d="M6 18L18 6M6 6l12 12"
147+
/>
148+
</svg>
149+
);
150+
};
109151

110152
export default Hero;

0 commit comments

Comments
 (0)