From 8b44da35abd87de9be851e15b864515ed39ea3a5 Mon Sep 17 00:00:00 2001 From: Mathias Schopmans Date: Mon, 12 Feb 2024 16:16:27 +0100 Subject: [PATCH] chore: add icon components via svgr/cli --- .gitignore | 5 +++-- package-lock.json | 1 + package.json | 4 +++- .../Navigation/Navigation.module.css | 7 +++++++ src/components/Navigation/Navigation.tsx | 20 ++++++++++++++++--- src/icons/back.svg | 4 +--- src/icons/blip_changed.svg | 1 + src/icons/blip_default.svg | 1 + src/icons/blip_new.svg | 1 + src/icons/close.svg | 1 + src/icons/filter.svg | 1 + src/icons/overview.svg | 1 + src/icons/pie.svg | 1 + src/icons/question.svg | 1 + src/icons/search.svg | 1 + 15 files changed, 41 insertions(+), 9 deletions(-) create mode 100644 src/icons/blip_changed.svg create mode 100644 src/icons/blip_default.svg create mode 100644 src/icons/blip_new.svg create mode 100644 src/icons/close.svg create mode 100644 src/icons/filter.svg create mode 100644 src/icons/overview.svg create mode 100644 src/icons/pie.svg create mode 100644 src/icons/question.svg create mode 100644 src/icons/search.svg diff --git a/.gitignore b/.gitignore index fd3dbb5..b6eac3f 100644 --- a/.gitignore +++ b/.gitignore @@ -13,8 +13,8 @@ /.next/ /out/ -# production -/build +# generated +/src/components/Icons/ # misc .DS_Store @@ -34,3 +34,4 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts + diff --git a/package-lock.json b/package-lock.json index b020976..c86ce0d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,7 @@ "": { "name": "aoe-next-techradar", "version": "0.1.0", + "hasInstallScript": true, "dependencies": { "clsx": "^2.1.0", "next": "14.1.0", diff --git a/package.json b/package.json index c4b9be1..35da2ad 100644 --- a/package.json +++ b/package.json @@ -4,11 +4,13 @@ "private": true, "scripts": { "dev": "next dev --turbo", + "build:icons": "npx @svgr/cli --typescript --no-prettier --out-dir src/components/Icons -- src/icons", "build": "next build", "start": "next start", "lint": "next lint", "fix": "prettier . --write", - "prepare": "husky" + "prepare": "husky", + "postinstall": "npm run build:icons" }, "dependencies": { "clsx": "^2.1.0", diff --git a/src/components/Navigation/Navigation.module.css b/src/components/Navigation/Navigation.module.css index 2633c7d..639c8e6 100644 --- a/src/components/Navigation/Navigation.module.css +++ b/src/components/Navigation/Navigation.module.css @@ -4,3 +4,10 @@ gap: 16px; font-size: 14px; } + +.icon { + display: inline-block; + vertical-align: middle; + width: 22px; + margin: 0 10px 0 0; +} diff --git a/src/components/Navigation/Navigation.tsx b/src/components/Navigation/Navigation.tsx index a36c664..cf6774f 100644 --- a/src/components/Navigation/Navigation.tsx +++ b/src/components/Navigation/Navigation.tsx @@ -2,6 +2,10 @@ import Link from "next/link"; import styles from "./Navigation.module.css"; +import IconFilter from "@/components/Icons/Filter"; +import IconOverview from "@/components/Icons/Overview"; +import IconQuestion from "@/components/Icons/Question"; +import IconSearch from "@/components/Icons/Search"; import { getAppName } from "@/lib/config"; export function Navigation() { @@ -10,14 +14,24 @@ export function Navigation() { ); diff --git a/src/icons/back.svg b/src/icons/back.svg index 9cf8150..92edf16 100644 --- a/src/icons/back.svg +++ b/src/icons/back.svg @@ -1,3 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/icons/blip_changed.svg b/src/icons/blip_changed.svg new file mode 100644 index 0000000..94cacfd --- /dev/null +++ b/src/icons/blip_changed.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/blip_default.svg b/src/icons/blip_default.svg new file mode 100644 index 0000000..049a4e3 --- /dev/null +++ b/src/icons/blip_default.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/blip_new.svg b/src/icons/blip_new.svg new file mode 100644 index 0000000..acc3c70 --- /dev/null +++ b/src/icons/blip_new.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/close.svg b/src/icons/close.svg new file mode 100644 index 0000000..a0947af --- /dev/null +++ b/src/icons/close.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/filter.svg b/src/icons/filter.svg new file mode 100644 index 0000000..e3caec5 --- /dev/null +++ b/src/icons/filter.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/overview.svg b/src/icons/overview.svg new file mode 100644 index 0000000..4112a51 --- /dev/null +++ b/src/icons/overview.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/pie.svg b/src/icons/pie.svg new file mode 100644 index 0000000..42a0124 --- /dev/null +++ b/src/icons/pie.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/question.svg b/src/icons/question.svg new file mode 100644 index 0000000..eb8eb09 --- /dev/null +++ b/src/icons/question.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/search.svg b/src/icons/search.svg new file mode 100644 index 0000000..e515fcf --- /dev/null +++ b/src/icons/search.svg @@ -0,0 +1 @@ + \ No newline at end of file