Skip to content

Commit

Permalink
front: rename variable from French to English
Browse files Browse the repository at this point in the history
  • Loading branch information
turnerian2004 authored and emersion committed Jul 2, 2024
1 parent 0dc83c3 commit af83be8
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,
searchRollingStock,
toggleFilter,
searchIsLoading,
resetFilters,
Expand Down Expand Up @@ -173,7 +173,7 @@ const RollingStockEditor = () => {
<SearchRollingStock
filteredRollingStockList={filteredRollingStockList}
filters={filters}
searchMateriel={searchMateriel}
searchRollingStock={searchRollingStock}
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, searchRollingStock, 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);
searchRollingStock(e.target.value);
};

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

useEffect(() => {
if (rollingStock) {
searchMateriel(getLabel(rollingStock));
searchRollingStock(getLabel(rollingStock));
} else {
searchMateriel('');
searchRollingStock('');
}
}, [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, searchRollingStock, toggleFilter, searchIsLoading } =
useFilterRollingStock();

useEffect(() => {
Expand Down Expand Up @@ -64,7 +64,7 @@ function RollingStockModal({ ref2scroll }: RollingStockModal) {
<SearchRollingStock
filteredRollingStockList={filteredRollingStockList}
filters={filters}
searchMateriel={searchMateriel}
searchRollingStock={searchRollingStock}
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;
searchRollingStock: (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,
searchRollingStock,
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) => searchRollingStock(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 searchRollingStock = (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,
searchRollingStock,
toggleFilter,
};
}

0 comments on commit af83be8

Please sign in to comment.