Skip to content

Commit a3f5b45

Browse files
committed
ui fixes
1 parent 8440e66 commit a3f5b45

9 files changed

Lines changed: 3072 additions & 4878 deletions

File tree

gatsby-browser.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const React = require('react');
2+
const { FloatingAssistantProvider } = require('./src/contexts/FloatingAssistantContext');
3+
const FloatingAssistant = require('./src/components/FloatingAssistant').default;
4+
5+
exports.wrapRootElement = ({ element }) => (
6+
<FloatingAssistantProvider>
7+
{element}
8+
<FloatingAssistant />
9+
</FloatingAssistantProvider>
10+
);
11+
12+
exports.onRouteUpdate = ({ location }) => {
13+
window.dispatchEvent(
14+
new CustomEvent('gatsby-route-update', { detail: { location } })
15+
);
16+
};

gatsby-ssr.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const React = require('react');
2+
const { FloatingAssistantProvider } = require('./src/contexts/FloatingAssistantContext');
3+
4+
exports.wrapRootElement = ({ element }) => (
5+
<FloatingAssistantProvider>
6+
{element}
7+
</FloatingAssistantProvider>
8+
);

package-lock.json

Lines changed: 2656 additions & 4746 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/DevDocTemplate/index.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ import {
5252
import t from '../../utils/lang-utils';
5353
import { getHTMLFromComponent } from '../../utils/react-utils';
5454
import VersionIframe from '../VersionIframe';
55-
import FloatingAssistant from '../FloatingAssistant';
5655

5756
const DevDocTemplate: FC<DevDocTemplateProps> = (props) => {
5857
const {
@@ -667,9 +666,9 @@ if (isVersionedIframe) {
667666
return (
668667
<>
669668
<Seo title={docTitle} description={docDescription} />
670-
<Analytics />
671-
{shouldShowAnnouncementBanner() && (
672-
<AnnouncementBanner
669+
<Analytics />
670+
{shouldShowAnnouncementBanner() && (
671+
<AnnouncementBanner
673672
enabled={HOME_ANNOUNCEMENT_BANNER?.enabled}
674673
variant="release"
675674
dismissKey={bannerDismissKey}
@@ -753,7 +752,6 @@ if (isVersionedIframe) {
753752
renderDocTemplate()
754753
)}
755754
</main>
756-
<FloatingAssistant isDarkMode={isDarkMode ?? false} pageId={curPageNode.pageAttributes.pageid} />
757755
</div>
758756
</>
759757
);

0 commit comments

Comments
 (0)