Skip to content

Commit

Permalink
Rename opensharedlink to linkbutton and added style to link
Browse files Browse the repository at this point in the history
  • Loading branch information
anemne committed Aug 28, 2024
1 parent 2930eb2 commit 7aa0951
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 11 deletions.
9 changes: 0 additions & 9 deletions studio/components/OpenSharedLink.tsx

This file was deleted.

12 changes: 12 additions & 0 deletions studio/components/linkButton/LinkButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { ArrowRightIcon } from "@sanity/icons";
import styles from "./linkButton.module.css"

export const LinkButton = () => {
return (
<a className={styles.wrapper} href="http://localhost:3000/shared">
<span className={styles.text}>
Go to shared <ArrowRightIcon />
</span>
</a>
);
};
22 changes: 22 additions & 0 deletions studio/components/linkButton/linkButton.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.wrapper {
background: #e6e6ea;
gap: 0.5rem;
align-items: center;
display: flex;
list-style: none;
text-decoration: none;
width: fit-content;
padding: 0.5rem 1rem;
}

.wrapper:hover {
background: #dedee3;
}

.text {
display: flex;
align-items: center;
color: #4e556d;
font-size: 1rem;
gap: 0.5rem;
}
6 changes: 4 additions & 2 deletions studio/schemas/documents/blog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { defineField, defineType } from "sanity";
import seo from "../objects/seo";
import { pageSlug } from "../schemaTypes/slug";
import { title } from "../fields/text";
import { OpenSharedLink } from "studio/components/OpenSharedLink";
import { LinkButton } from "studio/components/linkButton/LinkButton";



export const blogId = "blog";

Expand Down Expand Up @@ -62,7 +64,7 @@ const blog = defineType({
"To create and edit blog posts, go to the shared Sanity project",
type: "link",
components: {
input: OpenSharedLink,
input: LinkButton,
},
}),
],
Expand Down

0 comments on commit 7aa0951

Please sign in to comment.