update icons

This commit is contained in:
EGOIST
2022-05-28 16:44:16 +08:00
parent b083b2b732
commit 2124753096
9 changed files with 47 additions and 143 deletions
+10 -63
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>
+3 -23
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>
+1 -1
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)}
+3 -8
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>