Skip to content

Commit 183f348

Browse files
p-maleckim-bert
andauthored
docs: remove banner rotator (#4235)
## Description The rotator was hardcoded in the repo, so every banner or link change needed a docs PR and deploy. We plan to replace it soon with a dynamic top banner whose image and link come from our delivery server, allowing marketing to swap banners without touching this repository. This PR removes the static TopPromoRotator promo banner from the documentation site. Drops the component, its styles, HandIcon, and all Navbar wiring (including localStorage dismiss logic). --------- Co-authored-by: Michał Bert <63123542+m-bert@users.noreply.github.com>
1 parent 665c288 commit 183f348

4 files changed

Lines changed: 1 addition & 296 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: 1 addition & 49 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
);
6517
}

0 commit comments

Comments
 (0)