Skip to content

Commit

Permalink
fix(schema): fix image previews in studio issue
Browse files Browse the repository at this point in the history
  • Loading branch information
BolajiAyodeji committed Feb 9, 2021
1 parent 3fd1797 commit 0e42cce
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions studio/dist/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!doctype html><html><head><meta charSet="utf-8"/><title>Sanity Commerce Layer Starter – Sanity</title><meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"/><meta name="robots" content="noindex"/><style>html {background-color: #e4e8ed;}</style><link rel="stylesheet" href="/static/css/main.css?6bcdacfe63464826256a"/><link rel="subresource" href="/static/js/vendor.bundle.js?bc2bf00b1c9cf73a46d1"/><link rel="subresource" href="/static/js/app.bundle.js?6bcdacfe63464826256a"/><link rel="icon" href="/static/favicon.ico"/></head><body id="sanityBody"><div id="sanity"><div class="sanity-app-loading-screen"><style type="text/css">
<!doctype html><html><head><meta charSet="utf-8"/><title>Sanity Commerce Layer Starter – Sanity</title><meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"/><meta name="robots" content="noindex"/><style>html {background-color: #e4e8ed;}</style><link rel="stylesheet" href="/static/css/main.css?af3092afaed3360bd193"/><link rel="subresource" href="/static/js/vendor.bundle.js?bc2bf00b1c9cf73a46d1"/><link rel="subresource" href="/static/js/app.bundle.js?af3092afaed3360bd193"/><link rel="icon" href="/static/favicon.ico"/></head><body id="sanityBody"><div id="sanity"><div class="sanity-app-loading-screen"><style type="text/css">
.sanity-app-loading-screen {
font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
text-align: center;
Expand Down Expand Up @@ -127,4 +127,4 @@
font-family: helvetica, arial, sans-serif;
}
</style><h1>JavaScript disabled</h1><p>Please <a href="https://www.enable-javascript.com/">enable JavaScript</a> in your browser and reload the page to proceed.</p></div></div></noscript></div><script>/* Global error handler */ window.onerror = function(e,t,n,o,r){if(r&&!r.message.includes("useRootTheme():")){var a=document.getElementById("sanity"),l=document.createElement("div");l.style.position="absolute",l.style.top="50%",l.style.left="50%",l.style.transform="translate(-50%, -50%)";var s=document.createElement("h1");s.innerText="Uncaught error";var d=document.createElement("pre"),i=document.createElement("code");d.style.fontSize="0.8em",d.style.opacity="0.7",d.style.overflow="auto",d.style.whiteSpace="pre-wrap",d.style.maxHeight="70vh";var c=r.stack&&r.stack.replace(r.message,"").replace(/^error: *\n?/i,""),m=(r.stack?r.message:r.toString())+(r.stack?"\n\nStack:\n\n"+c:"")+"\n\n(Your browsers Developer Tools may contain more info)";i.textContent=m;var p=document.createElement("button");for(p.style.padding="0.8em 1em",p.style.marginTop="1em",p.style.border="none",p.style.backgroundColor="#303030",p.style.color="#fff",p.style.borderRadius="4px",p.onclick=function(){window.location.reload()},p.textContent="Reload",d.appendChild(i),l.appendChild(s),l.appendChild(d),l.appendChild(p);a.firstChild;)a.removeChild(a.firstChild);a.appendChild(l)}}</script><script>/* Script loader */
!function(e,t){if(void 0!==window.fetch)t.forEach(function(t){var o=e.createElement("script");o.src=t,o.async=!1,e.head.appendChild(o)});else{var o=e.getElementById("sanity");'<div style="height:100%;width: 100%;position: absolute;top:45%;text-align:center;font-family:helvetica, arial, sans-serif;">',"<h1>Browser not supported</h1>",'<p>Please use a modern browser such as <a href="https://www.google.com/chrome/">Chrome</a> or <a href="https://www.getfirefox.org/">Firefox</a>.</p>',"</div>","</div>";var r=o;do{r.style.height="100%",r=r.parentNode}while(r.parentNode);o.innerHTML='<div style="position:relative;height:100%;"><div style="height:100%;width: 100%;position: absolute;top:45%;text-align:center;font-family:helvetica, arial, sans-serif;"><h1>Browser not supported</h1><p>Please use a modern browser such as <a href="https://www.google.com/chrome/">Chrome</a> or <a href="https://www.getfirefox.org/">Firefox</a>.</p></div></div>'}}(document,["/static/js/vendor.bundle.js?bc2bf00b1c9cf73a46d1","/static/js/app.bundle.js?6bcdacfe63464826256a"]);</script></body></html>
!function(e,t){if(void 0!==window.fetch)t.forEach(function(t){var o=e.createElement("script");o.src=t,o.async=!1,e.head.appendChild(o)});else{var o=e.getElementById("sanity");'<div style="height:100%;width: 100%;position: absolute;top:45%;text-align:center;font-family:helvetica, arial, sans-serif;">',"<h1>Browser not supported</h1>",'<p>Please use a modern browser such as <a href="https://www.google.com/chrome/">Chrome</a> or <a href="https://www.getfirefox.org/">Firefox</a>.</p>',"</div>","</div>";var r=o;do{r.style.height="100%",r=r.parentNode}while(r.parentNode);o.innerHTML='<div style="position:relative;height:100%;"><div style="height:100%;width: 100%;position: absolute;top:45%;text-align:center;font-family:helvetica, arial, sans-serif;"><h1>Browser not supported</h1><p>Please use a modern browser such as <a href="https://www.google.com/chrome/">Chrome</a> or <a href="https://www.getfirefox.org/">Firefox</a>.</p></div></div>'}}(document,["/static/js/vendor.bundle.js?bc2bf00b1c9cf73a46d1","/static/js/app.bundle.js?af3092afaed3360bd193"]);</script></body></html>
2 changes: 1 addition & 1 deletion studio/dist/static/js/app.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion studio/schemas/product.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default {
select: {
title: "Name",
subtitle: "Slug.current",
media: "Images[0]",
media: "Images.0.Images",
},
prepare({ title, subtitle, media }) {
return {
Expand Down
2 changes: 1 addition & 1 deletion studio/schemas/variant.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default {
preview: {
select: {
title: "Name",
media: "Images[0]",
media: "Images.0.Images",
},
},
};

0 comments on commit 0e42cce

Please sign in to comment.