diff --git a/web/package.json b/web/package.json index 2080016..a001a0d 100644 --- a/web/package.json +++ b/web/package.json @@ -1,4 +1,6 @@ { + + "license": "MIT", "scripts": { "dev": "vite --mode ssr", "build": "qwik build", @@ -9,25 +11,34 @@ "dev.debug": "node --inspect-brk ./node_modules/vite/bin/vite.js --mode ssr --force", "fmt": "prettier --write .", "fmt.check": "prettier --check .", - "lint": "eslint \"src/**/*.ts*\"", + "lint": "eslint \"src/**/*.ts*\" -f compact", "preview": "qwik build preview && vite preview --open", "start": "vite --open --mode ssr", "qwik": "qwik" }, "devDependencies": { "@builder.io/qwik-city": "^1.1.4", + "@types/node": "^20.11.16", + "@typescript-eslint/eslint-plugin": "^6.20.0", + "@typescript-eslint/parser": "^6.20.0", "autoprefixer": "^10.4.13", "daisyui": "^3.0.2", + "eslint": "^8.56.0", + "eslint-plugin-qwik": "^1.4.3", "postcss": "^8.4.21", "tailwindcss": "^3.2.4", "typescript": "^5.3.3", "undici": "^5.16.0", "vite": "^4.0.4", + "vite-plugin-static-copy": "^1.0.1", "vite-tsconfig-paths": "^4.3.1" }, "dependencies": { "@builder.io/qwik": "^1.1.4", "marked": "^12.0.0", "sharp": "^0.33.2" + }, + "resolutions": { + "sharp": "^0.33.2" } } diff --git a/web/src/components/core/icon.tsx b/web/src/components/core/icon.tsx index e63a81d..054db3d 100644 --- a/web/src/components/core/icon.tsx +++ b/web/src/components/core/icon.tsx @@ -99,16 +99,33 @@ const getSvgPath = (icon: string) => { } }; + + + +const makeFillColor = (props: IconProps) => { + const isColorKey = (color: any): color is keyof typeof colors => color in colors; + + let colorValue = 'currentcolor'; + if (props.color && isColorKey(props.color)) { + const colorObject = colors[props.color]; + if (colorObject[400]) { + colorValue = colorObject[400]; + } + } + return colorValue; +}; + + interface IconProps { icon: string; color?: string; class?: string; width?: number; height?: number; -}; +} const IconComponent = component$((props: IconProps) => { - const fillColor = (colors[props.color] || [])[400] || colors['current'].currentColor || 'currentcolor'; + const fillColor = makeFillColor(props); const svgStyle = { fill: fillColor }; const { vb, path } = getSvgPath(props.icon); const svgClass = props.class || ''; diff --git a/web/src/components/furniture/hero.tsx b/web/src/components/furniture/hero.tsx index c0acc04..d2eda3e 100644 --- a/web/src/components/furniture/hero.tsx +++ b/web/src/components/furniture/hero.tsx @@ -9,7 +9,7 @@ export default component$(() => {