-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
front: add stop type selector in stdcm
- Loading branch information
Showing
6 changed files
with
85 additions
and
7 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
33 changes: 33 additions & 0 deletions
33
front/src/applications/stdcmV2/components/StdcmStopType.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,33 @@ | ||
import { Select } from '@osrd-project/ui-core'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import type { StdcmStopTypes } from '../types'; | ||
|
||
type StdcmStopTypeProps = { | ||
stopTypes: StdcmStopTypes; | ||
onStdcmStopTypesChange: (arrivalType: StdcmStopTypes) => void; | ||
}; | ||
|
||
const StdcmStopType = ({ stopTypes, onStdcmStopTypesChange }: StdcmStopTypeProps) => { | ||
const { t } = useTranslation('stdcm'); | ||
|
||
return ( | ||
<div className="stdcm-v2-via-stop-for pl-2"> | ||
<Select | ||
label={t('trainPath.type')} | ||
id="type" | ||
value={stopTypes} | ||
options={['passageTime', 'driverSwitch', 'serviceStop']} | ||
onChange={(e) => { | ||
if (e) { | ||
onStdcmStopTypesChange(e as StdcmStopTypes); | ||
} | ||
}} | ||
getOptionLabel={(option) => t(`trainPath.stopType.${option}`)} | ||
getOptionValue={(option) => option} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default StdcmStopType; |
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