Skip to content

Commit

Permalink
front: rename French variable name to English name
Browse files Browse the repository at this point in the history
  • Loading branch information
turnerian2004 committed Jun 30, 2024
1 parent ade99a6 commit 3837c7f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const RollingStockEditor = () => {
const {
filteredRollingStockList,
filters,
searchMateriel,
searchMaterial,
toggleFilter,
searchIsLoading,
resetFilters,
Expand Down Expand Up @@ -173,7 +173,7 @@ const RollingStockEditor = () => {
<SearchRollingStock
filteredRollingStockList={filteredRollingStockList}
filters={filters}
searchMateriel={searchMateriel}
searchMaterial={searchMaterial}
toggleFilter={toggleFilter}
hasWhiteBackground
/>
Expand Down
8 changes: 4 additions & 4 deletions front/src/applications/stdcmV2/components/StdcmConsist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const StdcmConsist = ({ disabled = false }: { disabled?: boolean }) => {

const { rollingStock } = useStoreDataForRollingStockSelector();

const { filters, searchMateriel, filteredRollingStockList } = useFilterRollingStock();
const { filters, searchMaterial, filteredRollingStockList } = useFilterRollingStock();

const getLabel = (rs: LightRollingStockWithLiveries) => {
let res = '';
Expand All @@ -67,7 +67,7 @@ const StdcmConsist = ({ disabled = false }: { disabled?: boolean }) => {
};

const onInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
searchMateriel(e.target.value);
searchMaterial(e.target.value);
};

const onInputOnBlur = () => {
Expand All @@ -84,9 +84,9 @@ const StdcmConsist = ({ disabled = false }: { disabled?: boolean }) => {

useEffect(() => {
if (rollingStock) {
searchMateriel(getLabel(rollingStock));
searchMaterial(getLabel(rollingStock));
} else {
searchMateriel('');
searchMaterial('');
}
}, [rollingStock]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function RollingStockModal({ ref2scroll }: RollingStockModal) {
const [openRollingStockCardId, setOpenRollingStockCardId] = useState(rollingStockID);
const { closeModal } = useContext(ModalContext);

const { filteredRollingStockList, filters, searchMateriel, toggleFilter, searchIsLoading } =
const { filteredRollingStockList, filters, searchMaterial, toggleFilter, searchIsLoading } =
useFilterRollingStock();

useEffect(() => {
Expand Down Expand Up @@ -64,7 +64,7 @@ function RollingStockModal({ ref2scroll }: RollingStockModal) {
<SearchRollingStock
filteredRollingStockList={filteredRollingStockList}
filters={filters}
searchMateriel={searchMateriel}
searchMaterial={searchMaterial}
toggleFilter={toggleFilter}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type { RollingStockFilters } from 'modules/rollingStock/hooks/useFilterRo

type SearchRollingStockProps = {
filteredRollingStockList: LightRollingStockWithLiveries[];
searchMateriel: (value: string) => void;
searchMaterial: (value: string) => void;
toggleFilter: (filter: 'elec' | 'thermal' | 'locked' | 'notLocked') => void;
filters: RollingStockFilters;
hasWhiteBackground?: boolean;
Expand All @@ -22,7 +22,7 @@ type SearchRollingStockProps = {
const SearchRollingStock = ({
filteredRollingStockList,
filters,
searchMateriel,
searchMaterial,
toggleFilter,
hasWhiteBackground,
}: SearchRollingStockProps) => {
Expand All @@ -35,7 +35,7 @@ const SearchRollingStock = ({
id="searchfilter"
type="text"
value={filters.text}
onChange={(e) => searchMateriel(e.target.value)}
onChange={(e) => searchMaterial(e.target.value)}
placeholder={t('translation:common.search')}
noMargin
unit={<Search />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export default function useFilterRollingStock() {
const [filteredRollingStockList, setFilteredRollingStockList] =
useState<LightRollingStockWithLiveries[]>(allRollingStocks);

const searchMateriel = (value: string) => {
const searchMaterial = (value: string) => {
setFilters({ ...filters, text: value.toLowerCase() });
setSearchIsLoading(true);
};
Expand Down Expand Up @@ -180,7 +180,7 @@ export default function useFilterRollingStock() {
filters,
searchIsLoading,
resetFilters,
searchMateriel,
searchMaterial,
toggleFilter,
};
}

0 comments on commit 3837c7f

Please sign in to comment.