File tree Expand file tree Collapse file tree
app/(sanity)/studio/[[...index]] Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ "use client"
2+
3+ import { type ToolMenuProps } from "sanity"
4+ import { defaultIconSize } from "@/components/icons/icon"
5+ import { ArrowTopRightOnSquareIcon } from "@heroicons/react/24/outline"
6+
7+ /**
8+ * En custom toolmenu for sanity studio. Som legger til en lenke tilbake root-nettsiden.
9+ * @param props Props som sendes fra sanity studio.
10+ */
11+ const SanityToolMenu : Component < ToolMenuProps > = props => (
12+ < div style = { { display : "flex" , alignItems : "center" } } >
13+ < a
14+ href = { process . env . NEXT_PUBLIC_BASE_URL }
15+ rel = { "noopener" }
16+ target = { "_blank" }
17+ style = { {
18+ display : "flex" ,
19+ alignItems : "center" ,
20+ gap : "5px" ,
21+ color : "white" ,
22+ textDecoration : "none" ,
23+ fontSize : "small" ,
24+ } }
25+ title = { "Tilbake til Root" } >
26+ < ArrowTopRightOnSquareIcon width = { defaultIconSize } />
27+ < p > Root</ p >
28+ </ a >
29+ < div style = { { width : "100%" } } > { props . renderDefault ( props ) } </ div >
30+ </ div >
31+ )
32+
33+ export default SanityToolMenu
You can’t perform that action at this time.
0 commit comments