fix(classiques): pixel-perfect clock box from img 2, yellow bullet stops styling from img 1, and 1 train = 1 color stripe alternation
This commit is contained in:
1 parent
5e9d770449
commit
4adbe41970
4 files changed
+194
-92
No files matched your search
@@ -72,11 +72,11 @@ const formatPlatform = (p) => {
|
||||
return String(p).toUpperCase().replace(/VOIE|QUAI|\s+/gi, '').trim();
|
||||
};
|
||||
|
||||
const formatStopsForDeparts = (horaire, currentStationName, normalizeFn) => {
|
||||
const getStopsListForDeparts = (horaire, currentStationName, normalizeFn) => {
|
||||
const stops = (horaire && (horaire.stops || horaire.gares_desservies)) || [];
|
||||
if (!Array.isArray(stops) || stops.length === 0) {
|
||||
const dest = formatStationName((horaire && (horaire.gare_arrivee_nom || horaire.gare_arrivee || horaire.destination)) || '');
|
||||
return dest ? `• ${dest}` : '';
|
||||
return dest ? [dest] : [];
|
||||
}
|
||||
|
||||
const curNorm = normalizeFn ? normalizeFn(currentStationName || '') : String(currentStationName || '').toLowerCase().trim();
|
||||
@@ -95,11 +95,10 @@ const formatStopsForDeparts = (horaire, currentStationName, normalizeFn) => {
|
||||
const remainingStops = stops.slice(startIdx);
|
||||
if (remainingStops.length === 0) {
|
||||
const dest = formatStationName((horaire && (horaire.gare_arrivee_nom || horaire.gare_arrivee || horaire.destination)) || '');
|
||||
return dest ? `• ${dest}` : '';
|
||||
return dest ? [dest] : [];
|
||||
}
|
||||
|
||||
const stopNames = remainingStops.map(s => formatStationName(s.nom || s.gare_nom || s.name || s.stop_name || '')).filter(Boolean);
|
||||
return stopNames.map(n => `• ${n}`).join(' ');
|
||||
return remainingStops.map(s => formatStationName(s.nom || s.gare_nom || s.name || s.stop_name || '')).filter(Boolean);
|
||||
};
|
||||
|
||||
function BottomClock() {
|
||||
@@ -115,9 +114,9 @@ function BottomClock() {
|
||||
|
||||
return (
|
||||
<div className="aff-classiques-departs__bottom-clock" aria-hidden>
|
||||
<span>{hh}</span>
|
||||
<span>{mm}</span>
|
||||
<span>{ss}</span>
|
||||
<span className="aff-classiques-departs__bottom-clock-hm">{hh}</span>
|
||||
<span className="aff-classiques-departs__bottom-clock-hm">{mm}</span>
|
||||
<span className="aff-classiques-departs__bottom-clock-s">{ss}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1216,7 +1215,8 @@ export default function ClassiquesDeparts(){
|
||||
|
||||
const renderRow = (h, idx) => {
|
||||
const isExtended = Boolean(h && h._isExtended);
|
||||
const isOdd = ((h && typeof h._slotIndex === 'number' ? h._slotIndex : idx) % 2 === 0);
|
||||
const trainIndex = (h && typeof h._trainIndex === 'number') ? h._trainIndex : idx;
|
||||
const isOdd = (trainIndex % 2 === 0);
|
||||
|
||||
if (h && h._isEmpty) {
|
||||
if (isExtended) {
|
||||
@@ -1258,7 +1258,7 @@ export default function ClassiquesDeparts(){
|
||||
const isDelayed = status && status.label && String(status.label).startsWith('retardé');
|
||||
const showPlatform = !isSuppressed && Boolean(cleanPlatform);
|
||||
|
||||
const stopsText = isExtended ? formatStopsForDeparts(horaire, gareDisplay || gareParam, normalizeName) : '';
|
||||
const stopsList = isExtended ? getStopsListForDeparts(horaire, gareDisplay || gareParam, normalizeName) : [];
|
||||
|
||||
if (isExtended) {
|
||||
return (
|
||||
@@ -1306,10 +1306,22 @@ export default function ClassiquesDeparts(){
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Ligne basse (108px) : gares desservies défilantes */}
|
||||
{/* Ligne basse (108px) : gares desservies défilantes avec puces jaunes */}
|
||||
<div className="aff-classiques-departs__extended-bottom">
|
||||
<div className="aff-classiques-departs__sub-stops">
|
||||
<MarqueeText text={stopsText} className="aff-classiques-departs__sub-stops-text" />
|
||||
<MarqueeText
|
||||
className="aff-classiques-departs__sub-stops-marquee"
|
||||
text={
|
||||
<span className="aff-classiques-departs__stops-chain">
|
||||
{stopsList.map((stopName, sIdx) => (
|
||||
<span key={sIdx} className="aff-classiques-departs__stop-item">
|
||||
<span className="aff-classiques-departs__stop-bullet">•</span>
|
||||
<span className="aff-classiques-departs__stop-name">{stopName}</span>
|
||||
</span>
|
||||
))}
|
||||
</span>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
@@ -1382,7 +1394,7 @@ export default function ClassiquesDeparts(){
|
||||
displayRows.push({
|
||||
...train,
|
||||
_isExtended: true,
|
||||
_slotIndex: usedSlots
|
||||
_trainIndex: trainIdx
|
||||
});
|
||||
usedSlots += 2;
|
||||
trainIdx++;
|
||||
@@ -1393,7 +1405,7 @@ export default function ClassiquesDeparts(){
|
||||
displayRows.push({
|
||||
...train,
|
||||
_isExtended: false,
|
||||
_slotIndex: usedSlots
|
||||
_trainIndex: trainIdx
|
||||
});
|
||||
usedSlots += 1;
|
||||
trainIdx++;
|
||||
|
||||
Reference in new issue
Block a user