From c2623d19193e6fa795533c4ec28fca7d3bf323a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20In=C3=A1cio=20Neto?= Date: Thu, 1 Aug 2024 15:12:19 +0000 Subject: [PATCH 1/4] chore: Add GitHub link in Navbar component --- src/components/navbar.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/navbar.tsx b/src/components/navbar.tsx index 0b0edca..ab606d5 100644 --- a/src/components/navbar.tsx +++ b/src/components/navbar.tsx @@ -1,5 +1,6 @@ 'use client'; +import { IconBrandGithub } from '@tabler/icons-react'; import c from 'clsx'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; @@ -9,17 +10,19 @@ type ItemMenuProps = { children: ReactNode; href: string; active?: boolean; + icon?: ReactNode; }; -function ItemMenu({ children, href, active }: ItemMenuProps) { +function ItemMenu({ children, href, active, icon }: ItemMenuProps) { return ( + {icon && {icon}} {children} ); @@ -32,7 +35,8 @@ export default function NavBar() { { label: 'criadores', href: '/criadores' }, { label: 'projetos', href: '/projetos' }, { label: 'ideias', href: '/ideias' }, - { label: 'sobre', href: '/sobre' } + { label: 'sobre', href: '/sobre' }, + { href: 'https://github.com/Indie-Hackers-Brasil/website', icon: } ]; return ( @@ -46,7 +50,7 @@ export default function NavBar() { const active = pathname === item.href; return ( - + {item.label} ); From 4c405f7aee370d03d36d03711fe2ac40128ac589 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20In=C3=A1cio=20Neto?= Date: Thu, 1 Aug 2024 15:12:50 +0000 Subject: [PATCH 2/4] feat: Install eslint sort plugin and @tabler/icons-react --- .eslintrc.json | 10 ++++++++-- package-lock.json | 35 +++++++++++++++++++++++++++++++++++ package.json | 2 ++ src/app/layout.tsx | 6 ++++-- 4 files changed, 49 insertions(+), 4 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index bf8fe13..3c48a0f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -6,10 +6,16 @@ "prettier" ], "parser": "@typescript-eslint/parser", - "plugins": ["tailwindcss", "@typescript-eslint"], + "parserOptions": { + "sourceType": "module", + "ecmaVersion": "latest" + }, + "plugins": ["tailwindcss", "@typescript-eslint", "simple-import-sort"], "rules": { "@typescript-eslint/no-explicit-any": 0, "no-unused-vars": 1, - "no-console": 1 + "no-console": 1, + "simple-import-sort/imports": "error", + "simple-import-sort/exports": "error" } } diff --git a/package-lock.json b/package-lock.json index 1afc705..e8b19f3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "name": "indiehackersbrazil", "version": "0.1.0", "dependencies": { + "@tabler/icons-react": "^3.11.0", "clsx": "^2.1.1", "next": "15.0.0-rc.0", "react": "19.0.0-rc-f994737d14-20240522", @@ -23,6 +24,7 @@ "eslint-config": "^0.3.0", "eslint-config-next": "^14.2.5", "eslint-config-prettier": "^9.1.0", + "eslint-plugin-simple-import-sort": "^12.1.1", "eslint-plugin-tailwindcss": "^3.17.4", "postcss": "^8", "prettier": "^3.3.3", @@ -1808,6 +1810,30 @@ "tslib": "^2.4.0" } }, + "node_modules/@tabler/icons": { + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/@tabler/icons/-/icons-3.11.0.tgz", + "integrity": "sha512-/vZinJNvCYhdAB+RUsyCpanSPuOEKHHIZi4Uu0Bw7ilewHnQhCWUPrT704uHCRli2ROl7spADPmWzAqOganA5A==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/codecalm" + } + }, + "node_modules/@tabler/icons-react": { + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/@tabler/icons-react/-/icons-react-3.11.0.tgz", + "integrity": "sha512-xHNBi9mns1slvqos+7LkP3ube4CjWrANMbxMaorzwzO9J/+y1sAEG/sN8CV8FmtpYW/9/gDR+OWCjjLLg0RmAw==", + "dependencies": { + "@tabler/icons": "3.11.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/codecalm" + }, + "peerDependencies": { + "react": ">= 16" + } + }, "node_modules/@tootallnate/once": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", @@ -6658,6 +6684,15 @@ "semver": "bin/semver.js" } }, + "node_modules/eslint-plugin-simple-import-sort": { + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-12.1.1.tgz", + "integrity": "sha512-6nuzu4xwQtE3332Uz0to+TxDQYRLTKRESSc2hefVT48Zc8JthmN23Gx9lnYhu0FtkRSL1oxny3kJ2aveVhmOVA==", + "dev": true, + "peerDependencies": { + "eslint": ">=5.0.0" + } + }, "node_modules/eslint-plugin-tailwindcss": { "version": "3.17.4", "resolved": "https://registry.npmjs.org/eslint-plugin-tailwindcss/-/eslint-plugin-tailwindcss-3.17.4.tgz", diff --git a/package.json b/package.json index 3f46dfe..24a99fc 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "format:check": "prettier --check ." }, "dependencies": { + "@tabler/icons-react": "^3.11.0", "clsx": "^2.1.1", "next": "15.0.0-rc.0", "react": "19.0.0-rc-f994737d14-20240522", @@ -26,6 +27,7 @@ "eslint-config": "^0.3.0", "eslint-config-next": "^14.2.5", "eslint-config-prettier": "^9.1.0", + "eslint-plugin-simple-import-sort": "^12.1.1", "eslint-plugin-tailwindcss": "^3.17.4", "postcss": "^8", "prettier": "^3.3.3", diff --git a/src/app/layout.tsx b/src/app/layout.tsx index adcd1d5..ce79ddb 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,7 +1,9 @@ -import NavBar from '@/components/navbar'; +import './globals.css'; + import type { Metadata } from 'next'; import type { ReactNode } from 'react'; -import './globals.css'; + +import NavBar from '@/components/navbar'; export const metadata: Metadata = { title: 'Indie Hackers Brazil', From f184fb2714801e8274f627697eceeae8e0997c42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20In=C3=A1cio=20Neto?= Date: Thu, 1 Aug 2024 17:06:48 +0000 Subject: [PATCH 3/4] fix: build and lint error --- .github/workflows/ci_build.yml | 2 +- .github/workflows/ci_lint.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_build.yml b/.github/workflows/ci_build.yml index 47d7bb1..54bd366 100644 --- a/.github/workflows/ci_build.yml +++ b/.github/workflows/ci_build.yml @@ -31,7 +31,7 @@ jobs: restore-keys: npm-linux- - name: ๐Ÿ“ฆ Installing Dependencies - run: npm ci + run: npm ci --force - name: ๐Ÿคน๐Ÿปโ€โ™€๏ธ Building the Project run: npm run build diff --git a/.github/workflows/ci_lint.yml b/.github/workflows/ci_lint.yml index b41cbd6..818b7f1 100644 --- a/.github/workflows/ci_lint.yml +++ b/.github/workflows/ci_lint.yml @@ -31,7 +31,7 @@ jobs: restore-keys: npm-linux- - name: ๐Ÿ“ฆ Installing Dependencies - run: npm ci + run: npm ci --force - name: ๐Ÿ‘” ESLint + Prettier Check run: npm run lint && npm run format:check From 3f16209229dd0d9fc45166a9331862ef32e3bed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20In=C3=A1cio=20Neto?= Date: Thu, 1 Aug 2024 18:33:37 +0000 Subject: [PATCH 4/4] fix: lint --- .eslintrc.json | 2 +- src/components/navbar.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 3c48a0f..eee507f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -15,7 +15,7 @@ "@typescript-eslint/no-explicit-any": 0, "no-unused-vars": 1, "no-console": 1, - "simple-import-sort/imports": "error", + "simple-import-sort/imports": "error", "simple-import-sort/exports": "error" } } diff --git a/src/components/navbar.tsx b/src/components/navbar.tsx index ab606d5..c526021 100644 --- a/src/components/navbar.tsx +++ b/src/components/navbar.tsx @@ -36,7 +36,7 @@ export default function NavBar() { { label: 'projetos', href: '/projetos' }, { label: 'ideias', href: '/ideias' }, { label: 'sobre', href: '/sobre' }, - { href: 'https://github.com/Indie-Hackers-Brasil/website', icon: } + { href: 'https://github.com/Indie-Hackers-Brasil/website', icon: } ]; return (