Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rajneesh-18 committed Oct 3, 2024
2 parents 60af308 + 78a6211 commit f3b285e
Show file tree
Hide file tree
Showing 61 changed files with 1,273 additions and 913 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/check_links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ jobs:
# Permissions (issues: write)
- name: 'Create a new issue, or update an existing one'
if: ${{ failure() }}


uses: peter-evans/create-issue-from-file@v5

with:
title: 'docs: Broken links found'
content-filepath: ${{ env.issue-content }}
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/compliance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "Compliance"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: write

jobs:
compliance:
uses: open-sauced/hot/.github/workflows/compliance.yml@main
16 changes: 11 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,19 @@ Follow these steps to setup LinksHub on your local machine
> cd LinksHub/
> ```
>
> 2. Start the docker container with:
> 2. Pull the image from docker hub:
>
> ```bash
> docker-compose up
> docker pull linkshub/app
> ```
>
> 3. Now start adding your changes.
> 3. Start the docker container with:
>
> ```bash
> docker compose up
> ```
>
> 4. 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 in the container instantly.
7. Make your changes before staging them.
Expand Down Expand Up @@ -299,9 +305,9 @@ git commit -m "feat(auth): Implement user signup process (#789)"

## 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))
- 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/rupali-codes/LinksHub/blob/main/CODE_OF_CONDUCT.md))

- You can tag maintainers for any kind of difficulty using `@username`. You can find the list of maintainer usernames [here](https://github.com/rupali-codes/LinksHub/blob/maintainers_info/README.md#maintainers-).
- You can tag maintainers for any kind of difficulty using `@username`. You can find the list of maintainer usernames [here](https://github.com/rupali-codes/LinksHub/blob/main/README.md#maintainers-).

### Levels

Expand Down
22 changes: 15 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
FROM node:lts-slim

RUN npm install -g pnpm
FROM node:18

# Set the working directory
WORKDIR /app
EXPOSE 3000

# Copy the package.json and pnpm-lock.yaml
COPY package.json pnpm-lock.yaml ./
# Copy package.json and package-lock.json
COPY package.json ./
COPY pnpm-lock.yaml ./

RUN npm run dev-setup
# Install dependencies
RUN npm install -g pnpm
RUN pnpm install

# Copy the rest of your application
COPY . .

# Expose the port the app runs on
EXPOSE 3000

# Run the application
CMD ["pnpm", "dev"]
2 changes: 1 addition & 1 deletion components/Cards/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const Card: FC<CardProps> = ({ data, onClick }) => {
}, [])

return (
<article className="z-10 h-full w-full rounded-3xl dark:bg-slate-800 dark:text-text-primary dark:shadow-sm bg-light-white">
<article className="z-10 h-full border border-theme-secondary/25 dark:border dark:border-theme-primary dark:border-opacity-8 w-full rounded-3xl dark:bg-slate-800 dark:text-text-primary dark:shadow-sm bg-theme-primary-light">
<div className="card-body">
<header className="flex justify-between items-center gap-2">
<h2
Expand Down
6 changes: 2 additions & 4 deletions components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ export const Header: FC = () => {
{
inActiveIcon: <Icons.teamInactive className={inActiveIconCls} />,
activeIcon: <Icons.teamActive className={activeIconCls} />,
label: 'Our Team',
label: 'Team',
href: '/contributors',
isDisabled: false,
},
}
]

const renderLinks = () =>
Expand All @@ -71,7 +71,6 @@ export const Header: FC = () => {
const isActive = label === 'Home' ? isHomeActive : isUrlMatched

return (
<>
<li key={i}>
<a
href={href}
Expand All @@ -85,7 +84,6 @@ export const Header: FC = () => {
<span>{label}</span>
</a>
</li>
</>
)
})

Expand Down
73 changes: 41 additions & 32 deletions components/SideNavbar/SideNavbarCategory.tsx
Original file line number Diff line number Diff line change
@@ -1,56 +1,65 @@
import { FC, useState, useEffect, MutableRefObject } from 'react'
import { useRouter } from 'next/router'
import Link from 'next/link'
import { FC, useState, useEffect, MutableRefObject } from 'react';
import { useRouter } from 'next/router';
import Link from 'next/link';

import { SideNavbarElement } from './SideNavbarElement'
import { SideNavbarElement } from './SideNavbarElement';

import useOnClickOutside from 'hooks/useOnClickOutside'
import type { ISidebar } from '../../types'
import useOnClickOutside from 'hooks/useOnClickOutside';
import type { ISidebar } from '../../types';

import { Icons } from 'components/icons'
import { Icons } from 'components/icons';

const categoriesToUppercase = ['ai'];
const exceptions: Record<string, string> = {
youtube: 'YouTube',
};

const capitalizeCategory = (category: string) => {
const lowerCaseCategory = category.toLowerCase();

if (exceptions[lowerCaseCategory]) {
return exceptions[lowerCaseCategory];
}

const capitalizeCategory =(category: string) =>{
return category
.split('-')
.map(word => categoriesToUppercase.includes(word.toLowerCase())
? word.toUpperCase()
: word.charAt(0).toUpperCase() + word.slice(1)
)
.join(' ');

}
.map(word =>
categoriesToUppercase.includes(word.toLowerCase())
? word.toUpperCase()
: word.charAt(0).toUpperCase() + word.slice(1)
)
.join(' ');
};

export const SideNavbarCategory: FC<{
categoryData: ISidebar
expand: boolean
listRef: MutableRefObject<HTMLUListElement | null>
categoryData: ISidebar;
expand: boolean;
listRef: MutableRefObject<HTMLUListElement | null>;
}> = ({ categoryData, expand, listRef }) => {
const [isOpen, setIsOpen] = useState(expand)
const router = useRouter()
const { category, subcategory } = categoryData
const [isOpen, setIsOpen] = useState(expand);
const router = useRouter();
const { category, subcategory } = categoryData;
const sortedSubcategoryList = subcategory
.sort((a, b) => (a.name.toUpperCase() < b.name.toUpperCase() ? -1 : 1))
.map((subcategoryData, i) => (
<li className="-ml-0.5" key={i}>
<SideNavbarElement category={category} subcat={subcategoryData} />
</li>
))
));

useEffect(() => {
setIsOpen(expand)
}, [expand])
setIsOpen(expand);
}, [expand]);

const handleToggle = () => {
setIsOpen(!isOpen)
}
setIsOpen(!isOpen);
};

const handleClickOutside = async () => {
setIsOpen(false)
router.replace('/')
}
useOnClickOutside(listRef, handleClickOutside)
setIsOpen(false);
router.replace('/');
};
useOnClickOutside(listRef, handleClickOutside);

return (
<li className="w-full transition-all ease-in-out text-primary dark:text-theme-primary dark:bg-opacity-5 hover:text-theme-secondary dark:hover:text-theme-primary rounded-md focus-visible:outline-none focus-visible:ring focus-visible:ring-theme-primary">
Expand Down Expand Up @@ -81,5 +90,5 @@ export const SideNavbarCategory: FC<{
<ul className="">{sortedSubcategoryList}</ul>
</div>
</li>
)
}
);
};
Loading

0 comments on commit f3b285e

Please sign in to comment.