Skip to content

Commit 5cd693d

Browse files
committed
Add link to TypeScript's release notes on playground navbar
1 parent cf3e85a commit 5cd693d

File tree

2 files changed

+25
-15
lines changed

2 files changed

+25
-15
lines changed

src/pages/play/Playground.tsx

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -171,23 +171,33 @@ function OutputPane() {
171171
);
172172
}
173173

174+
function PlaygroundNavbar() {
175+
const tstlLink = "https://github.com/TypeScriptToLua/TypeScriptToLua/blob/master/CHANGELOG.md";
176+
const tsMajor = tsVersion.split(".")[0];
177+
const tsMinor = tsVersion.split(".")[1];
178+
const tsLink = `https://www.typescriptlang.org/docs/handbook/release-notes/typescript-${tsMajor}-${tsMinor}.html`;
179+
180+
return (
181+
<nav className={styles.navbar}>
182+
<div className={styles.navbarVersions}>
183+
TSTL{" "}
184+
<a href={tstlLink} target="_blank" rel="noopener">
185+
<b>v{tstlVersion}</b>
186+
</a>
187+
<br />
188+
&nbsp;&nbsp;TS{" "}
189+
<a href={tsLink} target="_blank" rel="noopener">
190+
<b>v{tsVersion}</b>
191+
</a>
192+
</div>
193+
</nav>
194+
);
195+
}
196+
174197
export default function Playground() {
175198
return (
176199
<>
177-
<nav className={styles.navbar}>
178-
<div className={styles.navbarVersion}>
179-
TSTL{" "}
180-
<a
181-
href="https://github.com/TypeScriptToLua/TypeScriptToLua/blob/master/CHANGELOG.md"
182-
target="_blank"
183-
rel="noopener"
184-
>
185-
<b>v{tstlVersion}</b>
186-
</a>
187-
<br />
188-
&nbsp;&nbsp;TS <b>v{tsVersion}</b>
189-
</div>
190-
</nav>
200+
<PlaygroundNavbar />
191201
<div className={styles.content}>
192202
<EditorContextProvider>
193203
<InputPane />

src/pages/play/styles.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ $navbar-height: 50px;
4040
align-items: center;
4141
}
4242

43-
.navbarVersion {
43+
.navbarVersions {
4444
line-height: 1.25;
4545
font-size: 14px;
4646
font-family: monospace;

0 commit comments

Comments
 (0)