Skip to content

Commit

Permalink
feat(sanity): add StudioLogo component
Browse files Browse the repository at this point in the history
  • Loading branch information
hermanwikner authored and rexxars committed Sep 23, 2022
1 parent 2cea78a commit a80fc64
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
27 changes: 27 additions & 0 deletions packages/sanity/src/studio/components/navbar/LogoButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react'
import {Button} from '@sanity/ui'

interface LogoButtonProps {
onClick: React.MouseEventHandler<HTMLElement>
children: React.ReactNode
href: string
title: string
}

export function LogoButton(props: LogoButtonProps) {
const {title, children, href, onClick} = props

return (
<Button
aria-label={title}
as="a"
data-testid="logo"
href={href}
mode="bleed"
onClick={onClick}
padding={3}
>
{children}
</Button>
)
}
9 changes: 9 additions & 0 deletions packages/sanity/src/studio/components/navbar/StudioLogo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import {Text} from '@sanity/ui'
import React from 'react'
import {LogoProps} from '../../../config'

export function StudioLogo(props: LogoProps) {
const {title} = props

return <Text weight="bold">{title}</Text>
}

0 comments on commit a80fc64

Please sign in to comment.