Skip to content

Commit a782ef0

Browse files
committed
Update AlertBanner component with translation support and responsive design
1 parent 137e9b4 commit a782ef0

File tree

3 files changed

+34
-27
lines changed

3 files changed

+34
-27
lines changed

@theme/components/Navbar/Navbar.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ import arrowUpRight from "../../../static/img/icons/arrow-up-right-custom.svg";
1111

1212
const alertBanner = {
1313
show: true,
14-
message: "XRP Ledger Apex 2025 | June 10-12",
14+
message: "XRP Ledger Apex 2025",
1515
button: "GET TICKETS",
1616
link: "https://www.xrpledgerapex.com/?utm_source=xrplwebsite&utm_medium=direct&utm_campaign=xrpl-event-ho-xrplapex-glb-2025-q1_xrplwebsite_ari_arp_bf_rsvp&utm_content=cta_btn_english_gettickets",
1717
date: "JUNE 10-12",
1818
};
19-
export function AlertBanner({ message, button, link, show }) {
19+
export function AlertBanner({ message, date, button, link, show }) {
2020
const { useTranslate } = useThemeHooks();
2121
const { translate } = useTranslate();
2222
const bannerRef = React.useRef(null);
@@ -46,11 +46,11 @@ export function AlertBanner({ message, button, link, show }) {
4646
aria-label="Get Tickets for XRP Ledger Apex 2025 Event"
4747
>
4848
<div className="banner-event-details">
49-
<div className="event-info">XRPL APEX 2025</div>
50-
<div className="event-date">JUNE 10-12</div>
49+
<div className="event-info">{translate(message)}</div>
50+
<div className="event-date">{translate(date)}</div>
5151
</div>
5252
<div className="banner-button">
53-
<div className="button-text">GET TICKETS</div>
53+
<div className="button-text">{translate(button)}</div>
5454
<img className="button-icon" src={arrowUpRight} alt="Get Tickets Icon" />
5555
</div>
5656
</a>

static/css/devportal2024-v1.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

styles/_top-banner.scss

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,42 @@
5050
position: relative;
5151
z-index: 1;
5252
}
53+
@media (max-width: 768px) {
54+
font-size: 18px;
55+
padding: 11px 35px;
5356

54-
@media (max-width: 991px) {
55-
padding: 0 20px;
57+
}
58+
@media (max-width: 564px) {
59+
font-size: 15px;
60+
padding: 5px 40px;
61+
.banner-event-details{
62+
gap: 0px !important;
63+
flex-direction: column;
64+
text-align: left;
65+
}
66+
.banner-button{
67+
align-self: baseline;
68+
gap: 8px !important;
69+
}
5670
}
5771
.banner-button{
5872
display: flex;
5973
align-items: center;
6074
gap: 14.5px;
75+
padding-top: 1px;
6176
img{
6277
width: 24.5px;
6378
height: 33.7px;
64-
}
65-
}
66-
.event-info {
67-
68-
@media (max-width: 524px) {
69-
font-size: 15px;
79+
@media (max-width: 768px) {
80+
width: 19.5px;
81+
height: 18.7px;
82+
padding-top: 0px;
83+
}
84+
@media (max-width: 564px) {
85+
width: 15.5px;
86+
height: 20.85px;
87+
padding-top: 0px;
88+
}
7089
}
7190
}
7291

@@ -94,7 +113,7 @@
94113
transform-origin: center;
95114
transition: background-color 0.3s ease, color 0.3s ease;
96115

97-
@media (max-width: 524px) {
116+
@media (max-width: 564px) {
98117
font: 600 9px/1 Work Sans ;
99118
width: 117px;
100119
height: 27px;
@@ -106,14 +125,9 @@
106125
transform-style: preserve-3d;
107126
aspect-ratio: 0.71;
108127
object-fit: contain;
109-
width: 12.5px; // Scaled down from 13.8px
110128
animation: none;
111129
transform: rotateZ(0deg);
112130
transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); // Adjust duration as needed
113-
@media (max-width: 524px) {
114-
width: 9px; // Scaled down from 10px
115-
}
116-
117131
align-self: stretch;
118132
margin: auto 0;
119133
transform-style: preserve-3d;
@@ -141,15 +155,8 @@
141155

142156
.web-banner a {
143157
text-decoration: none;
144-
// background-color: var(--XRPL-Secondary-Blue-Purple, #7919FF);
145158
}
146159

147-
// // to avoid a focus outline causing the background to turn white
148-
// .web-banner:focus,
149-
// .web-banner:active {
150-
// background-color: var(--XRPL-Secondary-Blue-Purple, #7919FF) !important;
151-
// }
152-
153160
.button-icon {
154161
animation: iconJitter 1s ease-in-out;
155162
animation-iteration-count: 1;

0 commit comments

Comments
 (0)