diff --git a/website/src/repl/components/panel/Panel.jsx b/website/src/repl/components/panel/Panel.jsx index 3b4dd5482..76987d1a4 100644 --- a/website/src/repl/components/panel/Panel.jsx +++ b/website/src/repl/components/panel/Panel.jsx @@ -44,6 +44,25 @@ export function LogoButton({ context, isEmbedded }) { export function MainPanel({ context, isEmbedded = false, className }) { const { isZen, isButtonRowHidden, fontFamily } = useSettings(); + let loc = window.location; + let ver = 'unofficial'; + let hot = false; + let b = loc.hostname.match(/^(.+)\.(strudel)/); + if (/(strudel)/.test(loc.hostname)) { + // if there's no text before 'strudel', it's warm, otherwise use the text before strudel + ver = b ? b[1] : 'warm'; + } else { + // match both versions of localhost + if (/(localhost)|(127.0.0.1)/.test(loc.hostname)) ver = 'dev'; + } + let pr = ver.match(/pr-([0-9]+)/); + if (pr) { + pr = pr[1]; + ver = `hot: ${pr}`; + hot = true; + pr = `https://codeberg.org/uzu/strudel/pulls/${pr}`; + } + return (