Skip to content

Commit e06c9ce

Browse files
authored
[Docs] Add announcement Chip (#4366)
## Description Adds announcement chip about v3 | Dark | Light | |--------|-------| | <img width="590" height="280" alt="image" src="https://github.com/user-attachments/assets/6281491a-4521-4ccb-b84a-dada0a461604" /> | <img width="590" height="280" alt="image" src="https://github.com/user-attachments/assets/8538fc89-f33a-425f-90d0-3f2bbaba396b" /> | https://github.com/user-attachments/assets/73184439-9f22-4134-8c9d-f778dd37b82e ## Test plan Read docs 🤓
1 parent 44e8d61 commit e06c9ce

4 files changed

Lines changed: 72 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import React from 'react';
2+
3+
import styles from './styles.module.css';
4+
5+
const AnnouncementChip: React.FC<{
6+
label: string;
7+
linkLabel: string;
8+
href: string;
9+
}> = ({ label, linkLabel, href }) => {
10+
return (
11+
<a href={href} target="_blank" rel="noreferrer" className={styles.chip}>
12+
<span className={styles.label}>{label}</span>
13+
<span className={styles.link}>{linkLabel}</span>
14+
</a>
15+
);
16+
};
17+
18+
export default AnnouncementChip;
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
.chip {
2+
display: inline-flex;
3+
align-items: center;
4+
gap: 0.6rem;
5+
padding: 0.7rem 1.5rem;
6+
border-radius: 999px;
7+
border: 1px solid var(--swm-purple-light-100);
8+
background: color-mix(in srgb, var(--swm-purple-light-100) 15%, transparent);
9+
text-decoration: none;
10+
transition:
11+
background-color 0.2s ease,
12+
transform 0.2s ease;
13+
}
14+
15+
.chip:hover {
16+
text-decoration: none;
17+
background: color-mix(in srgb, var(--swm-purple-light-100) 28%, transparent);
18+
transform: scale(1.02);
19+
}
20+
21+
.label {
22+
font-size: 15px;
23+
font-weight: 500;
24+
color: var(--swm-landing-heading);
25+
white-space: nowrap;
26+
}
27+
28+
.link {
29+
font-size: 15px;
30+
font-weight: 600;
31+
color: var(--swm-purple-light-100);
32+
text-decoration: underline;
33+
text-underline-offset: 3px;
34+
white-space: nowrap;
35+
}
36+
37+
@media (max-width: 420px) {
38+
.chip {
39+
padding: 0.6rem 1rem;
40+
gap: 0.4rem;
41+
}
42+
43+
.label,
44+
.link {
45+
font-size: 13px;
46+
}
47+
}

packages/docs-gesture-handler/src/components/Hero/StartScreen/index.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import AnnouncementChip from '@site/src/components/Hero/AnnouncementChip';
12
import HomepageButton from '@site/src/components/HomepageButton';
23
import React from 'react';
34

@@ -8,6 +9,11 @@ const StartScreen = () => {
89
<section className={styles.hero}>
910
<div className={styles.heading}>
1011
<div>
12+
<AnnouncementChip
13+
label="Gesture Handler v3 is out"
14+
linkLabel="What's new"
15+
href="https://swmansion.com/blog/introducing-gesture-handler-3-0-hook-based-api-deeper-reanimated-integration-more-9185b0c8e305/"
16+
/>
1117
<h1 className={styles.headingLabel}>
1218
<span>React Native</span>
1319
<span>Gesture Handler</span>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
font-size: 64px;
1616
font-weight: 700;
1717

18+
margin-top: 2rem;
1819
line-height: 1.1;
1920
letter-spacing: 0;
2021
color: var(--swm-landing-heading);

0 commit comments

Comments
 (0)