Skip to content

Commit

Permalink
merge main into main
Browse files Browse the repository at this point in the history
  • Loading branch information
rupali-codes committed May 25, 2023
2 parents 7e39a98 + 219d129 commit 135c901
Show file tree
Hide file tree
Showing 48 changed files with 1,210 additions and 522 deletions.
7 changes: 6 additions & 1 deletion .github/ISSUE_TEMPLATE/add_link.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: New Link 🔗
description: Use this to add new link into the Hub
title: "[Add] <write what you want to add>"
labels: ["chore", "add link"]
labels: ["chore", "goal: new-link"]
body:
- type: input
attributes:
Expand All @@ -20,9 +20,11 @@ body:
options:
- Frontend
- Backend
- ML, AI & Data
- Youtube
- Resources
- Languages
- Open Source
- Other
validations:
required: true
Expand All @@ -45,3 +47,6 @@ body:

- label: "I am willing to work on this issue (optional)"
required: false

- label: "I am a GSSoC'23 contributor"
required: false
5 changes: 4 additions & 1 deletion .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: ​🐞 Bug
description: Report an issue to help us improve the project.
title: "[BUG] <write a small description here>"
labels: ["bug", "Goal: fix"]
labels: ["bug", "goal: fix"]
body:
- type: textarea
attributes:
Expand Down Expand Up @@ -47,4 +47,7 @@ body:

- label: "I am willing to work on this issue (optional)"
required: false

- label: "I am a GSSoC'23 contributor"
required: false

2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ body:
- label: "I am willing to work on this issue (optional)"
required: false

- label: "I am a GSSoC'23 contributor"
required: false
5 changes: 4 additions & 1 deletion .github/ISSUE_TEMPLATE/other.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@ body:
required: true

- label: "I am willing to work on this issue (optional)"
required: false
required: false

- label: "I am a GSSoC'23 contributor"
required: false
34 changes: 34 additions & 0 deletions .github/workflows/close_old_issues.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Close Old Issues
on:
schedule:
- cron: "0 0 * * *"

jobs:
close-issues:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Close Old Issues
run: |
open_issues=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/issues?state=open" \
| jq -r '.[] | .number')
for issue in $open_issues; do
# Get the last updated timestamp of the issue
last_updated=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/issues/$issue" \
| jq -r '.updated_at')
days_since_update=$(( ( $(date +%s) - $(date -d "$last_updated" +%s) ) / 86400 ))
if [ $days_since_update -gt 45 ]; then
curl -s -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
-d '{"state":"closed"}' \
"https://api.github.com/repos/${{ github.repository }}/issues/$issue"
fi
done
39 changes: 39 additions & 0 deletions .github/workflows/close_old_prs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Close Old PRs
on:
schedule:
- cron: "0 0 * * *"

jobs:
close_old_prs:
runs-on: ubuntu-latest

steps:
- name: Check and Close Old PRs
id: close_prs
uses: actions/github-script@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
script: |
const daysThreshold = 45;
const octokit = require('@octokit/rest')();
octokit.authenticate({
type: 'token',
token: process.env.GITHUB_TOKEN,
});
const { owner, repo } = context.repo;
const { data: pullRequests } = await octokit.pulls.list({ owner, repo, state: 'open' });
pullRequests.forEach(async (pr) => {
const { data: reviews } = await octokit.pulls.listReviews({ owner, repo, pull_number: pr.number });
const lastReview = reviews[reviews.length - 1];
const daysSinceLastUpdate = Math.floor((new Date() - new Date(lastReview.submitted_at)) / (1000 * 60 * 60 * 24));
if (daysSinceLastUpdate >= daysThreshold) {
await octokit.pulls.update({ owner, repo, pull_number: pr.number, state: 'closed' });
}
});
11 changes: 9 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,12 @@
"source.fixAll.eslint": true
},
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
"editor.defaultFormatter": "esbenp.prettier-vscode",
"cSpell.words": [
"daisyui",
"tailwindcss"
],
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
}
}
43 changes: 39 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Thank you for taking the time to contribute to our project. Please take a moment
>
> **Pull Requests having no issue associated with them will not be accepted. Firstly get an issue assigned, whether it's already opened or raised by you, and then create a Pull Request.**
> **An automated process has been implemented to ensure timely management of Pull Requests (PRs) on this platform. PRs that have been open for a duration exceeding 45 days will be automatically closed, so please plan accordingly.**
## Prerequisites

- Open Source Etiquette: If you've never contributed to an open source project before, have a read of [Basic etiquette](https://developer.mozilla.org/en-US/docs/MDN/Community/Open_source_etiquette) for open source projects.
Expand All @@ -29,16 +31,21 @@ Thank you for taking the time to contribute to our project. Please take a moment
#### 🌟Follow these steps to get your Links added into the Hub

* A newly created category and subcategory should be added to the [data.ts](https://github.com/rupali-codes/LinksHub/blob/main/database/data.ts) & [index.ts](https://github.com/rupali-codes/LinksHub/blob/main/database/index.ts) files
<<<<<<< HEAD
* Each category has it's own folder with it's name
* Every subcategory should be placed in it's respective category folder
=======
* Each category has its own folder with its name
* Every subcategory should be placed in its respective category folder
>>>>>>> 219d129b115e107ac741a00122059a7b8424529b
> i.e images should be inside Frontend folder
* To add a new category ensure to create a folder with it's name

> i.e Resources
* Make sure to Export the newly created json file on the index file
* Make sure to export the newly created json file on the index file

The subcategory object should follow this pattern

Expand All @@ -63,17 +70,18 @@ The subcategory object should follow this pattern
* `subcategory`: could be one of the existing categories or create a new one by following the above instructions

**NOTE**
When adding *YouTube* channel link please specify *language* of the channel they are using to teach in for example English, Hindi, Spanish etc. In case language is NOT specified then just remove the language property.
When adding *YouTube* channel link, please specify *language* of the channel they are using to teach in for example English, Hindi, Spanish etc. In cases where the language is NOT specified, then just remove the `language` property.


> **⚠️Important**
>
> - Do not make duplicate entries (always confirm that an entry does not exist by searching through the JSON file.
> - **Do not** make duplicate entries. Always confirm that an entry does not exist by searching through the JSON file.
> - Ensure that your entries are error-free by double-checking before staging your changes.
> - Your entries should follow the above structure.
---
## Issues
<<<<<<< HEAD
* Select an issue template from [issues](https://github.com/EddieHubCommunity/LinkFree/issues/new/choose) tab. Otherwise choose **Other** if it doesn't match what you're looking for.
* When creating an issue make sure you fill up all the fields properly.
* Make sure that you are NOT raising a **duplicate issue**.
Expand All @@ -88,12 +96,37 @@ The subcategory object should follow this pattern

## Commits
* Please keep your commit message short and clear.
=======
* Select an issue template from [issues](https://github.com/rupali-codes/LinksHub/issues/new/choose) tab. Otherwise, choose **Other** if it doesn't match what you're looking for.
* When creating an issue, make sure you fill up all the fields properly.
* Make sure that you are NOT raising a **duplicate issue**.
* If you want to work on the issue, please click on the *I am willing to work on this issue* checkmark.
* **Note:** If you are apart of GSSoC'23, please check the *I am a GSSoC'23 contributor* check mark as shown in the image below:
![issue checkmark for gssoc'23](https://github.com/CBID2/LinksHub-my-version-/assets/105683440/c31b245d-420a-4513-bb58-d6be8b2fcdb1)
* **Do not create the PR until you have confirmed with the maintainers that you are participating in this program**

* If you aren't the owner of the issue, please comment that you're willing to work on the issue and wait for maintainers to assign you the issue. Also, don't work on the issue if you're NOT assigned.
* Please do **not** start working on the issue if you aren't yet assigned.
* Work on only **ONE** issue at a time.

**Closing the issue**

* If you decide to close the issue, please leave a brief comment describing why(e.g., I'm busy with other obligations.) before you do.
* **Note:** If the Pull Request associated with the issue gets merged and the issue still remains open, it's **your** responsibility to close the issue.

## Commits
* Please keep your commit messages short and clear.
>>>>>>> 219d129b115e107ac741a00122059a7b8424529b
* Use `type: subject` format for writing your commit messages. `type` could be one the followings:
* `feat`: use this if you're adding any new feature
* `fix`: use this if you're fixing anything in the codebase
* `chore`: use this when you're adding new links/resources AND when making any small changes
(ex. chore: added *resource_name* in *subcategory* *category* )
<<<<<<< HEAD

=======
If you need more tips, check out [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
>>>>>>> 219d129b115e107ac741a00122059a7b8424529b
## Making Pull Requests

1. When you submit a pull request, several tests are automatically run
Expand All @@ -111,4 +144,6 @@ The subcategory object should follow this pattern
---
## Remarks ✅

If something is missing here, or you feel something is not well described, either directly create a PR or [create an issue](https://github.com/rupali-codes/LinksHub/issues).
- If something is missing here, or you feel something is not well described, either create a PR, [raise an issue](https://github.com/rupali-codes/LinksHub/issues), or [do a code review of the person’s PR](https://www.freecodecamp.org/news/code-review-tips/) (ensure that your review conforms to the [Code of Conduct](https://github.com/CBID2/LinksHub-my-version-/blob/main/CODE_OF_CONDUCT.md))


4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ and the website will be built in one single click. No extra setup is required.
## Our Contributors ✨
We would like to express our sincere gratitude to all the contributors who have helped make LinksHub an invaluable resource for developers. Without your contributions, this project wouldn't have been possible. Thank you so much for your time, efforts, and dedication.

<a href="https://github.com/rupali-codes/LinksHub/graphs/contributors">
<img src="https://contrib.rocks/image?repo=rupali-codes/LinksHub" />
</a>
Expand All @@ -157,3 +159,5 @@ LinksHub is licensed under the terms of MIT License. check out [LICENSE](https:/
## Support ⭐

_We would love to have you, feel free to open issues and pull requests and Don't forget to leave a star⭐_
_We would be absolutely thrilled to have you contribute to LinksHub! Your support, whether through opening issues, submitting pull requests, or even just leaving a star, means a lot to us. Together, we can continue to improve and expand this resource hub for developers worldwide._
15 changes: 13 additions & 2 deletions components/Cards/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { FC } from 'react'
import { FC,useState, useRef, useEffect } from 'react'
import { BsBoxArrowUpRight } from 'react-icons/bs'
import { CopyToClipboard } from 'components/CopyToClipboard'
import type { IData } from 'types'

const Card: FC<{ data: IData }> = (props) => {
const { data } = props
const { name, description, url } = data
const descriptionRef = useRef(document.createElement("p"));
const [isOverflow, setIsOverflow] = useState(false);
useEffect (() => {
setIsOverflow(descriptionRef.current?.scrollHeight > descriptionRef.current?.offsetHeight);
}, [])

return (
<article className="z-10 h-full w-full rounded-3xl border border-dashed border-violet-500 dark:border-violet-400 bg-gray-100 shadow-lg dark:bg-gray-900 dark:text-gray-300 dark:shadow-sm">
Expand All @@ -19,7 +24,13 @@ const Card: FC<{ data: IData }> = (props) => {
</h2>
<CopyToClipboard url={url} />
</header>
<p className="h-24 w-full overflow-hidden font-sans">{description}</p>
<div className="h-[7rem]">
<p ref={descriptionRef} className="h-24 w-full overflow-hidden font-sans text-ellipsis line-clamp-4">{description}</p>
{
(isOverflow) &&
<p className="text-sm underline text-violet-600 dark:text-violet-400 text-right hover:text-violet-400 dark:hover:text-violet-300" >Read More</p>
}
</div>
<footer className="card-actions justify-end">
<a
onClick={(e) => e.stopPropagation()}
Expand Down
2 changes: 1 addition & 1 deletion components/Cards/CardsListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const CardsListItem: FC<{ data: IData, onClick: () => void }> = (props) => {

return (
<li
className="h-64 w-full cursor-pointer transition-all duration-100 ease-in hover:scale-[1.02] md:w-72"
className="w-full cursor-pointer transition-all duration-100 ease-in hover:scale-[1.02] md:w-72"
onClick={onClick}
>
<Card data={data} />
Expand Down
32 changes: 18 additions & 14 deletions components/SideNavbar/SideNavbarBody.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
import { FC } from "react";
import { Searchbar } from "../Searchbar";
import useSidebarSearch from "hooks/useSidebarSearch";
import classNames from "classnames";
import { useTheme } from "next-themes";
import { SideNavbarCategoryList } from "./SideNavbarCategoryList";
import { FC } from 'react'
import { Searchbar } from '../Searchbar'
import useSidebarSearch from 'hooks/useSidebarSearch'
import classNames from 'classnames'
import { useTheme } from 'next-themes'
import { SideNavbarCategoryList } from './SideNavbarCategoryList'

export const SideNavbarBody:FC<{}> = () => {
const { theme } = useTheme();
export const SideNavbarBody: FC<{}> = () => {
const { theme } = useTheme()

const { setSearch, searchResults, debouncedSearch } = useSidebarSearch()

const { setSearch, searchResults } = useSidebarSearch();

return (
<div
className={classNames(
`bg-base-200 h-full w-full overflow-x-hidden whitespace-nowrap transition-all duration-300 ease-in dark:bg-gray-900 dark:text-gray-300`,
theme === "light" ? "scrollColorLight" : "scrollColorDark"
theme === 'light' ? 'scrollColorLight' : 'scrollColorDark'
)}
>
<div className="bg-base-200 transiton-all w-full p-4 duration-300 ease-in dark:bg-gray-900">
<Searchbar setSearch={setSearch} />
</div>
<SideNavbarCategoryList items={searchResults} openByDefault={'frontend'} />
<SideNavbarCategoryList
items={searchResults}
isSearching={debouncedSearch.length > 0}
openByDefault={'frontend'}
/>
</div>
);
};
)
}
Loading

0 comments on commit 135c901

Please sign in to comment.