From 2db92844849bf2a7ef4ea8b80f640572258b3208 Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Tue, 1 Oct 2024 18:59:47 -0400 Subject: [PATCH] refactor: Remove unused code and tweak comments --- lib/components/app/print-layout.tsx | 7 ------- lib/components/map/simple-map.tsx | 1 + 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/components/app/print-layout.tsx b/lib/components/app/print-layout.tsx index 2610eac90..7d8b2fd4e 100644 --- a/lib/components/app/print-layout.tsx +++ b/lib/components/app/print-layout.tsx @@ -16,7 +16,6 @@ import TripPreviewLayoutBase from './trip-preview-layout-base' type Props = { // TODO: Typescript activeSearch type activeSearch: any - currentQuery: any intl: IntlShape itinerary: Itinerary location?: { search?: string } @@ -32,14 +31,10 @@ class PrintLayout extends Component { componentDidMount() { const { itinerary, location, parseUrlQueryString } = this.props - console.log(itinerary, location) - // Parse the URL query parameters, if present if (!itinerary && location && location.search) { parseUrlQueryString() } - - // TODO: use currentQuery to pan/zoom to the correct part of the map } render() { @@ -69,14 +64,12 @@ class PrintLayout extends Component { // connect to the redux store -// TODO: Typescript state const mapStateToProps = (state: AppReduxState) => { const activeSearch = getActiveSearch(state) const { localUser, loggedInUser } = state.user const user = loggedInUser || localUser return { activeSearch, - currentQuery: state.otp.currentQuery, itinerary: getActiveItinerary(state) as Itinerary, user } diff --git a/lib/components/map/simple-map.tsx b/lib/components/map/simple-map.tsx index c0eebb708..446a11fbb 100644 --- a/lib/components/map/simple-map.tsx +++ b/lib/components/map/simple-map.tsx @@ -22,6 +22,7 @@ function noop() { return null } +/** Renders an optional itinerary with a given config. */ const SimpleMap = ({ config, itinerary }: Props): JSX.Element => { const intl = useIntl() // @ts-expect-error ComponentContext not typed yet.