Skip to content

Commit 85722e9

Browse files
committed
fixup! front: redesign top left of the scenario page
1 parent 37375b0 commit 85722e9

File tree

4 files changed

+32
-12
lines changed

4 files changed

+32
-12
lines changed

front/src/applications/operationalStudies/components/Scenario/ScenarioDescription.tsx

+15-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ChevronLeft, Pencil } from '@osrd-project/ui-icons';
1+
import { Blocked, ChevronLeft, Pencil } from '@osrd-project/ui-icons';
22
import { useTranslation } from 'react-i18next';
33

44
import InfraLoadingState from 'applications/operationalStudies/components/Scenario/InfraLoadingState';
@@ -68,23 +68,30 @@ const ScenarioDescription = ({
6868
</div>
6969

7070
<div className="scenario-details-infra-name">
71-
{t('infrastructure')} :&nbsp;{infra && <InfraLoadingState infra={infra} />}
72-
<span className="scenario-infra-name">{scenario.infra_name}</span>&nbsp;| ID{' '}
71+
{t('infrastructure')} :&nbsp;{infra && <InfraLoadingState infra={infra} />}&nbsp;
72+
<span className="scenario-infra-name">{scenario.infra_name}</span>&nbsp;| ID
7373
{scenario.infra_id}
7474
</div>
7575
{infra &&
7676
infra.state === 'TRANSIENT_ERROR' &&
7777
(infraReloadCount <= 5 ? (
78-
<div className="scenario-details-infra-error mt-1">
79-
{t('errorMessages.unableToLoadInfra', { infraReloadCount })}
78+
<div className="scenario-details-infra-error">
79+
<Blocked variant="fill" />
80+
<span className="error-description">
81+
{t('errorMessages.unableToLoadInfra', { infraReloadCount })}
82+
</span>
8083
</div>
8184
) : (
82-
<div className="scenario-details-infra-error mt-1">
83-
{t('errorMessages.softErrorInfra')}
85+
<div className="scenario-details-infra-error">
86+
<Blocked variant="fill" />
87+
<span className="error-description">{t('errorMessages.softErrorInfra')}</span>
8488
</div>
8589
))}
8690
{infra && infra.state === 'ERROR' && (
87-
<div className="scenario-details-infra-error mt-1">{t('errorMessages.hardErrorInfra')}</div>
91+
<div className="scenario-details-infra-error">
92+
<Blocked variant="fill" />
93+
<span className="error-description">{t('errorMessages.hardErrorInfra')}</span>
94+
</div>
8895
)}
8996
</div>
9097
);

front/src/styles/scss/_variables.scss

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ $colors: (
5454
'primary60': #1844ef,
5555
'primary80': #1f0f96,
5656
'selection20': #fff2b3,
57+
'success30': #3cca80,
5758
'warning30': #eaa72b,
5859
'warning60': #7d521e,
5960
'white100': #ffffff,

front/src/styles/scss/applications/operationalStudies/_scenario.scss

+15-3
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,23 @@
205205
img {
206206
height: 1rem;
207207
}
208+
.infra-loading-state {
209+
margin: 0;
210+
font-size: 1.6rem;
211+
}
208212
}
209213
.scenario-details-infra-error {
210-
color: var(--red);
211-
font-weight: 500;
212-
font-size: 0.9rem;
214+
color: var(--error60);
215+
background-color: var(--error5);
216+
margin: 1.3125rem -1.5rem 0 -1.5rem;
217+
padding: 0.5625rem 3.5rem 0.6875rem 1.5rem;
218+
display: flex;
219+
.error-description {
220+
margin-left: 1rem;
221+
font-size: 0.875rem;
222+
font-weight: 400;
223+
line-height: 20px;
224+
}
213225
}
214226

215227
.scenario-timetable {

front/src/styles/scss/common/components/_infraLoadingState.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
margin-right: 0.5rem;
66

77
&.cached {
8-
color: var(--green);
8+
color: var(--success30);
99
}
1010
&.loading {
1111
color: var(--orange);

0 commit comments

Comments
 (0)