fix: extra style errors

This commit is contained in:
zsavko
2023-04-09 22:18:43 +08:00
committed by zsakvo
parent 7a907baa94
commit 7d52d4a013
7 changed files with 85 additions and 53 deletions
+60 -38
View File
@@ -187,44 +187,64 @@ export function DashboardLayout({
}
drawerWidget={(close: any) => (
<>
<div className="mb-2 px-5 pt-3 pb-2 text-2xl font-extrabold flex items-center">
<div className="inline-block w-9 h-9 mr-3">
<Logo
type="lottie"
width={36}
height={36}
autoplay={false}
/>
<div className="flex-1 min-h-0 flex flex-col h-full">
<div className="mb-2 px-5 pt-3 pb-2 text-2xl font-extrabold flex items-center">
<div className="inline-block w-9 h-9 mr-3">
<Logo
type="lottie"
width={36}
height={36}
autoplay={false}
/>
</div>
{"xLog"}
</div>
<div className="px-3 space-y-[2px] text-zinc-500 flex-1 min-h-0 overflow-y-auto">
{links.map((link) => {
const active =
link.href &&
link.isActive({
pathname: router.asPath,
href: link.href,
})
return (
<div key={link.text} onClick={() => close()}>
<UniLink
href={link.href}
className={cn(
`flex px-4 h-12 items-center rounded-md space-x-2 w-full transition-colors`,
active
? `bg-slate-200 font-medium text-accent`
: `hover:bg-slate-200 hover:bg-opacity-50`,
!true && "justify-center",
)}
onClick={link.onClick}
>
<span className={cn(link.icon, "text-xl")}></span>
<span>{t(link.text)}</span>
</UniLink>
</div>
)
})}
</div>
<div className="flex items-center px-4 flex-col pb-4">
<UniLink
href={DISCORD_LINK}
className="space-x-1 text-zinc-500 hover:text-zinc-800 flex w-full h-12 items-center justify-center transition-colors mb-2"
>
<i className="i-mingcute:question-line text-lg" />
{<span>{t("Need help?")}</span>}
</UniLink>
<UniLink
href={getSiteLink({
subdomain,
})}
className="space-x-2 border rounded-lg bg-slate-100 border-slate-200 text-accent hover:scale-105 transition-transform flex w-full h-12 items-center justify-center"
>
<span className="i-mingcute:home-1-line"></span>
{<span>{t("View Site")}</span>}
</UniLink>
</div>
{"xLog"}
</div>
<div className="px-3 space-y-[2px] text-zinc-500 flex-1 min-h-0 overflow-y-auto">
{links.map((link) => {
const active =
link.href &&
link.isActive({
pathname: router.asPath,
href: link.href,
})
return (
<div key={link.text} onClick={() => close()}>
<UniLink
href={link.href}
className={cn(
`flex px-4 h-12 items-center rounded-md space-x-2 w-full transition-colors`,
active
? `bg-slate-200 font-medium text-accent`
: `hover:bg-slate-200 hover:bg-opacity-50`,
!true && "justify-center",
)}
onClick={link.onClick}
>
<span className={cn(link.icon, "text-xl")}></span>
<span>{t(link.text)}</span>
</UniLink>
</div>
)
})}
</div>
</>
)}
@@ -329,7 +349,9 @@ export function DashboardLayout({
</DashboardSidebar>
)}
<div className={`${isMobileLayout ? "pt-16" : ""}`}>{children}</div>
<div className={`${isMobileLayout ? "pt-16" : "flex-1"}`}>
{children}
</div>
</div>
</>
) : (
+4 -3
View File
@@ -1,5 +1,6 @@
import { cn } from "~/lib/utils"
import { useTranslation } from "next-i18next"
import { useMobileLayout } from "~/hooks/useMobileLayout"
export const DashboardMain: React.FC<{
children: React.ReactNode
@@ -8,15 +9,15 @@ export const DashboardMain: React.FC<{
className?: string
}> = ({ children, fullWidth, title, className }) => {
const { t } = useTranslation("dashboard")
const isMobileLayout = useMobileLayout()
return (
<div className="flex-1 overflow-scroll">
<div
className={cn(
fullWidth
? "relative"
: "max-w-screen-2xl min-w-[270px] relative px-5 py-5 md:px-10",
fullWidth ? "relative" : "min-w-[270px] relative px-5 py-5 md:px-10",
className,
isMobileLayout ? "max-w-[100vw]" : "",
)}
>
{title && <p className="text-2xl font-bold mb-8">{t(title)}</p>}
+3 -5
View File
@@ -13,9 +13,7 @@ export const DashboardTopbar: React.FC<{
const [isOpen, setIsOpen] = useState(false)
return (
<div
className={`${`w-screen top-0 h-16`} bg-slate-50 z-20 transition-all flex flex-row fixed px-5 md:px-10 items-center`}
>
<div className="w-full top-0 h-16 bg-slate-50 z-20 transition-all flex flex-row fixed px-5 md:px-10 items-center">
<Popover className="relative">
{({ open, close }) => (
<div className="h-6">
@@ -23,9 +21,9 @@ export const DashboardTopbar: React.FC<{
as={Fragment}
enter="transition ease-out duration-200"
enterFrom="opacity-0"
enterTo="opacity-100"
enterTo="opacity-10"
leave="transition ease-in duration-150"
leaveFrom="opacity-100"
leaveFrom="opacity-10"
leaveTo="opacity-0"
>
<Popover.Overlay className="fixed inset-0 bg-black opacity-10" />
@@ -121,6 +121,12 @@ export const OptionsButton: React.FC<{
)
}}
</Menu>
<div
className="bg-accent rounded-full cursor-pointer text-white w-6 h-6 flex justify-center items-center"
onClick={() => renderPage(!isRendering)}
>
<i className="i-mingcute:attachment-2-line text-xl inline-block w-6 h-6" />
</div>
</>
)
}
@@ -25,6 +25,7 @@ import { Tooltip } from "../ui/Tooltip"
import { APP_NAME } from "~/lib/env"
import { Trans, useTranslation } from "next-i18next"
import { readFiles } from "~/lib/read-files"
import { useMobileLayout } from "~/hooks/useMobileLayout"
export const PagesManager: React.FC<{
isPost: boolean
@@ -47,6 +48,8 @@ export const PagesManager: React.FC<{
const { t } = useTranslation(["dashboard", "site"])
const date = useDate()
const isMobileLayout = useMobileLayout()
useEffect(() => {
if (deletePage.isSuccess) {
toast.success(t("Deleted!"), {
+4 -1
View File
@@ -21,7 +21,10 @@ export const Tabs: React.FC<{ items: TabItem[]; className?: string }> = ({
return (
<div
className={cn(className, "flex border-b space-x-5 mb-8 overflow-x-auto")}
className={cn(
className,
"flex border-b space-x-5 mb-8 overflow-x-auto scrollbar-hide",
)}
>
{items.map((item) => {
if (item.hidden) return null
+5 -6
View File
@@ -526,11 +526,10 @@ export default function SubdomainEditor() {
</header>
<div
className={`h-screen pt-14 flex w-full ${
isMobileLayout ? "w-screen" : "min-w-[840px]"
isMobileLayout
? "w-screen h-[calc(100vh-4rem)]"
: "min-w-[840px]"
}`}
style={
isMobileLayout ? { height: "calc(100vh - 64px)" } : undefined
}
>
<div className="h-full overflow-auto w-full">
<div className="h-full mx-auto pt-5 flex flex-col">
@@ -605,7 +604,7 @@ export default function SubdomainEditor() {
</div>
</div>
</div>
{/* <div className="h-full overflow-auto flex-shrink-0 w-[280px] border-l bg-zinc-50 p-5 space-y-5">
<div className="h-full overflow-auto flex-shrink-0 w-[280px] border-l bg-zinc-50 p-5 space-y-5">
<div>
<Input
type="datetime-local"
@@ -704,7 +703,7 @@ export default function SubdomainEditor() {
help={t("Leave it blank to use auto-generated excerpt")}
/>
</div>
</div> */}
</div>
</div>
</>
)}