Skip to content

Commit 7a988f7

Browse files
kacperkapusciakj-piasecki
authored andcommitted
docs: add Radon IDE banner to TOCItems (#3592)
This PR adds a Radon IDE banner to the right-hand side part of the documentation. ![image](https://github.com/user-attachments/assets/e7ee0fe9-e6fa-4f23-882d-07d783297aa3) The banner rotates a couple of different labels and CTAs. It's only visible on desktop. Related to software-mansion/react-native-reanimated#7631 and software-mansion/react-native-reanimated#7634
1 parent e940406 commit 7a988f7

File tree

3 files changed

+159
-1
lines changed

3 files changed

+159
-1
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import React, { useRef } from 'react';
2+
import BrowserOnly from '@docusaurus/BrowserOnly';
3+
import styles from './styles.module.css';
4+
5+
import ArrowRight from '@site/static/img/arrow-right.svg';
6+
7+
const items = [
8+
{
9+
text: 'An all-in-one IDE for Expo & React Native.',
10+
button: 'Try Radon IDE for free',
11+
},
12+
{
13+
text: 'Streamline your React Native & Expo development.',
14+
button: 'Install Radon IDE',
15+
},
16+
{
17+
text: 'Set breakpoints and debug React Native apps with ease.',
18+
button: 'Try Radon IDE for free',
19+
},
20+
{
21+
text: 'Catch runtime errors right in your editor.',
22+
button: 'Install Radon IDE',
23+
},
24+
{
25+
text: 'Preview React Native components in isolation.',
26+
button: 'Try Radon IDE',
27+
},
28+
{
29+
text: 'Run, preview, and debug your React Native & Expo apps without leaving VSCode.',
30+
button: 'Try Radon IDE for free',
31+
},
32+
{
33+
text: 'Run, preview, and debug apps faster.',
34+
button: 'Try our IDE for React Native',
35+
},
36+
{
37+
text: 'Reduce context switching & debug faster.',
38+
button: 'Try Radon IDE for free',
39+
},
40+
{
41+
text: 'Reduce context switching & preview components instantly.',
42+
button: 'Try Radon IDE for free',
43+
},
44+
{
45+
text: 'Reduce context switching & streamline React Native and Expo development.',
46+
button: 'Install Radon IDE',
47+
},
48+
];
49+
50+
function RadonBannerInner(): JSX.Element {
51+
const item = useRef(items[Math.floor(Math.random() * items.length)]);
52+
53+
return (
54+
<a
55+
href="https://ide.swmansion.com/?utm_source=gesture-handler"
56+
className={styles.container}>
57+
<div className={styles.content}>
58+
<p className={styles.text}>{item.current.text}</p>
59+
<span className={styles.button}>
60+
{item.current.button} <ArrowRight />
61+
</span>
62+
</div>
63+
<span className={styles.ellipseLeft} />
64+
<span className={styles.ellipseRight} />
65+
</a>
66+
);
67+
}
68+
69+
export default function RadonBanner() {
70+
return <BrowserOnly>{() => <RadonBannerInner />}</BrowserOnly>;
71+
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
.container {
2+
display: flex;
3+
align-items: center;
4+
justify-content: center;
5+
padding: 14px;
6+
background-color: var(--swm-green-light-60);
7+
border-radius: 4px;
8+
position: relative;
9+
overflow: hidden;
10+
text-decoration: none !important;
11+
}
12+
13+
.container:hover .button svg {
14+
transform: translate(5px);
15+
}
16+
17+
.container:hover .button {
18+
border: 1px solid var(--swm-green-light-100);
19+
}
20+
21+
.text {
22+
font-size: 15px;
23+
color: var(--swm-navy-light-100);
24+
font-weight: 500;
25+
z-index: 1;
26+
position: relative;
27+
margin-bottom: 8px;
28+
text-wrap: balance;
29+
text-align: center;
30+
}
31+
32+
.button {
33+
position: relative;
34+
display: flex;
35+
align-items: center;
36+
justify-content: center;
37+
padding: 5px 10px;
38+
color: var(--swm-navy-light-100);
39+
background-color: var(--swm-white);
40+
transition: border 0.3s;
41+
border: 1px solid var(--swm-navy-light-100);
42+
font-size: 14px;
43+
font-weight: 500;
44+
cursor: pointer;
45+
z-index: 1;
46+
gap: 4px;
47+
}
48+
49+
.button svg {
50+
transition: transform 0.3s;
51+
}
52+
53+
.ellipseLeft {
54+
position: absolute;
55+
width: 100px;
56+
height: 100px;
57+
top: -20px;
58+
left: -30px;
59+
border-radius: 50%;
60+
transform: rotate(-30deg);
61+
background: linear-gradient(
62+
184.24deg,
63+
var(--swm-green-light-80) 3.45%,
64+
var(--swm-green-light-40) 66.97%,
65+
rgba(255, 255, 255, 0) 124.45%
66+
);
67+
}
68+
69+
.ellipseRight {
70+
position: absolute;
71+
width: 150px;
72+
height: 150px;
73+
bottom: -45px;
74+
right: -70px;
75+
border-radius: 50%;
76+
transform: rotate(-120deg);
77+
background: linear-gradient(
78+
184.24deg,
79+
var(--swm-green-light-80) 3.45%,
80+
var(--swm-green-light-40) 66.97%,
81+
rgba(255, 255, 255, 0) 124.45%
82+
);
83+
}
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
import { TOCItems } from '@swmansion/t-rex-ui';
22

3-
export default TOCItems;
3+
import RadonBanner from '../../components/RadonBanner';
4+
5+
export default function TOCItemsWrapper(props) {
6+
return <TOCItems slot={<RadonBanner />} {...props} />;
7+
}

0 commit comments

Comments
 (0)