From 2124753096b7806e9ca72e8fea6debedee4e3680 Mon Sep 17 00:00:00 2001 From: EGOIST Date: Sat, 28 May 2022 16:35:48 +0800 Subject: [PATCH] update icons --- next.config.js | 7 +- package.json | 6 +- pnpm-lock.yaml | 57 +++++---------- src/components/dashboard/DashboardLayout.tsx | 73 +++----------------- src/components/main/MainLayout.tsx | 26 +------ src/components/site/SiteHome.tsx | 2 +- src/components/ui/EmptyState.tsx | 11 +-- src/pages/index.tsx | 2 +- uno.config.ts | 6 +- 9 files changed, 47 insertions(+), 143 deletions(-) diff --git a/next.config.js b/next.config.js index fb485499..e08cb920 100644 --- a/next.config.js +++ b/next.config.js @@ -9,12 +9,13 @@ class UnoCSS { */ apply(compiler) { compiler.hooks.beforeRun.tapPromise("unocss", async () => { + if (globalThis.uno_built) return + globalThis.uno_watching = true spawn.sync("pnpm", ["uno-generate"], { stdio: "inherit" }) }) - let watching = false compiler.hooks.watchRun.tap("unocss", () => { - if (watching) return - watching = true + if (globalThis.uno_watching) return + globalThis.uno_watching = true spawn("pnpm", ["uno-generate", "--watch"], { stdio: "inherit" }) }) } diff --git a/package.json b/package.json index 3e94a6a9..07608f51 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "db-generate": "prisma generate", "start": "node server.js", "db-seed": "node -r esbuild-register prisma/seed.ts", - "uno-generate": "unocss src/**/*.{ts,tsx} -o src/generated/uno.css" + "uno-generate": "unocss \"src/**/*.{ts,tsx}\" -o src/generated/uno.css" }, "dependencies": { "@codemirror/commands": "^0.20.0", @@ -21,8 +21,6 @@ "@codemirror/state": "^0.20.0", "@codemirror/view": "^0.20.3", "@headlessui/react": "^1.6.0", - "@iconify/icons-mdi": "^1.2.15", - "@iconify/react": "^3.2.1", "@prisma/client": "^3.14.0", "@proselog/jwt": "^0.1.1", "@trpc/client": "^9.23.2", @@ -71,7 +69,9 @@ "zustand": "4.0.0-rc.1" }, "devDependencies": { + "@iconify-json/bi": "^1.1.3", "@iconify-json/bxs": "^1.1.2", + "@iconify-json/carbon": "^1.1.5", "@iconify-json/fluent": "^1.1.8", "@iconify-json/mdi": "^1.1.19", "@playwright/test": "^1.22.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7f16ba28..41837b69 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,11 +7,11 @@ specifiers: '@codemirror/state': ^0.20.0 '@codemirror/view': ^0.20.3 '@headlessui/react': ^1.6.0 + '@iconify-json/bi': ^1.1.3 '@iconify-json/bxs': ^1.1.2 + '@iconify-json/carbon': ^1.1.5 '@iconify-json/fluent': ^1.1.8 '@iconify-json/mdi': ^1.1.19 - '@iconify/icons-mdi': ^1.2.15 - '@iconify/react': ^3.2.1 '@playwright/test': ^1.22.1 '@prisma/client': ^3.14.0 '@proselog/jwt': ^0.1.1 @@ -94,8 +94,6 @@ dependencies: '@codemirror/state': 0.20.0 '@codemirror/view': 0.20.4 '@headlessui/react': 1.6.1_ef5jwxihqo6n7gxfmzogljlgcm - '@iconify/icons-mdi': 1.2.15 - '@iconify/react': 3.2.1 '@prisma/client': 3.14.0_prisma@3.14.0 '@proselog/jwt': 0.1.1 '@trpc/client': 9.23.2_@trpc+server@9.23.2 @@ -144,7 +142,9 @@ dependencies: zustand: 4.0.0-rc.1_react@18.1.0 devDependencies: + '@iconify-json/bi': 1.1.3 '@iconify-json/bxs': 1.1.2 + '@iconify-json/carbon': 1.1.5 '@iconify-json/fluent': 1.1.8 '@iconify-json/mdi': 1.1.19 '@playwright/test': 1.22.1 @@ -506,12 +506,24 @@ packages: resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} dev: true + /@iconify-json/bi/1.1.3: + resolution: {integrity: sha512-uM5u+nJg6O4O02/tmS1ru8j5aS+/4ORz3691ZRZ+Dm02CtLTWeAKzYBiDmcYXxKWOR2i7OzDl0511mkzxmSkHw==} + dependencies: + '@iconify/types': 1.1.0 + dev: true + /@iconify-json/bxs/1.1.2: resolution: {integrity: sha512-/X198mJhvhd9ifFDGOnt5jKzmuLEuH4DOTlM9amC4OGoaCVty1M5GSn/iBl0mqOibGrOkyYeQx37wKKvR5iIYQ==} dependencies: '@iconify/types': 1.1.0 dev: true + /@iconify-json/carbon/1.1.5: + resolution: {integrity: sha512-ENl8CIEo+7JcRzpJ/58i+dDc3fkNOO7gyNGg4S4JN5cAiVpvltYTVO86Oei7rpl8bKypJ0vk3B0BbzzTw7DclA==} + dependencies: + '@iconify/types': 1.1.0 + dev: true + /@iconify-json/fluent/1.1.8: resolution: {integrity: sha512-Bl6PvVtaksVF83U/amDcbxylg05X+XDJqW63bG70z288fnQ4eE34Y66IizGDX2fkFuDEwn7np4GbobMGAcxtBw==} dependencies: @@ -524,18 +536,9 @@ packages: '@iconify/types': 1.1.0 dev: true - /@iconify/icons-mdi/1.2.15: - resolution: {integrity: sha512-cpmRpW3AOou6+WN16QQwSAlv1seD1m7iqoO8JP+igHeZbUsx9e1FJbfPPUixhsdBBJtEYAnVAauMH+3VyXLFRw==} - dependencies: - '@iconify/types': 1.1.0 - dev: false - - /@iconify/react/3.2.1: - resolution: {integrity: sha512-yKzixjC9ct9RC/aSGo1OGxkG2rpfhlr/urRz6k2YZlIBzn92PBTlqtSx8o8dFYEorr3eUFSCBZFzBy1yw5jsAA==} - dev: false - /@iconify/types/1.1.0: resolution: {integrity: sha512-Jh0llaK2LRXQoYsorIH8maClebsnzTcve+7U3rQUSnC11X4jtPnFuyatqFLvMxZ8MLG8dB4zfHsbPfuvxluONw==} + dev: true /@iconify/utils/1.0.32: resolution: {integrity: sha512-m+rnw7qKHq/XF7DAi4BcFoEAcXBfqqMgQJh8brGEHeqE/RUvgDMjmxsHgWnVpFsG+VmjGyAiI7nwXdliCwEU0Q==} @@ -613,7 +616,6 @@ packages: /@next/env/12.1.6: resolution: {integrity: sha512-Te/OBDXFSodPU6jlXYPAXpmZr/AkG6DCATAxttQxqOWaq6eDFX25Db3dK0120GZrSZmv4QCe9KsZmJKDbWs4OA==} - dev: false /@next/eslint-plugin-next/12.1.6: resolution: {integrity: sha512-yNUtJ90NEiYFT6TJnNyofKMPYqirKDwpahcbxBgSIuABwYOdkGwzos1ZkYD51Qf0diYwpQZBeVqElTk7Q2WNqw==} @@ -627,7 +629,6 @@ packages: cpu: [arm] os: [android] requiresBuild: true - dev: false optional: true /@next/swc-android-arm64/12.1.6: @@ -636,7 +637,6 @@ packages: cpu: [arm64] os: [android] requiresBuild: true - dev: false optional: true /@next/swc-darwin-arm64/12.1.6: @@ -645,7 +645,6 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true - dev: false optional: true /@next/swc-darwin-x64/12.1.6: @@ -654,7 +653,6 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true - dev: false optional: true /@next/swc-linux-arm-gnueabihf/12.1.6: @@ -663,7 +661,6 @@ packages: cpu: [arm] os: [linux] requiresBuild: true - dev: false optional: true /@next/swc-linux-arm64-gnu/12.1.6: @@ -672,7 +669,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: false optional: true /@next/swc-linux-arm64-musl/12.1.6: @@ -681,7 +677,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: false optional: true /@next/swc-linux-x64-gnu/12.1.6: @@ -690,7 +685,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: false optional: true /@next/swc-linux-x64-musl/12.1.6: @@ -699,7 +693,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: false optional: true /@next/swc-win32-arm64-msvc/12.1.6: @@ -708,7 +701,6 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true - dev: false optional: true /@next/swc-win32-ia32-msvc/12.1.6: @@ -717,7 +709,6 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true - dev: false optional: true /@next/swc-win32-x64-msvc/12.1.6: @@ -726,7 +717,6 @@ packages: cpu: [x64] os: [win32] requiresBuild: true - dev: false optional: true /@nodelib/fs.scandir/2.1.5: @@ -787,7 +777,6 @@ packages: /@prisma/engines/3.14.0-36.2b0c12756921c891fec4f68d9444e18c7d5d4a6a: resolution: {integrity: sha512-LwZvI3FY6f43xFjQNRuE10JM5R8vJzFTSmbV9X0Wuhv9kscLkjRlZt0BEoiHmO+2HA3B3xxbMfB5du7ZoSFXGg==} requiresBuild: true - dev: true /@proselog/jwt/0.1.1: resolution: {integrity: sha512-bmAHf70G5b29FDF8G14twg109DgN3Eu3jbd5+6FSdFEeWK8afs+X3zCNiePeNolPUfJuMiepxfTgWaFlBs1L1Q==} @@ -950,7 +939,6 @@ packages: /@types/prop-types/15.7.5: resolution: {integrity: sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==} - dev: true /@types/react-avatar-editor/12.0.0: resolution: {integrity: sha512-835jSnCdQ2Kgrtz2sTYKMv9YSGJG0j2vd8C0sxWtYJoYOmYPs8nt25rTsbCOha3SVzWNiuw1TOQCVqN0iBQgrw==} @@ -970,15 +958,12 @@ packages: '@types/prop-types': 15.7.5 '@types/scheduler': 0.16.2 csstype: 3.0.11 - dev: true /@types/scheduler/0.16.2: resolution: {integrity: sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==} - dev: true /@types/sortablejs/1.13.0: resolution: {integrity: sha512-C3064MH72iEfeGCYEGCt7FCxXoAXaMPG0QPnstcxvPmbl54erpISu06d++FY37Smja64iWy5L8wOyHHBghWbJQ==} - dev: true /@types/ua-parser-js/0.7.36: resolution: {integrity: sha512-N1rW+njavs70y2cApeIw1vLMYXRwfBy+7trgavGuuTfOd7j1Yh7QTRc/yqsPl6ncokt72ZXuxEU0PiCp9bSwNQ==} @@ -1681,7 +1666,6 @@ packages: /csstype/3.0.11: resolution: {integrity: sha512-sa6P2wJ+CAbgyy4KFssIb/JNMLxFvKF1pCYCSXS8ZMuqZnMsrxqI2E5sPyoTpxoPU/gVZMzr2zjOfg8GIZOMsw==} - dev: true /damerau-levenshtein/1.0.8: resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==} @@ -3748,7 +3732,6 @@ packages: transitivePeerDependencies: - '@babel/core' - babel-plugin-macros - dev: false /node-fetch-native/0.1.3: resolution: {integrity: sha512-Jf1IQZdovUIv9E+5avmN6Sf+bND+rnMlODnBQhdE2VRyuWP9WgqZb/KEgPekh19DAN1X2C4vbS1VCOaz2OH19g==} @@ -4084,7 +4067,6 @@ packages: nanoid: 3.3.4 picocolors: 1.0.0 source-map-js: 1.0.2 - dev: false /posthtml-parser/0.11.0: resolution: {integrity: sha512-QecJtfLekJbWVo/dMAA+OSwY79wpRmbqS5TeXvXSX+f0c6pW4/SE6inzZ2qkU7oAMCPqIDkZDvd/bQsSFUnKyw==} @@ -4120,7 +4102,6 @@ packages: requiresBuild: true dependencies: '@prisma/engines': 3.14.0-36.2b0c12756921c891fec4f68d9444e18c7d5d4a6a - dev: true /prismjs/1.28.0: resolution: {integrity: sha512-8aaXdYvl1F7iC7Xm1spqSaY/OJBpYW3v+KJ+F17iYxvdc8sfjW194COK5wVhMZX45tGteiBQgdvD/nhxcRwylw==} @@ -4176,7 +4157,6 @@ packages: loose-envify: 1.4.0 react: 18.1.0 scheduler: 0.22.0 - dev: false /react-hook-form/7.31.1_react@18.1.0: resolution: {integrity: sha512-QjtjZ8r8KtEBWWpcXLyQordCraTFxILtyQpaz5KLLxN2YzcC+FZ9LLtOnNGuOnzZo9gCoB+viK3ZHV9Mb2htmQ==} @@ -4252,7 +4232,6 @@ packages: engines: {node: '>=0.10.0'} dependencies: loose-envify: 1.4.0 - dev: false /read-cache/1.0.0: resolution: {integrity: sha1-5mTvMRYRZsl1HNvo28+GtftY93Q=} @@ -4430,7 +4409,6 @@ packages: resolution: {integrity: sha512-6QAm1BgQI88NPYymgGQLCZgvep4FyePDWFpXVK+zNSUgHwlqpJy8VEh8Et0KxTACS4VWwMousBElAZOH9nkkoQ==} dependencies: loose-envify: 1.4.0 - dev: false /semver/6.3.0: resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} @@ -4599,7 +4577,6 @@ packages: optional: true dependencies: react: 18.1.0 - dev: false /supports-color/5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} diff --git a/src/components/dashboard/DashboardLayout.tsx b/src/components/dashboard/DashboardLayout.tsx index 51930962..25b9d454 100644 --- a/src/components/dashboard/DashboardLayout.tsx +++ b/src/components/dashboard/DashboardLayout.tsx @@ -23,7 +23,7 @@ export function DashboardLayout({ const { data: subscriptions } = trpc.useQuery( ["user.getSubscriptions", { canManage: true }], - {} + {}, ) const { data: viewer } = trpc.useQuery(["auth.viewer"]) @@ -37,77 +37,33 @@ export function DashboardLayout({ { href: `/dashboard/${subdomain}`, isActive: ({ href, pathname }) => href === pathname, - icon: , + icon: "i-bi-grid", text: "Dashboard", }, { href: `/dashboard/${subdomain}/posts`, isActive: ({ href, pathname }) => href === pathname, - icon: ( - - - - - ), + icon: "i-bi-layout-text-sidebar", text: "Posts", }, { href: `/dashboard/${subdomain}/pages`, isActive: ({ href, pathname }) => href === pathname, - icon: ( - - - - - - - ), + icon: "i-bi-window-stack", text: "Pages", }, { href: `/dashboard/${subdomain}/settings/general`, isActive: ({ pathname }) => pathname.startsWith(`/dashboard/${subdomain}/settings`), - icon: ( - - - - - - - ), + icon: "i-bi-gear", text: "Settings", }, { href: `/dashboard/${subdomain}/account/profile`, isActive: ({ pathname }) => pathname.startsWith(`/dashboard/${subdomain}/account`), - icon: ( - - - - ), + icon: "i-bi-person", text: "Account", }, ] @@ -135,13 +91,13 @@ export function DashboardLayout({ - {link.icon} + {link.text} @@ -154,16 +110,7 @@ export function DashboardLayout({ href={getSiteLink({ subdomain })} className="space-x-2 border rounded-lg bg-gray-100 border-gray-200 text-gray-500 hover:border-indigo-300 hover:bg-indigo-100 hover:text-indigo-500 flex w-full h-12 items-center justify-center transition-colors" > - - - + View Site diff --git a/src/components/main/MainLayout.tsx b/src/components/main/MainLayout.tsx index 3a805b03..488797d2 100644 --- a/src/components/main/MainLayout.tsx +++ b/src/components/main/MainLayout.tsx @@ -1,6 +1,3 @@ -import { Icon } from "@iconify/react" -import discordIcon from "@iconify/icons-mdi/discord" -import githubIcon from "@iconify/icons-mdi/github" import { logout } from "~/lib/auth.client" import { APP_DESCRIPTION, @@ -48,18 +45,7 @@ export function MainLayout({ className="space-x-2 rounded-full px-4 h-8 inline-flex items-center text-sm text-indigo-500 font-medium hover:bg-indigo-50" > Sign Out - - - + ) : ( © {APP_NAME}
- + {GITHUB_LINK && ( - + )}
diff --git a/src/components/site/SiteHome.tsx b/src/components/site/SiteHome.tsx index 177a0485..8743f649 100644 --- a/src/components/site/SiteHome.tsx +++ b/src/components/site/SiteHome.tsx @@ -17,7 +17,7 @@ export const SiteHome: React.FC<{ const excerpt = post.excerpt || post.autoExcerpt return ( - +

{post.title}

{formatDate(post.publishedAt)} diff --git a/src/components/ui/EmptyState.tsx b/src/components/ui/EmptyState.tsx index ba086c5b..3965e289 100644 --- a/src/components/ui/EmptyState.tsx +++ b/src/components/ui/EmptyState.tsx @@ -1,13 +1,8 @@ export const EmptyState: React.FC<{ resource?: string }> = ({ resource }) => { return ( -
- - - -
+
+ +
{" "} No {resource || "posts"} Yet.
diff --git a/src/pages/index.tsx b/src/pages/index.tsx index f8162a09..0363aee9 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -54,7 +54,7 @@ export default function Home({ href="/dashboard" className="text-indigo-500 inline-flex items-center space-x-2 hover:text-indigo-600" > - + Dashboard ) : ( diff --git a/uno.config.ts b/uno.config.ts index 1082e008..1f057f2e 100644 --- a/uno.config.ts +++ b/uno.config.ts @@ -2,5 +2,9 @@ import { defineConfig } from "unocss" import presetIcons from "@unocss/preset-icons" export default defineConfig({ - presets: [presetIcons()], + presets: [ + presetIcons({ + warn: true, + }), + ], })