-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
front: add settings panel to space time chart
Signed-off-by: Simon Ser <[email protected]>
- Loading branch information
Showing
6 changed files
with
88 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
front/src/modules/simulationResult/components/ManchetteWithSpaceTimeChart/Settings.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { type ChangeEvent } from 'react'; | ||
|
||
import { Checkbox } from '@osrd-project/ui-core'; | ||
import { X } from '@osrd-project/ui-icons'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
type Settings = { | ||
showConflicts: boolean; | ||
}; | ||
|
||
type SettingsProps = { | ||
settings: Settings; | ||
onChange: (settings: Settings) => void; | ||
onClose: () => void; | ||
}; | ||
|
||
const Settings = ({ settings, onChange, onClose }: SettingsProps) => { | ||
const { t } = useTranslation('simulation'); | ||
|
||
const handleConflictsChange = (event: ChangeEvent<HTMLInputElement>) => { | ||
onChange({ ...settings, showConflicts: event.target.checked }); | ||
}; | ||
|
||
return ( | ||
<div id="settings-panel" className="flex justify-end absolute"> | ||
<div className="settings-panel-section"> | ||
<div className="settings-panel-section-title">{t('timeSpaceChartSettings.paths')}</div> | ||
<div className="selection"> | ||
<Checkbox | ||
label={t('timeSpaceChartSettings.conflicts')} | ||
checked={settings.showConflicts} | ||
onChange={handleConflictsChange} | ||
/> | ||
</div> | ||
</div> | ||
<button type="button" id="close-settings-panel" onClick={onClose}> | ||
<X /> | ||
</button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Settings; |
16 changes: 16 additions & 0 deletions
16
front/src/modules/simulationResult/styles/manchetteWithSpaceTimeChart.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.manchette-space-time-chart-wrapper { | ||
position: relative; | ||
overflow: hidden; | ||
|
||
#settings-panel { | ||
right: 0; | ||
margin-right: 0; | ||
width: 16.4375rem; | ||
height: 100%; | ||
} | ||
|
||
.settings-btn { | ||
margin-left: 1rem; | ||
vertical-align: middle; | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
front/src/modules/simulationResult/styles/simulationResult.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
@use './timeline'; | ||
@use './manchetteWithSpaceTimeChart'; | ||
|
||
.chart-container { | ||
display: block; | ||
|