Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 31 additions & 15 deletions apps/website/app/layout.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Footer, Layout, Navbar } from "nextra-theme-docs";
import { Banner, Head } from "nextra/components";
import { Layout, Navbar } from "nextra-theme-docs";
import { Head } from "nextra/components";
import { getPageMap } from "nextra/page-map";
import "nextra-theme-docs/style.css";
import "../styles.css";
Expand All @@ -13,6 +13,34 @@ const Vercel = ({ height = 20 }) => (
</svg>
);

const LastUpdated = ({ date }) => (
<a
href="https://vercel.com/?utm_source=swc"
target="_blank"
rel="noopener"
className="inline-flex items-center no-underline text-current font-semibold"
>
<span className="mr-1">Powered by</span>
<span>
<Vercel />
</span>
<span className="ml-3">
<span className="mr-1">Last updated on</span>
<time
dateTime={date.toISOString()}
// Can provoke React 418 error https://react.dev/errors/418
suppressHydrationWarning
>
{date.toLocaleDateString("en", {
day: "numeric",
month: "long",
year: "numeric",
})}
</time>
</span>
</a>
);

export default async function RootLayout({ children }) {
return (
<html lang="en" dir="ltr" suppressHydrationWarning>
Expand Down Expand Up @@ -101,19 +129,7 @@ export default async function RootLayout({ children }) {
chatLink="https://discord.gg/GnHbXTdZz6"
/>
}
footer={
<a
href="https://vercel.com/?utm_source=swc"
target="_blank"
rel="noopener"
className="inline-flex items-center no-underline text-current font-semibold"
>
<span className="mr-1">Powered by</span>
<span>
<Vercel />
</span>
</a>
}
lastUpdated={<LastUpdated date={new Date()} />}
>
{children}
</Layout>
Expand Down
2 changes: 1 addition & 1 deletion apps/website/content/playground/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: SWC Playground
src="https://play.swc.rs"
style={{
width: '100%',
height: 'calc(100vh - 64px)',
height: 'calc(100vh - 64px - 6px - 20px - 10rem)',
border: 0,
overflow: 'hidden',
background: 'rgb(21, 21, 21)'
Expand Down
7 changes: 7 additions & 0 deletions apps/website/styles.css
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
@import "tailwindcss";

@layer base {
body {
--nextra-content-width: 100vw;
--nextra-menu-height: 4rem;
}
}