update icons

This commit is contained in:
EGOIST 2022-05-28 16:35:48 +08:00
parent b083b2b732
commit 2124753096
9 changed files with 47 additions and 143 deletions

View File

@ -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" })
})
}

View File

@ -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",

View File

@ -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==}

View File

@ -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: <DashboardIcon />,
icon: "i-bi-grid",
text: "Dashboard",
},
{
href: `/dashboard/${subdomain}/posts`,
isActive: ({ href, pathname }) => href === pathname,
icon: (
<svg width="1em" height="1em" viewBox="0 0 24 24">
<path
fill="currentColor"
d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"
></path>
<path
fill="currentColor"
d="M14 17H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"
></path>
</svg>
),
icon: "i-bi-layout-text-sidebar",
text: "Posts",
},
{
href: `/dashboard/${subdomain}/pages`,
isActive: ({ href, pathname }) => href === pathname,
icon: (
<svg width="1em" height="1em" viewBox="0 0 24 24">
<g
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2.2"
>
<path d="M12 11h5m-5-4h5m-9 8V3.6a.6.6 0 0 1 .6-.6h11.8a.6.6 0 0 1 .6.6V17a4 4 0 0 1-4 4v0"></path>
<path d="M5 15h7.4c.331 0 .603.267.63.597C13.153 17.115 13.78 21 17 21H6a3 3 0 0 1-3-3v-1a2 2 0 0 1 2-2Z"></path>
</g>
</svg>
),
icon: "i-bi-window-stack",
text: "Pages",
},
{
href: `/dashboard/${subdomain}/settings/general`,
isActive: ({ pathname }) =>
pathname.startsWith(`/dashboard/${subdomain}/settings`),
icon: (
<svg width="1em" height="1em" viewBox="0 0 16 16">
<g
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="1.5"
>
<circle cx="8" cy="8" r="1.75"></circle>
<path d="m6.75 1.75l-.5 1.5l-1.5 1l-2-.5l-1 2l1.5 1.5v1.5l-1.5 1.5l1 2l2-.5l1.5 1l.5 1.5h2.5l.5-1.5l1.5-1l2 .5l1-2l-1.5-1.5v-1.5l1.5-1.5l-1-2l-2 .5l-1.5-1l-.5-1.5z"></path>
</g>
</svg>
),
icon: "i-bi-gear",
text: "Settings",
},
{
href: `/dashboard/${subdomain}/account/profile`,
isActive: ({ pathname }) =>
pathname.startsWith(`/dashboard/${subdomain}/account`),
icon: (
<svg width="1em" height="1em" viewBox="0 0 24 24">
<path
fill="currentColor"
d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10zm-4.987-3.744A7.966 7.966 0 0 0 12 20a7.97 7.97 0 0 0 5.167-1.892A6.979 6.979 0 0 0 12.16 16a6.981 6.981 0 0 0-5.147 2.256zM5.616 16.82A8.975 8.975 0 0 1 12.16 14a8.972 8.972 0 0 1 6.362 2.634a8 8 0 1 0-12.906.187zM12 13a4 4 0 1 1 0-8a4 4 0 0 1 0 8zm0-2a2 2 0 1 0 0-4a2 2 0 0 0 0 4z"
></path>
</svg>
),
icon: "i-bi-person",
text: "Account",
},
]
@ -135,13 +91,13 @@ export function DashboardLayout({
<Link href={link.href} key={link.href}>
<a
className={clsx(
`flex px-2 h-8 text-sm items-center rounded-lg`,
`flex px-2 h-8 text-sm items-center rounded-lg space-x-2`,
active
? `bg-gray-200 font-medium text-gray-800`
: `hover:bg-gray-200 hover:bg-opacity-50`
: `hover:bg-gray-200 hover:bg-opacity-50`,
)}
>
<span className="mr-2 text-lg">{link.icon}</span>
<span className={clsx(link.icon, "text-lg")}></span>
<span>{link.text}</span>
</a>
</Link>
@ -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"
>
<svg width="1em" height="1em" viewBox="0 0 32 32">
<path
fill="none"
stroke="currentcolor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M14 9H3v20h20V18M18 4h10v10m0-10L14 18"
></path>
</svg>
<span className="i-bi:box-arrow-up-right"></span>
<span>View Site</span>
</UniLink>
</div>

View File

@ -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"
>
<span>Sign Out</span>
<svg
className="w-5 h-5"
fill="currentColor"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path
fillRule="evenodd"
d="M3 3a1 1 0 00-1 1v12a1 1 0 102 0V4a1 1 0 00-1-1zm10.293 9.293a1 1 0 001.414 1.414l3-3a1 1 0 000-1.414l-3-3a1 1 0 10-1.414 1.414L14.586 9H7a1 1 0 100 2h7.586l-1.293 1.293z"
clipRule="evenodd"
/>
</svg>
<span className="i-bi:box-arrow-right text-lg"></span>
</UniLink>
) : (
<UniLink
@ -81,17 +67,11 @@ export function MainLayout({
<span>&copy; {APP_NAME}</span>
<div className="text-zinc-400 mt-2 flex items-center space-x-1">
<UniLink href={discordLink}>
<Icon
icon={discordIcon}
className="w-5 h-5 hover:text-indigo-500"
/>
<span className="inline-block i-mdi-discord text-xl hover:text-indigo-500"></span>
</UniLink>
{GITHUB_LINK && (
<UniLink href={GITHUB_LINK}>
<Icon
icon={githubIcon}
className="w-5 h-5 hover:text-zinc-900"
/>
<span className="inline-block i-mdi-github text-xl hover:text-zinc-900"></span>
</UniLink>
)}
</div>

View File

@ -17,7 +17,7 @@ export const SiteHome: React.FC<{
const excerpt = post.excerpt || post.autoExcerpt
return (
<Link key={post.id} href={`/${post.slug}`}>
<a className="block hover:bg-zinc-100 p-5 -mx-5 -my-5 md:rounded-xl">
<a className="block hover:bg-zinc-100 transition-colors p-5 -mx-5 -my-5 md:rounded-xl">
<h3 className="text-2xl font-bold">{post.title}</h3>
<div className="text-sm text-zinc-400 mt-1">
{formatDate(post.publishedAt)}

View File

@ -1,13 +1,8 @@
export const EmptyState: React.FC<{ resource?: string }> = ({ resource }) => {
return (
<div className="text-center py-10 mb-10 text-2xl text-zinc-500 flex justify-center flex-col items-center">
<svg className="w-12 h-12" viewBox="0 0 24 24">
<path
fill="currentColor"
d="M12 2a9 9 0 0 0-9 9v11l3-3l3 3l3-3l3 3l3-3l3 3V11a9 9 0 0 0-9-9M9 8a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2a2 2 0 0 1 2-2m6 0a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2a2 2 0 0 1 2-2Z"
></path>
</svg>
<div className="text-zinc-400">
<div className="text-center py-10 mb-10 text-2xl text-zinc-300 font-medium flex justify-center flex-col items-center">
<span className="i-mdi:ghost-outline text-5xl mb-2"></span>
<div className="">
{" "}
No <span className="capitalize">{resource || "posts"}</span> Yet.
</div>

View File

@ -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"
>
<DashboardIcon />
<span className="i-bi-grid text-lg"></span>
<span>Dashboard</span>
</UniLink>
) : (

View File

@ -2,5 +2,9 @@ import { defineConfig } from "unocss"
import presetIcons from "@unocss/preset-icons"
export default defineConfig({
presets: [presetIcons()],
presets: [
presetIcons({
warn: true,
}),
],
})