Skip to content

Commit

Permalink
docs: Do render github button iframe in server HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
ntucker committed Sep 11, 2023
1 parent 7a7188a commit 3c3dc88
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions website/src/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import BrowserOnly from '@docusaurus/BrowserOnly';
import Head from '@docusaurus/Head';
import Link from '@docusaurus/Link';
import useBaseUrl from '@docusaurus/useBaseUrl';
Expand All @@ -10,6 +11,7 @@ import React from 'react';
import styles from './index.module.css';
import Demo from '../components/Demo/index';
import HomepageFeatures from '../components/HomepageFeatures';
import { isGoogleBot } from '../components/Playground/isGoogleBot';
import StackBlitz from '../components/StackBlitz';

const ProjectTitle = () => {
Expand Down Expand Up @@ -54,13 +56,33 @@ function HomepageHeader() {
</Link>

<span className={styles.GitHubButtonWrapper}>
<iframe
className={styles.GitHubButton}
src="https://ghbtns.com/github-btn.html?user=reactive&amp;repo=data-client&amp;type=star&amp;count=true&amp;size=large"
width={160}
height={30}
title="GitHub Stars"
/>
<BrowserOnly
fallback={
<iframe
width={160}
height={30}
className={styles.GitHubButton}
></iframe>
}
>
{() =>
isGoogleBot ? (
<iframe
width={160}
height={30}
className={styles.GitHubButton}
></iframe>
) : (
<iframe
className={styles.GitHubButton}
src="https://ghbtns.com/github-btn.html?user=reactive&amp;repo=data-client&amp;type=star&amp;count=true&amp;size=large"
width={160}
height={30}
title="GitHub Stars"
/>
)
}
</BrowserOnly>
</span>
</div>
</div>
Expand Down

0 comments on commit 3c3dc88

Please sign in to comment.