Skip to content

Commit

Permalink
feat(side menu init): core
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathancaleb committed Jun 19, 2024
1 parent 36a05ee commit a848363
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 55 deletions.
31 changes: 0 additions & 31 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ In this guide, you will get an overview of the project structure and setup, as w

- [Enoflow's contributing guidelines](#enoflows-contributing-guidelines)
- [Table of contents](#table-of-contents)
- [New contributor guide](#new-contributor-guide)
- [Getting your foot in](#getting-your-foot-in)
- [Some simple rules](#some-simple-rules)
- [The tech stack](#the-tech-stack)
- [Getting stuff running](#getting-stuff-running)
- [Cloning the repo](#cloning-the-repo)
Expand All @@ -21,34 +18,6 @@ In this guide, you will get an overview of the project structure and setup, as w
- [Environment Variables](#environment-variables)
- [Running stuff](#running-stuff)

## New contributor guide

Here are some resources to help you get started with open source contributions:

- [Finding ways to contribute to open source on GitHub](https://docs.github.com/en/get-started/exploring-projects-on-github/finding-ways-to-contribute-to-open-source-on-github)
- [Set up Git](https://docs.github.com/en/get-started/quickstart/set-up-git)
- [GitHub flow](https://docs.github.com/en/get-started/quickstart/github-flow)
- [Collaborating with pull requests](https://docs.github.com/en/github/collaborating-with-pull-requests)

## Getting your foot in

Our preferred way of providing the opportunity for people to contribute to Noodle is through a process that starts with creating a new issue, the summary of the workflow that you can expect and should adhere to is the following:

- You see an area of improvement in the code base, this could be a fix, feature, refactoring...etc
- Create an [issue](https://github.com/jonathancaleb/enoflow/issues) on our Github repository.
- Wait until a team member discusses the issue with you, and if both parties are in agreement, you can start working on the issue.
- Once work has started, you can create a draft pull request and remember to link your pull request with the issue.
- Once the work is complete, change the status of the pull request to ready for review.
- We will review the pull request and if all is good, congratulations! 🥳 you are now a Noodle contributor!
- If not, we will explain the changes that need to be made for the pull request to be merged or why it can't be merged.

### Some simple rules

- Don't work on an issue that is already being worked on by someone else.
- Don't work on something without getting a team member's approval, this is to not waste your time by making you work on something that won't be merged.
- Don't demand for your pull request to be approved and merged.
- Be nice to everyone involved, we are aiming to create a positive community around collaborating and contributing towards Enoflow's development.

## The tech stack

The Runtime:
Expand Down
Binary file modified bun.lockb
Binary file not shown.
50 changes: 26 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"description": "Rethinking Student Productivity",
"license": "AGPL-3.0-or-later",
"author": "Enoflow RUN LTD.",
"author": "caleb.",
"type": "module",
"scripts": {
"build": "next build",
Expand Down Expand Up @@ -54,7 +54,7 @@
}
},
"dependencies": {
"@clerk/nextjs": "^5.1.4",
"@clerk/nextjs": "^5.1.5",
"@clerk/themes": "^2.1.9",
"@hookform/resolvers": "^3.6.0",
"@neondatabase/serverless": "^0.9.3",
Expand All @@ -67,28 +67,30 @@
"@radix-ui/react-slot": "^1.0.2",
"@react-email/components": "^0.0.19",
"@t3-oss/env-nextjs": "^0.10.1",
"@tanstack/react-query": "^5.40.1",
"@tanstack/react-query": "^5.45.1",
"@trpc/client": "next",
"@trpc/react-query": "next",
"@trpc/server": "next",
"@upstash/redis": "^1.31.3",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"@upstash/redis": "^1.31.5",
"@vercel/analytics": "^1.3.1",
"@vercel/speed-insights": "^1.0.11",
"@vercel/speed-insights": "^1.0.12",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"drizzle-orm": "^0.31.2",
"drizzle-zod": "^0.5.1",
"geist": "^1.3.0",
"jiti": "^1.21.3",
"jiti": "^1.21.6",
"lucide-react": "^0.390.0",
"next": "14.2.3",
"next-mdx-remote": "^5.0.0",
"next-themes": "^0.3.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-email": "^2.1.4",
"react-hook-form": "^7.51.5",
"resend": "^3.2.0",
"react-hook-form": "^7.52.0",
"resend": "^3.3.0",
"server-only": "^0.0.1",
"sonner": "^1.5.0",
"superjson": "^2.2.1",
Expand All @@ -101,48 +103,48 @@
"@commitlint/config-conventional": "^19.2.2",
"@commitlint/cz-commitlint": "^19.2.0",
"@eslint-community/eslint-plugin-eslint-comments": "^4.3.0",
"@eslint/compat": "^1.0.3",
"@eslint/compat": "^1.1.0",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.4.0",
"@eslint/js": "^9.5.0",
"@happy-dom/global-registrator": "^14.12.0",
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
"@next/bundle-analyzer": "^14.2.3",
"@next/eslint-plugin-next": "^14.2.3",
"@next/bundle-analyzer": "^14.2.4",
"@next/eslint-plugin-next": "^14.2.4",
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/container-queries": "^0.1.1",
"@tailwindcss/typography": "^0.5.13",
"@total-typescript/ts-reset": "^0.5.1",
"@types/bun": "^1.1.3",
"@types/bun": "^1.1.4",
"@types/eslint": "^8.56.10",
"@types/eslint-config-prettier": "^6.11.3",
"@types/node": "^20.14.2",
"@types/node": "^20.14.5",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"commitizen": "^4.3.0",
"cspell": "^8.8.4",
"drizzle-kit": "^0.22.6",
"eslint": "^9.4.0",
"cspell": "^8.9.0",
"drizzle-kit": "^0.22.7",
"eslint": "^9.5.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jsdoc": "^48.2.9",
"eslint-plugin-jsdoc": "^48.2.12",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-react": "^7.34.2",
"eslint-plugin-react": "^7.34.3",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-regexp": "^2.6.0",
"eslint-plugin-security": "^3.0.0",
"eslint-plugin-security": "^3.0.1",
"eslint-plugin-tailwindcss": "^3.17.3",
"globals": "^15.4.0",
"globals": "^15.6.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.5",
"lint-staged": "^15.2.7",
"markdownlint": "^0.34.0",
"markdownlint-cli": "^0.41.0",
"postcss": "^8.4.38",
"prettier": "^3.3.1",
"prettier": "^3.3.2",
"prettier-plugin-curly": "^0.2.1",
"prettier-plugin-packagejson": "^2.5.0",
"tailwindcss": "^3.4.4",
"tailwindcss-animate": "^1.0.7",
"typescript": "^5.4.5",
"typescript-eslint": "^8.0.0-alpha.20"
"typescript-eslint": "^8.0.0-alpha.30"
},
"trustedDependencies": [
"@clerk/shared",
Expand Down
33 changes: 33 additions & 0 deletions src/app/(dashboard)/app/_components/active-button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
'use client';

import { cn } from '@/lib/utils';
import { Button } from '@/primitives/button';
import Link from 'next/link';
import { usePathname } from 'next/navigation';
import type { ReactNode } from 'react';

interface Props {
href: string;
label: string;
icon: ReactNode;
}

export function ActiveButton({ href, label, icon }: Props) {
const pathname = usePathname();

return (
<Button
variant="ghost"
className={cn(
'w-full justify-start gap-3 font-normal text-foreground-muted hover:text-foreground',
pathname === href && 'text-foreground',
)}
asChild
>
<Link href={href}>
{icon}
{label}
</Link>
</Button>
);
}
62 changes: 62 additions & 0 deletions src/app/(dashboard)/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import {
DiamondIcon,
HomeIcon,
ListChecksIcon,
PenLineIcon,
PuzzleIcon,
} from 'lucide-react';
import Image from 'next/image';
import type { PropsWithChildren } from 'react';
import { ActiveButton } from './_components/active-button';

const iconSize = 15;

const sideMenuStaticLinks = [
{
icon: <HomeIcon size={iconSize} />,
label: 'Home',
href: '/app',
},
{
icon: <PuzzleIcon size={iconSize} />,
label: 'Modules',
href: '/modules',
},
{
icon: <ListChecksIcon size={iconSize} />,
label: 'Tasks',
href: '/tasks',
},
{
icon: <PenLineIcon size={iconSize} />,
label: 'Notebooks',
href: '/notes',
},
{
icon: <DiamondIcon size={iconSize} />,
label: 'Flashcards',
href: '/flashcards',
},
];

export default function AppLayout({ children }: PropsWithChildren) {
return (
<main className="flex min-h-dvh gap-8 p-4">
<aside className="w-[220px]">
<div className="flex items-center gap-3 pl-3 pt-4">
<Image src="/logo.png" width={35} height={35} alt="Noodle Logo" />
<span>Noodle</span>
</div>

<ul className="mt-8">
{sideMenuStaticLinks.map(({ icon, label, href }) => (
<li key={label}>
<ActiveButton icon={icon} label={label} href={href} />
</li>
))}
</ul>
</aside>
<div className="flex-1 rounded-lg border p-6">{children}</div>
</main>
);
}
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"strict": true,
"strictNullChecks": true,
"allowUnusedLabels": false,
"allowUnreachableCode": false,
"exactOptionalPropertyTypes": true,
Expand Down

0 comments on commit a848363

Please sign in to comment.