Skip to content

Commit 7de1e74

Browse files
committed
fix(my-space): step line color, step 1/2 closed modifiable, check alignment (#3207)
Second round of review fixes on #3280: - Vertical line between step circles now takes the color of the previous (upper) step: green (`--background-flat-success`) below a complete step, blue (`--background-action-high-info`) below a current step, grey (default) below a pending step — via new `.stepRowComplete` / `.stepRowCurrent` modifier classes - Date rule alignment (green → "Modifiable", blue → "Échéance", grey → nothing): closed variant now shows the modifiable row for step 1 and falls through to the complete-step rendering for step 2 (matching the cse variant). Removed the redundant `variant !== "closed"` guard on step 1's TransmittedRow - Check icon in TransmittedRow: dropped `fr-mt-1v` so it sits flush with the "Votre déclaration a été transmise" baseline
1 parent 932d0ad commit 7de1e74

2 files changed

Lines changed: 26 additions & 17 deletions

File tree

packages/app/src/modules/my-space/DeclarationProcessPanel.module.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@
6464
background-color: var(--border-default-grey);
6565
}
6666

67+
.stepRowComplete:not(:last-child)::before {
68+
background-color: var(--background-flat-success);
69+
}
70+
71+
.stepRowCurrent:not(:last-child)::before {
72+
background-color: var(--background-action-high-info);
73+
}
74+
6775
.stepCircle {
6876
width: 28px;
6977
height: 28px;

packages/app/src/modules/my-space/VerticalStepper.tsx

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export function VerticalStepper({
4747
}) {
4848
return (
4949
<div className={`${styles.stepper} fr-mb-4w`}>
50-
<div className={styles.stepRow}>
50+
<div className={`${styles.stepRow} ${stepRowClass(step1)}`}>
5151
<StepCircle number={1} status={step1} />
5252
<Step1Content
5353
campaignDeadlines={campaignDeadlines}
@@ -57,7 +57,7 @@ export function VerticalStepper({
5757
year={year}
5858
/>
5959
</div>
60-
<div className={styles.stepRow}>
60+
<div className={`${styles.stepRow} ${stepRowClass(step2)}`}>
6161
<StepCircle number={2} status={step2} />
6262
<Step2Content
6363
campaignDeadlines={campaignDeadlines}
@@ -68,7 +68,7 @@ export function VerticalStepper({
6868
variant={variant}
6969
/>
7070
</div>
71-
<div className={styles.stepRow}>
71+
<div className={`${styles.stepRow} ${stepRowClass(step3)}`}>
7272
<StepCircle number={3} status={step3} />
7373
<Step3Content
7474
campaignDeadlines={campaignDeadlines}
@@ -81,6 +81,12 @@ export function VerticalStepper({
8181
);
8282
}
8383

84+
function stepRowClass(status: StepStatus): string {
85+
if (status === "complete") return styles.stepRowComplete ?? "";
86+
if (status === "current") return styles.stepRowCurrent ?? "";
87+
return "";
88+
}
89+
8490
function StepTitle({
8591
children,
8692
status,
@@ -181,14 +187,12 @@ function Step1Content({
181187
return (
182188
<div className={styles.stepContent}>
183189
{title}
184-
{variant !== "closed" && (
185-
<TransmittedRow
186-
downloadHref="/api/declaration-pdf"
187-
label="Votre déclaration a été transmise"
188-
modifiableUntil={campaignDeadlines.decl1ModificationDeadline}
189-
modifyHref={`/declaration-remuneration/etape/1?siren=${siren}`}
190-
/>
191-
)}
190+
<TransmittedRow
191+
downloadHref="/api/declaration-pdf"
192+
label="Votre déclaration a été transmise"
193+
modifiableUntil={campaignDeadlines.decl1ModificationDeadline}
194+
modifyHref={`/declaration-remuneration/etape/1?siren=${siren}`}
195+
/>
192196
</div>
193197
);
194198
}
@@ -218,7 +222,7 @@ function Step2Content({
218222
</StepTitle>
219223
);
220224

221-
if (variant === "closed" || variant === "start") {
225+
if (variant === "start") {
222226
return title;
223227
}
224228

@@ -280,7 +284,7 @@ function Step2Content({
280284
);
281285
}
282286

283-
// cse variant: step 2 is complete — show what was actually done
287+
// cse / closed variants: step 2 is complete — show what was actually done
284288
return (
285289
<div className={styles.stepContent}>
286290
{title}
@@ -370,10 +374,7 @@ function TransmittedRow({
370374

371375
return (
372376
<div className={styles.transmittedRow}>
373-
<span
374-
aria-hidden="true"
375-
className="fr-icon-check-line fr-icon--sm fr-mt-1v"
376-
/>
377+
<span aria-hidden="true" className="fr-icon-check-line fr-icon--sm" />
377378
<div className={styles.transmittedInfo}>
378379
<p className="fr-mb-0">{label}</p>
379380
<p className="fr-text-mention--grey fr-mb-0">

0 commit comments

Comments
 (0)