-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sanity): add
StudioLogo
component
- Loading branch information
1 parent
2cea78a
commit a80fc64
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
packages/sanity/src/studio/components/navbar/LogoButton.tsx
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,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> | ||
) | ||
} |
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,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> | ||
} |