Skip to content

Commit

Permalink
feat: go to dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Innei committed Jul 25, 2023
1 parent e3cdcd5 commit 95bde28
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/components/layout/header/internal/UserAuth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { AnimatePresence } from 'framer-motion'
import dynamic from 'next/dynamic'
import { usePathname } from 'next/navigation'

import { useIsLogged } from '~/atoms'
import { getAdminUrl, useIsLogged } from '~/atoms'
import { UserArrowLeftIcon } from '~/components/icons/user-arrow-left'
import { MotionButtonBase } from '~/components/ui/button'
import { FloatPopover } from '~/components/ui/float-popover'
import { urlBuilder } from '~/lib/url-builder'
import { useAggregationSelector } from '~/providers/root/aggregation-data-provider'
Expand Down Expand Up @@ -34,9 +35,17 @@ const OwnerAvatar = () => {
const ownerAvatar = useAggregationSelector((s) => s.user.avatar)!

return (
<div className="pointer-events-auto flex h-10 w-10 items-center justify-center overflow-hidden rounded-full">
<MotionButtonBase
onClick={() => {
const adminUrl = getAdminUrl()
if (!adminUrl) return
window.open(adminUrl, '_blank')
}}
className="pointer-events-auto flex h-10 w-10 items-center justify-center overflow-hidden rounded-full"
>
<span className="sr-only">Go to dashboard</span>
<img src={ownerAvatar} alt="site owner" />
</div>
</MotionButtonBase>
)
}
export function UserAuth() {
Expand Down

1 comment on commit 95bde28

@vercel
Copy link

@vercel vercel bot commented on 95bde28 Jul 25, 2023

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
innei.in
shiro-innei.vercel.app
springtide.vercel.app

Please sign in to comment.