diff --git a/.github/ISSUE_TEMPLATE/add_link.yml b/.github/ISSUE_TEMPLATE/add_link.yml index 72956505f..1c6e0981d 100644 --- a/.github/ISSUE_TEMPLATE/add_link.yml +++ b/.github/ISSUE_TEMPLATE/add_link.yml @@ -1,7 +1,7 @@ name: New Link 🔗 description: Use this to add new link into the Hub title: "[Add] " -labels: ["chore", "add link"] +labels: ["chore", "goal: new-link"] body: - type: input attributes: @@ -20,9 +20,11 @@ body: options: - Frontend - Backend + - ML, AI & Data - Youtube - Resources - Languages + - Open Source - Other validations: required: true @@ -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 diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index b638c5375..bafd82578 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -1,7 +1,7 @@ name: ​🐞 Bug description: Report an issue to help us improve the project. title: "[BUG] " -labels: ["bug", "Goal: fix"] +labels: ["bug", "goal: fix"] body: - type: textarea attributes: @@ -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 \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 4332d31e0..fa252d5d0 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -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 diff --git a/.github/ISSUE_TEMPLATE/other.yml b/.github/ISSUE_TEMPLATE/other.yml index d51296c9c..1a1120624 100644 --- a/.github/ISSUE_TEMPLATE/other.yml +++ b/.github/ISSUE_TEMPLATE/other.yml @@ -22,4 +22,7 @@ body: required: true - label: "I am willing to work on this issue (optional)" - required: false \ No newline at end of file + required: false + + - label: "I am a GSSoC'23 contributor" + required: false diff --git a/.github/workflows/close_old_issues.yaml b/.github/workflows/close_old_issues.yaml new file mode 100644 index 000000000..d9091ab92 --- /dev/null +++ b/.github/workflows/close_old_issues.yaml @@ -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 diff --git a/.github/workflows/close_old_prs.yaml b/.github/workflows/close_old_prs.yaml new file mode 100644 index 000000000..4a422d033 --- /dev/null +++ b/.github/workflows/close_old_prs.yaml @@ -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' }); + } + }); diff --git a/.vscode/settings.json b/.vscode/settings.json index 6ab3a543b..125da15ac 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -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" + } +} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6969f07fc..d7d2a5e98 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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. @@ -29,8 +31,13 @@ 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 @@ -38,7 +45,7 @@ Thank you for taking the time to contribute to our project. Please take a moment > 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 @@ -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**. @@ -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 @@ -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). \ No newline at end of file +- 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)) + + diff --git a/README.md b/README.md index 183e2f7e1..0fa5c7c28 100644 --- a/README.md +++ b/README.md @@ -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. + @@ -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._ diff --git a/components/Cards/Card.tsx b/components/Cards/Card.tsx index b080dc912..2c255b016 100644 --- a/components/Cards/Card.tsx +++ b/components/Cards/Card.tsx @@ -1,4 +1,4 @@ -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' @@ -6,6 +6,11 @@ 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 (
@@ -19,7 +24,13 @@ const Card: FC<{ data: IData }> = (props) => { -

{description}

+
+

{description}

+ { + (isOverflow) && +

Read More

+ } +