-
-
Notifications
You must be signed in to change notification settings - Fork 772
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Innei <i@innei.in>
- Loading branch information
Showing
8 changed files
with
75 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
'use client' | ||
|
||
import { useIsLogged, useResolveAdminUrl } from '~/atoms' | ||
import { clsxm } from '~/lib/helper' | ||
|
||
interface Props { | ||
type: 'notes' | 'pages' | 'posts' | ||
id: string | ||
} | ||
export const GoToAdminEditingButton: Component<Props> = (props) => { | ||
const isLogin = useIsLogged() | ||
const resolveAdminUrl = useResolveAdminUrl() | ||
const { id, type, className } = props | ||
if (!isLogin) return null | ||
|
||
return ( | ||
<a | ||
href={resolveAdminUrl(`#/${type}/edit?id=${id}`)} | ||
data-hide-print | ||
target="_blank" | ||
className={clsxm( | ||
'flex h-8 w-8 rounded-full text-accent no-underline opacity-80 ring-1 ring-slate-200 duration-200 center hover:opacity-100 dark:ring-neutral-800', | ||
className, | ||
)} | ||
rel="noreferrer" | ||
> | ||
<i className="icon-[mingcute--quill-pen-line]" /> | ||
<span className="sr-only">编辑</span> | ||
</a> | ||
) | ||
} |
c851c73
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
shiro – ./
shiro-git-main-innei.vercel.app
springtide.vercel.app
innei.in
shiro-innei.vercel.app