Skip to content

Commit f72b7de

Browse files
authored
Merge pull request #940 from hirosystems/develop
fix mobile banner text
2 parents 6303f74 + baf0ad2 commit f72b7de

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

app/layout.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ export default function RootLayout({
4141
<Provider>
4242
<Banner
4343
id="hiro-hacks"
44-
cta="Learn more here"
44+
cta="Learn more"
4545
url="/stacks/hacks"
4646
startDate="2025-01-19T17:00:00.000Z"
4747
endDate="2025-06-24T23:59:59.999Z"
48+
mobileText="Hiro Hacks is live!"
4849
>
4950
Hiro Hacks is live! Get started with this months theme: AI x Stacks
5051
</Banner>

components/ui/banner.tsx

+13-1
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,15 @@ export function Banner({
3232
url = "/",
3333
startDate,
3434
endDate,
35+
children,
36+
mobileText,
3537
...props
3638
}: HTMLAttributes<HTMLDivElement> & {
3739
cta?: string;
3840
url?: string;
3941
startDate?: string;
4042
endDate?: string;
43+
mobileText?: string;
4144
}): React.ReactElement | null {
4245
const [open, setOpen] = useState(true);
4346
const [isWithinDateRange, setIsWithinDateRange] = useState(false);
@@ -88,7 +91,16 @@ export function Banner({
8891
/>
8992
) : null}
9093
<div className="flex items-center justify-center space-x-4">
91-
<div>{props.children}</div>
94+
<div>
95+
{mobileText ? (
96+
<>
97+
<span className="sm:hidden">{mobileText}</span>
98+
<span className="hidden sm:inline">{children}</span>
99+
</>
100+
) : (
101+
children
102+
)}
103+
</div>
92104
{cta && (
93105
<Button
94106
size="sm"

0 commit comments

Comments
 (0)