Skip to content

Commit

Permalink
Merge branch 'main' into blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Anmol-Baranwal authored Aug 19, 2023
2 parents 3e61452 + effa858 commit 4f6d1a7
Show file tree
Hide file tree
Showing 44 changed files with 677 additions and 424 deletions.
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/add_link.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ body:
- Artificial Intelligence
- Internet of Things
- Cloud Computing
- DevOps
- Competitive Programming
- Youtube
- Resources
- Languages
Expand Down
66 changes: 27 additions & 39 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Thank you for taking the time to contribute to our project. Please take a moment

> For example, create a folder named `Resources`
- If you want to add a new subcategory, add it in [data.ts](https://github.com/rupali-codes/LinksHub/blob/main/database/data.ts) under the correct category, and provide the appropriate `url`. You can refer to the examples in the file.
- If you want to add a new subcategory, add it in [data.ts](https://github.com/rupali-codes/LinksHub/blob/main/database/data.ts) under the correct category, and provide the appropriate `URL`. You can refer to the examples in the file.

- Make sure to export the newly created JSON file in the index file.

Expand All @@ -61,7 +61,7 @@ Thank you for taking the time to contribute to our project. Please take a moment

> For example, if you export the subcategory name as `onlineCodeEditors` in `database/index.ts`, add the same name to `CategoryDescriptions.ts` using the following style:
> subcategoryName: 'description of this subcategory'
> subcategory name: 'description of this subcategory'
- You can check out similar examples [here](components/TopBar/CategoryDescriptions.ts). It's essential to add a description when submitting a pull request to add a subcategory; to merge it in the codebase.

Expand Down Expand Up @@ -100,7 +100,7 @@ Thank you for taking the time to contribute to our project. Please take a moment
- You can use [JSONLint](https://jsonlint.com/) to check the correctness of the JSON to avoid failing tests during pull requests.

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

> **⚠️Important**
>
Expand Down Expand Up @@ -152,33 +152,7 @@ When adding _YouTube_ channel link, please specify _the language_ of the channel
- 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.
- Use the `type: subject` format for writing your commit messages. `type` could be one of the following:
- `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: add _resource_name_ in _subcategory_name_ _category_name_ )
If you need more tips, check out [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
## Making Pull Requests
1. When you submit a pull request, several tests are automatically run
as GitHub Actions. If any of these tests fail, it is your responsibility to try and resolve the underlying issue(s). If you don't know how to resolve the underlying issue(s), you can ask for help.
2. Each pull request should contain a single logical change or related set of changes that make sense to submit together. If a pull request becomes too large or contains too many unrelated changes, it becomes too difficult to review. In such cases, the reviewer has the right to close your pull request and ask that you submit a separate pull request for each logical set of changes that belong together.
3. Link the issue you have resolved in the Pull Request Template (e.g. Closes/Fixes #99).
4. Use [Conventional commit messages](https://www.conventionalcommits.org/en/v1.0.0/) for your changes.
5. Do not re-open a pull request that a reviewer has closed.
- Make sure to tick the "Allow edits from maintainers" box. This allows us to directly make minor edits / refactors and saves a lot of time.
> **Note**
> If your pull request has merge conflicts with the `main` branch (GitHub checks for this automatically and notifies you), you are responsible for resolving them. You can do this by merging the `main` branch into your branch (`git pull upstream main`), and then pushing the updated branch to your fork (`git push`). If you need more tips, check out [Resolving a merge conflict on GitHub](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-on-github).
---
### Commit Message Guidelines using Commitlint
## Commits Message Guidelines
We follow a standardized commit message format using Commitlint to ensure consistency and clarity in our commit history. Each commit message should adhere to the following guidelines:
Expand All @@ -198,26 +172,24 @@ We follow a standardized commit message format using Commitlint to ensure consis
4. **Issue reference** (Optional): Include the issue number associated with the commit (e.g., `#123`).
### Examples:
#### Valid Commit Messages:
#### Examples of Valid Commit Messages:
- `feat: Add user authentication feature`
- `fix(auth): Resolve login page redirect issue`
- `docs: Update installation instructions`
- `style: Format code according to project guidelines`
- `fix(auth): Resolve login page redirect issue
- `docs: Update installation instructions
- `style: Format code according to project guidelines
- `refactor(navbar): Improve responsiveness`
- `test: Add unit tests for API endpoints`
- `chore: Update dependencies to latest versions`
- `chore: Update dependencies to latest versions
- `fix: Handle edge case in data processing (#456)`
#### Invalid Commit Messages:
#### Examples of Invalid Commit Messages:
- `Added new stuff`
- `Fixed a bug`
- `Updated code`
- `auth feature update`
- `chore: fixed some stuff`
- `chore: fixed some stuff
### Commit Example with Commitlint:
Expand All @@ -226,6 +198,22 @@ git commit -m "feat(auth): Implement user signup process (#789)"
```
<hr>
## Making Pull Requests
1. When you submit a pull request, several tests are automatically run
as GitHub Actions. If any of these tests fail, it is your responsibility to try and resolve the underlying issue(s). If you don't know how to resolve the underlying issue(s), you can ask for help.
2. Each pull request should contain a single logical change or related set of changes that make sense to submit together. If a pull request becomes too large or contains too many unrelated changes, it becomes too difficult to review. In such cases, the reviewer has the right to close your pull request and ask that you submit a separate pull request for each logical set of changes that belong together.
3. Link the issue you have resolved in the Pull Request Template (e.g. Closes/Fixes #99).
4. Use [Conventional commit messages](https://www.conventionalcommits.org/en/v1.0.0/) for your changes.
5. Do not re-open a pull request that a reviewer has closed.
- Make sure to tick the "Allow edits from maintainers" box. This allows us to directly make minor edits / refactors and saves a lot of time.
> **Note**
> If your pull request has merge conflicts with the `main` branch (GitHub checks for this automatically and notifies you), you are responsible for resolving them. You can do this by merging the `main` branch into your branch (`git pull upstream main`), and then pushing the updated branch to your fork (`git push`). If you need more tips, check out [Resolving a merge conflict on GitHub](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-on-github).
---
## Remarks ✅
- 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))
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ We recognize that there's a wealth of information available, but often, it's a m
- [Socials 📱](#socials-)
- [Getting Started 👩‍💻](#getting-started-)
- [Let's jump right in🌟](#lets-jump-right-in)
- [_Want to add your favourite links to the Hub? make sure to follow CONTRIBUTING guidelines._](#want-to-add-your-favourite-links-to-the-hub-make-sure-to-follow-contributing-guidelines)
- [_Want to add your favorite links to the Hub? make sure to follow CONTRIBUTING guidelines._](#want-to-add-your-favourite-links-to-the-hub-make-sure-to-follow-contributing-guidelines)
- [Want to add or update the descriptions of subcategories?](#want-to-add-or-update-the-descriptions-of-subcategories)
- [Building with Gitpod 💣](#building-with-gitpod-)
- [Top 50 Contributors ✨](#top-50-contributors-)
Expand Down Expand Up @@ -106,10 +106,10 @@ You can see the live demo at: https://linkshub.vercel.app
> ```
> 2. Start the docker container with:
> ```bash
> docker compose up
> docker-compose up
> ```
> 3. Now start adding your changes.
> **Note:** You don't need to restart the container again and again after starting it once, because the changes you make will reflect into the container instantly.
> **Note:** You don't need to restart the container again and again after starting it once, because the changes you make will reflect in the container instantly.
7. Make your changes before staging them.
Expand All @@ -135,7 +135,7 @@ You can see the live demo at: https://linkshub.vercel.app
> Click _compare across forks_ if you don't see your branch

#### _Want to add your favourite links to the Hub? make sure to follow [CONTRIBUTING guidelines](https://github.com/rupali-codes/linkshub/blob/main/CONTRIBUTING.md)._
#### _Want to add your favorite links to the Hub? make sure to follow [CONTRIBUTING guidelines](https://github.com/rupali-codes/linkshub/blob/main/CONTRIBUTING.md)._

#### Want to add or update the descriptions of subcategories?
Make sure to follow [CONTRIBUTING guidelines](./CONTRIBUTING.md#Adding-and-Updating-Category-Description-).
Expand All @@ -146,7 +146,7 @@ Make sure to follow [CONTRIBUTING guidelines](./CONTRIBUTING.md#Adding-and-Updat

## Building with Gitpod 💣

By using [Gitpod.io](https://www.gitpod.io), all the necessary dependencies will be installed
By using [Gitpod. io](https://www.gitpod.io), all the necessary dependencies will be installed
and the website will be built in one single click. No extra setup is required.

[![Gitpod Ready-to-Code](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/rupali-codes/LinksHub)
Expand Down Expand Up @@ -175,6 +175,6 @@ LinksHub is licensed under the terms of the MIT License. check out [LICENSE](htt
## 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 love to have you, feel free to open issues and pull requests, and Don't forget to leave a star⭐_

_We would be 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._
8 changes: 4 additions & 4 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The security policy covers the codebase and documentation of the open source pro

## Vulnerability Disclosure Process

The project will provide a dedicated email address (rupali7487@gmail.com) for submitting vulnerability reports related to the [Linkshub](https://linkshub.vercel.app/) website or any of the linked websites. Vulnerability reports will be reviewed and triaged by the project's maintainers. The owner will aim to respond to vulnerability reports within 72 hours, and will provide regular updates on the status of the vulnerability and any remediation efforts.
The project will provide a dedicated email address (rupali7487@gmail.com) for submitting vulnerability reports related to the [Linkshub](https://linkshub.vercel.app/) website or any of the linked websites. Vulnerability reports will be reviewed and triaged by the project's maintainers. The owner will aim to respond to vulnerability reports within 72 hours and will provide regular updates on the status of the vulnerability and any remediation efforts.

## Roles and Responsibilities

Expand All @@ -22,15 +22,15 @@ LinksHub will aim to resolve critical vulnerabilities within 30 days and non-cri

## Secure Coding Practices

LinksHub will provide guidance on secure coding practices for contributors, including guidelines for input validation, authentication, authorization, and data protection.
LinksHub will guide secure coding practices for contributors, including guidelines for input validation, authentication, authorization, and data protection.

## Regular Review and Update

The security policy will be regularly reviewed and updated to ensure that it remains effective and relevant. The maintainers will evaluate the vulnerability disclosure process, update secure coding guidelines, and revise the response timeline as needed.

## Disclosure Policy

LinksHub will follow a coordinated disclosure policy, which means that vulnerabilities will be disclosed publicly only after they have been remediated. The project may work with external website owners to coordinate disclosure of vulnerabilities that affect their websites.
LinksHub will follow a coordinated disclosure policy, which means that vulnerabilities will be disclosed publicly only after they have been remediated. The project may work with external website owners to coordinate the disclosure of vulnerabilities that affect their websites.

## Legal Disclaimer

Expand All @@ -40,4 +40,4 @@ The security policy includes a legal disclaimer that limits the liability of the

If you have any questions or concerns about the security policy or any security vulnerabilities in the project, please contact us at _linkshub.opensource@gmail.com_.

By implementing this security policy, we aim to ensure that vulnerabilities are addressed in a timely manner, and that users and contributors can use [Linkshub](https://linkshub.vercel.app/) and its linked sources safely and securely.
By implementing this security policy, we aim to ensure that vulnerabilities are addressed promptly and that users and contributors can use [Linkshub](https://linkshub.vercel.app/) and its linked sources safely and securely.
65 changes: 44 additions & 21 deletions components/CopyToClipboard/CopyToClipboard.tsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,56 @@
import useCopyToClipboard from 'hooks/useCopyToClipboard'
import React from 'react'
import { FaRegCopy } from 'react-icons/fa'
import { Tooltip } from 'react-tooltip'
import useCopyToClipboard from "hooks/useCopyToClipboard";
import React from "react";
import { FaRegCopy, FaCheckSquare } from "react-icons/fa";
import { Tooltip } from "react-tooltip";

type CopyToClipboardProps = {
url: string
}
url: string;
};

export const CopyToClipboard = ({ url }: CopyToClipboardProps): JSX.Element => {
const [copyToClipboard, { success }] = useCopyToClipboard()
const [copyToClipboard, { success }] = useCopyToClipboard();

function handleCopy(e: React.MouseEvent<SVGElement, MouseEvent>) {
e.stopPropagation()
copyToClipboard(url)
e.stopPropagation();
copyToClipboard(url);
}

return (
<div
className="dropdown dropdown-left dropdown-hover">
<div style={{ position: 'relative' }}>
<button data-tooltip-id="copy-tooltip" data-tooltip-content={success ? 'Copied!' : 'Copy'} data-tooltip-place="top">
<FaRegCopy
size={'1.3rem'}
className="text-theme-primary cursor-pointer"
onClick={(e) => handleCopy(e)}
/>
<div className="dropdown dropdown-left dropdown-hover">
<div style={{ position: "relative" }}>
<button
data-tooltip-id="copy-tooltip"
data-tooltip-content={success ? "Copied!" : "Copy"}
data-tooltip-place="top"
>
{success ? ( // Render the FaCheckSquare icon if success is true
<FaCheckSquare
size={"1.3rem"}
className="text-theme-primary cursor-pointer"
onClick={(e) => handleCopy(e)}
aria-label="Link copied" // Add aria-label for accessibility
/>
) : (
<FaRegCopy // Otherwise, render the default FaRegCopy icon
size={"1.3rem"}
className="text-theme-primary cursor-pointer"
onClick={(e) => handleCopy(e)}
aria-label="Copy link to clipboard" // Add aria-label for accessibility
/>
)}
</button>
<Tooltip id='copy-tooltip' style={{ backgroundColor: '#8b5cf6', fontSize: '13px', paddingLeft: '6px', paddingRight: '6px', paddingTop: '2px', paddingBottom: '2px' }} />
<Tooltip
id="copy-tooltip"
style={{
backgroundColor: "#8b5cf6",
fontSize: "13px",
paddingLeft: "6px",
paddingRight: "6px",
paddingTop: "2px",
paddingBottom: "2px",
}}
/>
</div>
</div>
)
}
);
}
14 changes: 14 additions & 0 deletions components/ErrorMessage/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
interface ErrorMessageProps {
children: React.ReactNode
className?: string | undefined
}

export const ErrorMessage: React.FC<ErrorMessageProps> = ({
children,
className,
}) => {
const defaultClasses = 'text-red-500 mt-2'
const classes = defaultClasses + ' ' + (className ?? '')

return <p className={classes}>{children}</p>
}
2 changes: 1 addition & 1 deletion components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const Footer: FC = () => {
<span>&copy; {new Date().getFullYear()} LinksHub | </span>
Developed by{' '}
<Link
href="https://linkfree.io/rupali-codes"
href="https://rupali-codes.vercel.app/"
target="_blank"
rel="noopener noreferrer"
aria-label="GitHub Profile of Rupali Haldiya"
Expand Down
2 changes: 1 addition & 1 deletion components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const Header: FC = () => {

return (
<header className="fixed top-0 left-0 z-30 row-start-1 row-end-2 flex h-[76px] w-screen items-center justify-between bg-light-primary dark:bg-dark">
<div className="bg-[rgba(255,255,255,0.3)] h-full w-fit flex-none px-6 py-4 dark:bg-dark lg:w-[290px]">
<div className="bg-light-primary h-full w-fit flex-none px-6 py-4 dark:bg-dark lg:w-[290px]">
<Link href="/" aria-label="LinksHub Logo">
<Logo className="text-3xl" />
</Link>
Expand Down
Loading

0 comments on commit 4f6d1a7

Please sign in to comment.