forked from rupali-codes/LinksHub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:rupali-codes/LinksHub
- Loading branch information
Showing
56 changed files
with
1,072 additions
and
299 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: 'Documentation 📋' | ||
description: 'Use this form to present your suggestions on how to improve our docs' | ||
title: '[DOCS] <write your suggestion here>' | ||
labels: ['documenation', 'goal: enhancement'] | ||
|
||
body: | ||
- type: textarea | ||
id: docs_description | ||
attributes: | ||
label: 'Issue Description' | ||
description: 'Please provide a brief summary of the documentation issue you are experiencing or would like to address.' | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: additional_context_docs | ||
attributes: | ||
label: 'Additional Context' | ||
description: 'If there is any additional context or information that would be helpful for addressing the documentation issue, please provide it here.' | ||
|
||
- type: textarea | ||
id: screenshots_examples_docs | ||
attributes: | ||
label: 'Screenshots or Examples (if applicable)' | ||
description: 'Please include relevant screenshots or examples to help illustrate the problem.' | ||
|
||
- type: textarea | ||
id: proposed_solution_docs | ||
attributes: | ||
label: 'Proposed Solution (optional)' | ||
description: 'If you have a proposed solution for the documentation issue, please provide it here. This can be helpful for speeding up the resolution process.' | ||
|
||
- type: checkboxes | ||
id: terms_checklist_docs | ||
attributes: | ||
label: 'Checklist' | ||
description: 'By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/rupali-codes/LinksHub/blob/main/CODE_OF_CONDUCT.md)' | ||
options: | ||
- label: 'I have checked the existing [issues](https://github.com/rupali-codes/LinksHub/issues?q=is%3Aissue+)' | ||
required: true | ||
- label: 'I have read the [Contributing Guidelines](https://github.com/rupali-codes/LinksHub/blob/main/CONTRIBUTING.md)' | ||
required: true | ||
- label: 'I am willing to work on this issue (optional)' | ||
required: false | ||
- label: "I am a GSSoC'23 contributor" | ||
required: false | ||
- type: markdown | ||
attributes: | ||
value: 'Thank you for taking the time to raise this issue! Your input is greatly appreciated.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: 'Author Assign' | ||
|
||
on: | ||
pull_request_target: | ||
types: [opened, reopened] | ||
|
||
permissions: | ||
pull-requests: write | ||
|
||
jobs: | ||
assign-author: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: toshimaru/auto-author-assign@v1.6.2 | ||
with: | ||
repo-token: '${{ secrets.GITHUB_TOKEN }}' # GITHUB_TOKEN will be used by default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
# Global Flag for duplicates | ||
haveDuplicates=0 | ||
|
||
# Specify the path to the database folder | ||
databaseFolder="database" | ||
|
||
# Get the names of staged JSON files within any folder inside the database folder | ||
stagedFiles=$(git diff --cached --name-only --relative="$databaseFolder" -- "**/*.json") | ||
|
||
# Find Duplicates and Print them | ||
for file in $stagedFiles; do | ||
|
||
# Read the JSON from staged JSON files | ||
jsonData=$(cat $databaseFolder/$file) | ||
|
||
# Get the URLs from the JSON data | ||
urls=$(echo "$jsonData" | sed -n 's/.*"url"\s*:\s*"\([^"]*\)".*/\1/p') | ||
|
||
# Get the duplicate URLs from the URLSs list | ||
duplicates=$(echo "$urls" | uniq -d) | ||
|
||
# Print duplicate URLs if any | ||
if [[ -n "$duplicates" ]]; then | ||
haveDuplicates=1 | ||
echo -e "\nDuplicate url values found in $databaseFolder/$file: \n$duplicates" | ||
fi | ||
done | ||
|
||
# Exit the commit process if duplicate URLs found | ||
if [ "$haveDuplicates" -eq 1 ]; then | ||
echo -e "\n[Error] Duplicates URLs found" | ||
exit 1 | ||
else | ||
echo -e "\nNo duplicates URLs found" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
bash .husky/checkDuplicateLinks.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { FC } from "react"; | ||
import Link from "next/link"; | ||
import { useEffect, useState } from "react"; | ||
import { FaCodeBranch } from "react-icons/fa"; | ||
|
||
export const GitHubForkButton: FC<{ repo: string }> = ({ repo }) => { | ||
const [forkCount, setForkCount] = useState(0); | ||
|
||
useEffect(() => { | ||
const fetchForkCount = async () => { | ||
try { | ||
const response = await fetch(`https://api.github.com/repos/${repo}`); | ||
const data = await response.json(); | ||
setForkCount(data.forks); | ||
} catch (error) { | ||
console.error("Error fetching fork count:", error); | ||
} | ||
}; | ||
|
||
fetchForkCount(); | ||
}, [repo]); | ||
|
||
// Other Styles for Light Mode: [bg-violet-500 text-white] OR [text-black-500 border border-black] | ||
|
||
return ( | ||
<Link | ||
href={`https://github.com/${repo}/fork`} | ||
passHref | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
aria-label={`Fork ${repo} on GitHub`} | ||
> | ||
<div className="inline-flex items-center px-4 py-1 text-sm font-semibold bg-transparent text-violet-500 border border-violet-500 border-transparent rounded-sm transition-colors shadow-md"> | ||
<FaCodeBranch className="mr-1" /> | ||
<span className="font-semibold">Fork</span> | ||
<span className="ml-2">{forkCount}</span> | ||
</div> | ||
|
||
</Link> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,53 @@ | ||
import React, { useState } from "react"; | ||
import SearchIcon from "assets/icons/SearchIcon"; | ||
import { ChangeEvent } from "react"; | ||
import { SearchbarProps } from "types"; | ||
|
||
export const Searchbar = ({ setSearch }: SearchbarProps) => { | ||
const handleSearch = (e: ChangeEvent<HTMLInputElement>) => { | ||
setSearch(e.target.value); | ||
interface SearchbarProps { | ||
setSearch: (search: string) => void; | ||
} | ||
|
||
export const Searchbar: React.FC<SearchbarProps> = ({ setSearch }) => { | ||
const [searchQuery, setSearchQuery] = useState(""); | ||
const [errorMessage, setErrorMessage] = useState(""); | ||
|
||
const handleSearchChange = (e: React.ChangeEvent<HTMLInputElement>) => { | ||
setSearchQuery(e.target.value); | ||
setErrorMessage(""); | ||
}; | ||
|
||
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => { | ||
e.preventDefault(); | ||
if (searchQuery.trim() === "") { | ||
setErrorMessage("Please enter a search query"); | ||
} else { | ||
setErrorMessage(""); | ||
setSearch(searchQuery); | ||
} | ||
}; | ||
|
||
return ( | ||
<> | ||
<label htmlFor="simple-search" className="sr-only"> | ||
Search | ||
</label> | ||
<div className="relative w-full"> | ||
<div className="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"> | ||
<SearchIcon className="w-5 h-5 text-violet-600 dark:text-violet-400" /> | ||
<form onSubmit={handleSubmit} noValidate> | ||
<div className="flex items-center"> | ||
<div className="relative flex items-center"> | ||
{/* <div className="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"> | ||
<SearchIcon className="w-5 h-5 text-violet-600 dark:text-violet-400" /> | ||
</div> */} | ||
<input | ||
type="text" | ||
id="simple-search" | ||
className="block p-2.5 w-full bg-transparent text-sm text-gray-900 dark:text-gray-200 border border-dashed border-gray-400 dark:border-gray-500 focus:border-violet-500 dark:focus:border-violet-500 dark:focus:ring-violet-500 focus:ring-violet-500 dark:placeholder-gray-400 outline-none transition-all ease-in-out duration-300 rounded-lg" | ||
placeholder="Start searching..." | ||
value={searchQuery} | ||
onChange={handleSearchChange} | ||
required | ||
/> | ||
</div> | ||
<input | ||
type="text" | ||
id="simple-search" | ||
className="block p-2.5 pl-10 w-full bg-transparent text-sm text-gray-900 dark:text-gray-200 border border-solid border-gray-400 dark:border-gray-600 focus:border-violet-500 dark:focus:border-violet-500 dark:focus:ring-violet-500 focus:ring-violet-500 dark:placeholder-gray-300 outline-none transition-all ease-in-out duration-300 rounded-lg" | ||
placeholder="Search" | ||
onChange={handleSearch} | ||
required | ||
/> | ||
<button type="submit" className="ml-2 px-4 py-2.5 bg-violet-500 text-white rounded-md border border-dashed border-transparent hover:border-violet-400 hover:bg-transparent hover:text-violet-400 dark:hover:text-violet-400"> | ||
<SearchIcon className="w-5 h-5" /> | ||
</button> | ||
</div> | ||
</> | ||
{errorMessage && ( | ||
<p className="text-red-500">{errorMessage}</p> | ||
)} | ||
</form> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.