Skip to content

Commit 50d6467

Browse files
committed
docs: remove banner rotator
1 parent f112630 commit 50d6467

4 files changed

Lines changed: 2 additions & 297 deletions

File tree

packages/docs-gesture-handler/src/components/HandIcon/index.tsx

Lines changed: 0 additions & 23 deletions
This file was deleted.

packages/docs-gesture-handler/src/components/TopPromoRotator/index.tsx

Lines changed: 0 additions & 133 deletions
This file was deleted.

packages/docs-gesture-handler/src/components/TopPromoRotator/styles.module.css

Lines changed: 0 additions & 91 deletions
This file was deleted.
Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,8 @@
11
import React from 'react';
22
import useBaseUrl from '@docusaurus/useBaseUrl';
3-
import { useLocation } from '@docusaurus/router';
43
import { Navbar } from '@swmansion/t-rex-ui';
5-
import TopPromoRotator, {
6-
PROMO_VERSION,
7-
} from '@site/src/components/TopPromoRotator';
84

95
export default function NavbarWrapper(props) {
10-
const location = useLocation();
11-
const baseUrl = useBaseUrl('/');
12-
const isLanding = location.pathname === baseUrl;
13-
14-
const [showPromo, setShowPromo] = React.useState(true);
15-
16-
React.useEffect(() => {
17-
if (isLanding || typeof globalThis === 'undefined') {
18-
return;
19-
}
20-
21-
try {
22-
const raw = globalThis.localStorage?.getItem('topPromoState');
23-
const state = raw ? JSON.parse(raw) : null;
24-
if (state?.v === PROMO_VERSION && state?.hidden) {
25-
setShowPromo(false);
26-
}
27-
} catch (_) {
28-
// ignore
29-
}
30-
}, [isLanding]);
31-
32-
const handleClosePromo = React.useCallback(() => {
33-
setShowPromo(false);
34-
if (typeof globalThis !== 'undefined') {
35-
try {
36-
globalThis.localStorage?.setItem(
37-
'topPromoState',
38-
JSON.stringify({ v: PROMO_VERSION, hidden: true })
39-
);
40-
} catch {
41-
// ignore
42-
}
43-
}
44-
}, []);
45-
466
const titleImages = {
477
light: useBaseUrl('/img/title.svg'),
488
dark: useBaseUrl('/img/title-dark.svg'),
@@ -51,15 +11,7 @@ export default function NavbarWrapper(props) {
5111
const heroImages = {
5212
logo: useBaseUrl('/img/logo-hero.svg'),
5313
};
54-
5514
return (
56-
<div style={{ display: 'flex', flexDirection: 'column', flexShrink: 0 }}>
57-
{isLanding ? (
58-
<TopPromoRotator />
59-
) : (
60-
showPromo && <TopPromoRotator onClose={handleClosePromo} />
61-
)}
62-
<Navbar heroImages={heroImages} titleImages={titleImages} {...props} />
63-
</div>
15+
<Navbar heroImages={heroImages} titleImages={titleImages} {...props} />
6416
);
65-
}
17+
}

0 commit comments

Comments
 (0)