diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..2d58409 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,7 @@ +node_modules +.vinxi +.output +dist +build +*.md +public diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..ee81a88 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,10 @@ +{ + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "all", + "printWidth": 80, + "bracketSpacing": true, + "jsxSingleQuote": false, + "arrowParens": "always" +} diff --git a/bun.lockb b/bun.lockb index 58b1df9..2a35587 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 48e19dd..1739001 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,8 @@ "test": "vitest", "lint": "eslint . --ext .ts,.tsx,.js,.jsx", "lint:fix": "eslint . --ext .ts,.tsx,.js,.jsx --fix", + "format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css}\"", + "format:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json,css}\"", "version": "vinxi version" }, "dependencies": { @@ -32,9 +34,11 @@ "@typescript-eslint/parser": "^8.38.0", "autoprefixer": "^10.4.19", "eslint": "^9.32.0", + "eslint-config-prettier": "^10.1.8", "eslint-plugin-solid": "^0.14.5", "jsdom": "^26.0.0", "postcss": "^8.4.38", + "prettier": "^3.6.2", "tailwind-merge": "^2.3.0", "tailwindcss": "^3.4.3", "tailwindcss-animate": "^1.0.7", diff --git a/src/components/core/dialog-close-button.tsx b/src/components/core/dialog-close-button.tsx index 621fc1b..705c887 100644 --- a/src/components/core/dialog-close-button.tsx +++ b/src/components/core/dialog-close-button.tsx @@ -12,18 +12,18 @@ export const DialogCloseButton = (props: DialogCloseButtonProps) => { const imageVariantClasses = `${baseClasses} bg-white/95 backdrop-blur-sm border border-white/30 shadow-lg hover:scale-105` const modalVariantClasses = `${baseClasses} hover:scale-105` + const iconClasses = () => + props.variant === 'image' ? 'h-6 w-6 text-black' : 'h-6 w-6' + const classes = () => + props.variant === 'image' ? imageVariantClasses : modalVariantClasses + return ( - <> - {props.variant === 'image' ? ( - - - - ) : ( - - - - )} - + + + ) } diff --git a/src/components/core/nav.tsx b/src/components/core/nav.tsx index e23b34b..eb8f04b 100644 --- a/src/components/core/nav.tsx +++ b/src/components/core/nav.tsx @@ -11,8 +11,14 @@ const Nav = () => { const isActive = (hash: string) => hashname() === hash ? 'font-bold underline' : '' + // Hide nav on blog routes + const shouldShowNav = createMemo(() => !location.pathname.startsWith('/blog')) + return ( -