-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v3 - Added tab for opening shared studio (#533)
* Add OpenSharedButton component for opening shared studio * Prettier fix * Update studio/schemas/documents/blog.ts Co-authored-by: christinaroise <[email protected]> * Update studio/components/OpenSharedButton.tsx Co-authored-by: christinaroise <[email protected]> * Rename OpenSharedButton with OpenSharedLink in blog schema * Rename opensharedlink to linkbutton and added style to link * Prettier * added border and round corners to button * Add shared studio in navigationbar * Removed module.css file for customToolMenu * Prettier fix * Pretty * removed link from blog * refactor: Rename CustomLink component property to 'component' * moved arrow icon to css file for a11y --------- Co-authored-by: christinaroise <[email protected]>
- Loading branch information
1 parent
9825d7c
commit c48a1c7
Showing
5 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,12 @@ | ||
import { ToolMenuProps } from "sanity"; | ||
import { Inline } from "@sanity/ui"; | ||
import { LinkButton } from "./linkButton/LinkButton"; | ||
|
||
export default function CustomToolMenu(props: ToolMenuProps) { | ||
return ( | ||
<Inline> | ||
{props.renderDefault(props)} | ||
<LinkButton value="/shared" /> | ||
</Inline> | ||
); | ||
} |
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,14 @@ | ||
import { ArrowRightIcon } from "@sanity/icons"; | ||
import styles from "./linkButton.module.css"; | ||
|
||
interface LinkButtonProps { | ||
value?: string; | ||
} | ||
|
||
export const LinkButton = ({ value }: LinkButtonProps) => { | ||
return ( | ||
<a className={styles.wrapper} href={value}> | ||
<span className={styles.text}>Shared Studio</span> | ||
</a> | ||
); | ||
}; |
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,34 @@ | ||
.wrapper { | ||
align-items: center; | ||
display: block; | ||
list-style: none; | ||
text-decoration: none; | ||
white-space: nowrap; | ||
border-radius: 3px; | ||
padding: 0.2rem 0.5rem; | ||
} | ||
|
||
.wrapper:hover { | ||
background: #f5f5f7; | ||
} | ||
|
||
.text { | ||
display: flex; | ||
align-items: center; | ||
text-decoration: block; | ||
font-weight: 500; | ||
color: #323545; | ||
letter-spacing: 0; | ||
font-size: 13px; | ||
gap: 0.2rem; | ||
line-height: 19px; | ||
|
||
&::after { | ||
content: ""; | ||
width: 1rem; | ||
height: 1rem; | ||
-webkit-mask: url("/arrow-right.svg") no-repeat; | ||
-webkit-mask-size: contain; | ||
background-color: #323545; | ||
} | ||
} |
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