Skip to content

Commit ecaae02

Browse files
authored
docs: Homepage promotion on one line (#2137)
<img width="998" height="365" alt="Screenshot 2025-12-09 at 11 37 00" src="https://github.com/user-attachments/assets/d72406a2-1794-4702-a457-6bd46f99d7d0" /> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Simplifies the hero promotion to a single-line layout with truncation and updates the homepage promotion text. > > - **UI** > - **Hero** (`src/components/Hero/Hero.tsx`): Remove `labelMobile` prop and mobile/desktop split; render a single `label` with arrow. > - **Styles** (`src/components/Hero/styles.module.css`): Adjust promotion layout for one-line display (`max-width`, reduced `gap`, badge right margin, arrow non-shrinking) and add ellipsis overflow handling. > - **Homepage** (`src/pages/index.tsx`): Update promotion content to `badge: "Build"`, `label: "Win big in $1M Challenge"`; drop `labelMobile`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 5878bc1. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 1677d03 commit ecaae02

File tree

3 files changed

+17
-48
lines changed

3 files changed

+17
-48
lines changed

src/components/Hero/Hero.tsx

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,22 @@ import styles from './styles.module.css';
1010
interface HeroPromotionProps {
1111
badge: string;
1212
label: string;
13-
labelMobile?: string;
1413
href: string;
1514
}
1615

17-
function HeroPromotion({ badge, label, labelMobile, href }: HeroPromotionProps) {
16+
function HeroPromotion({ badge, label, href }: HeroPromotionProps) {
1817
return (
1918
<a href={href} className={styles.heroPromotionLink}>
2019
<Text className={styles.heroPromotionBadge} as="span">
2120
{badge}
2221
</Text>
23-
<div className={styles.heroPromotionContent}>
24-
<Text className={styles.heroPromotionLabel} weight="medium">
25-
<span className={styles.heroPromotionLabelDesktop}>
26-
{label}
27-
</span>
28-
<span className={styles.heroPromotionLabelMobile}>
29-
{labelMobile || label}
30-
</span>
31-
</Text>
32-
<ArrowRightIcon
33-
className={styles.heroPromotionArrow}
34-
size="16"
35-
/>
36-
</div>
22+
<Text className={styles.heroPromotionLabel} weight="medium">
23+
{label}
24+
</Text>
25+
<ArrowRightIcon
26+
className={styles.heroPromotionArrow}
27+
size="16"
28+
/>
3729
</a>
3830
);
3931
}

src/components/Hero/styles.module.css

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,16 @@ html[data-theme='dark'] .heroBanner p {
100100
}
101101

102102
.heroBanner .heroPromotionLink {
103+
max-width: calc(100% - 3.2rem);
103104
border-radius: 1000px;
104105
border: 1px solid var(--color-Neutral_SeparatorSubtle);
105106
background: var(--color-Neutral_Background);
106107
display: flex;
107108
padding: 0.8rem 1.2rem;
108109
align-items: center;
109-
gap: 0.8rem;
110+
gap: 0.6rem;
110111
margin-bottom: 0.8rem;
111112

112-
@media (max-width: 767px) {
113-
padding: 0.8rem 1.6rem;
114-
flex-direction: column;
115-
}
116-
117113
&:hover {
118114
background: var(--color-Neutral_Hover);
119115

@@ -123,12 +119,6 @@ html[data-theme='dark'] .heroBanner p {
123119
}
124120
}
125121

126-
.heroBanner .heroPromotionContent {
127-
display: flex;
128-
align-items: center;
129-
gap: 0.6rem;
130-
}
131-
132122
.heroBanner .heroPromotionBadge {
133123
border-radius: 1.2rem;
134124
background: var(--color-primary-chip-background);
@@ -138,30 +128,18 @@ html[data-theme='dark'] .heroBanner p {
138128
justify-content: center;
139129
align-items: center;
140130
gap: 1rem;
131+
margin-right: 0.2rem;
141132
}
142133

143134
.heroBanner .heroPromotionLabel {
144135
color: var(--color-neutral-text);
145-
}
146-
147-
.heroBanner .heroPromotionLabelDesktop {
148-
display: inline;
149-
}
150-
151-
.heroBanner .heroPromotionLabelMobile {
152-
display: none;
153-
}
154-
155-
@media (max-width: 767px) {
156-
.heroBanner .heroPromotionLabelDesktop {
157-
display: none;
158-
}
159-
.heroBanner .heroPromotionLabelMobile {
160-
display: inline;
161-
}
136+
overflow: hidden;
137+
text-overflow: ellipsis;
138+
white-space: nowrap;
162139
}
163140

164141
.heroBanner .heroPromotionArrow {
142+
flex-shrink: 0;
165143
color: var(--color-neutral-icon);
166144
transition: transform 0.2s;
167145
}

src/pages/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,8 @@ export default function Home() {
6565
heading="Apify Documentation"
6666
align="center"
6767
promotion={{
68-
badge: 'New',
69-
label: 'Join the Apify $1M Challenge. Build to win!',
70-
labelMobile: 'Join the Apify $1M Challenge!',
68+
badge: 'Build',
69+
label: 'Win big in $1M Challenge',
7170
href: 'https://apify.com/challenge',
7271
}}
7372
description={

0 commit comments

Comments
 (0)