();
- let embedElement: ReactElement;
- if (!hasIntersected || isBot) {
- embedElement = (
-
- );
- } else {
- embedElement = (
-
- );
- }
-
+ // Embedded IDEs are cramped on phones, so CSS swaps in a link-out card.
+ // A media query (not useWindowSize) keeps the SSR markup right on first paint;
+ // the hidden iframe never intersects, so it never loads on phones.
return (
<>
- {embedElement}
+
+
+ {app ? `Explore the ${app} example` : 'Explore the example'}
+
+
+
+ Open in StackBlitz
+
+
+ View source
+
+
+
+
+
+ Loading demo…
+
+
+
More Demos
diff --git a/website/src/components/useHasIntersected.tsx b/website/src/components/useHasIntersected.tsx
index 236bd69c5598..fc191f9dead4 100644
--- a/website/src/components/useHasIntersected.tsx
+++ b/website/src/components/useHasIntersected.tsx
@@ -1,13 +1,12 @@
-import { useEffect, useRef, useState } from 'react';
+import { useEffect, useState } from 'react';
export function useHasIntersected(options: Props = {}) {
const { threshold = 0.1, root = null, rootMargin = '0%' } = options;
- const ref = useRef(null);
+ // Callback ref (via state) so a node mounted after the first render is observed
+ const [node, ref] = useState(null);
const [hasIntersected, setHasIntersected] = useState(false);
useEffect(() => {
- const node = ref.current;
-
if (!node || typeof IntersectionObserver !== 'function') {
return;
}
@@ -30,7 +29,7 @@ export function useHasIntersected(options: Props = {}) {
return () => {
observer.disconnect();
};
- }, [threshold, root, rootMargin]);
+ }, [node, threshold, root, rootMargin]);
return [ref, hasIntersected] as const;
}
diff --git a/website/src/css/root.css b/website/src/css/root.css
index df91888ec535..14e0ced6514c 100644
--- a/website/src/css/root.css
+++ b/website/src/css/root.css
@@ -48,19 +48,10 @@ html[data-theme='light'] {
--ifm-pre-background: var(--prism-background-color);
}
-.navbar .navbar__link {
- font-family: var(--ifm-font-family-base);
-}
-
.navbar .navbar__brand .navbar__title {
font-family: var(--ifm-font-family-base);
}
-code,
-pre {
- font-family: var(-ifm-font-family-monospace);
-}
-
html {
font-family: var(--ifm-font-family-base);
}
@@ -70,3 +61,11 @@ table {
width: 100%;
font-variant-numeric: tabular-nums;
}
+/* MDX tables are wrapped (theme/MDXComponents) so wide ones scroll instead of widening the page */
+.table-scroll {
+ overflow-x: auto;
+ margin-bottom: var(--ifm-spacing-vertical);
+}
+.table-scroll > table {
+ margin-bottom: 0;
+}
diff --git a/website/src/pages/index.js b/website/src/pages/index.js
index 832e38c78ac9..16d82d7bbb4b 100644
--- a/website/src/pages/index.js
+++ b/website/src/pages/index.js
@@ -134,20 +134,20 @@ export default function Home() {
-
+
+ A complete app
+
+ A GitHub issues and pull request browser on the live GitHub API,
+ built with REST resources and Suspense.
+
+
+
diff --git a/website/src/pages/index.module.css b/website/src/pages/index.module.css
index d723bddd7328..6745651c0330 100644
--- a/website/src/pages/index.module.css
+++ b/website/src/pages/index.module.css
@@ -8,19 +8,6 @@
text-align: center;
position: relative;
overflow: hidden;
- /*margin-bottom: 10px;*/
-
- /* background: linear-gradient(
- transparent 212px,
- var(--ifm-hero-fade-to-background-color) 100%
- ),
- url('../../static/img/rest_hooks_logo_grayscale.svg')
- var(--ifm-hero-background-color) no-repeat; */
- background-position: 0, 100% calc(20% - 3rem);
-
- /* overlap */
- padding-bottom: 14.5rem;
- margin-bottom: -12rem;
}
.logoWrapper {
@@ -36,9 +23,7 @@ html[data-theme='light'] .logoWrapper {
@media screen and (max-width: 996px) {
.heroBanner {
- padding: 2rem 0;
- padding-bottom: 14rem;
- margin-bottom: -13rem;
+ padding: 2rem 0 2.5rem;
}
}
@@ -86,9 +71,7 @@ html[data-theme='light'] .buttons :global(.button.button--secondary) {
margin-bottom: 20px;
}
.heroBanner {
- padding: 1rem 0;
- padding-bottom: 14rem;
-
+ padding: 1rem 0 2rem;
}
}
@@ -104,3 +87,13 @@ html[data-theme='light'] .buttons :global(.button.button--secondary) {
z-index: 1;
position: relative;
}
+
+.sectionHeading {
+ text-align: center;
+ margin-bottom: 0.5rem;
+}
+.sectionLede {
+ text-align: center;
+ color: var(--ifm-color-emphasis-700);
+ margin-bottom: 1.5rem;
+}
diff --git a/website/src/theme/MDXComponents.js b/website/src/theme/MDXComponents.js
index 90640295a062..dd09f1aa0f2c 100644
--- a/website/src/theme/MDXComponents.js
+++ b/website/src/theme/MDXComponents.js
@@ -1,8 +1,18 @@
// Import the original mapper
import { RestEndpoint } from '@data-client/rest';
import MDXComponents from '@theme-original/MDXComponents';
+import React from 'react';
+
+function Table(props) {
+ return (
+
+ );
+}
export default {
...MDXComponents,
RestEndpoint,
+ table: Table,
};
diff --git a/website/static/img/typescript-mono.svg b/website/static/img/typescript-mono.svg
new file mode 100644
index 000000000000..9f4165f52100
--- /dev/null
+++ b/website/static/img/typescript-mono.svg
@@ -0,0 +1 @@
+
diff --git a/website/static/img/typescript.dark.svg b/website/static/img/typescript.dark.svg
deleted file mode 100644
index b9810f4b6d79..000000000000
--- a/website/static/img/typescript.dark.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
diff --git a/website/static/img/typescript.svg b/website/static/img/typescript.svg
deleted file mode 100644
index b9ece8995daa..000000000000
--- a/website/static/img/typescript.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-
-