Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display map #641

Merged
merged 23 commits into from
May 23, 2024
Merged

Display map #641

merged 23 commits into from
May 23, 2024

Conversation

evulins
Copy link
Collaborator

@evulins evulins commented May 19, 2024

In this PR:

  • displayed map
  • added control panel for choosing map view
  • fixed header
  • mocked data for clusters
    Trello card

Copy link
Collaborator

@jankrzempek jankrzempek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done by Monika and Janek. Congrats on delivering it so fast and so well 🥳🚀
One question: why are you building everything on your own? Ex. switch, checkbox, etc.

app/javascript/react/assets/styles/global-styles.ts Outdated Show resolved Hide resolved
import { media } from "../../utils/media";

interface SuggestionProps {
$isHighlighted?: boolean;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please tell us why there is$ at the beginning?

Copy link
Collaborator Author

@evulins evulins May 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://styled-components.com/docs/api#primary

"Transient props
If you want to prevent props meant to be consumed by styled components from being passed to the underlying React node or rendered to the DOM element, you can prefix the prop name with a dollar sign ($), turning it into a transient prop."

});

useEffect(() => {
status === "OK" && data.length && setItems(data);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use some constant when it comes to status possible states and then use here ex. Status.OK?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wip - I will not dig into this code right now. This LocationSearch is from Kasia POC and it will done in different task.

</S.LocationSearchButton>
)}
</S.SearchContainer>
{/* <S.SuggestionsList {...getMenuProps()}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be left in here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same answer as the previous one

display: flex;
align-items: center;
justify-content: space-between;
box-shadow: 2px 2px 4px 0px rgba(76, 86, 96, 0.1);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

color for shadow from colors struct please, please skip if not possible to change

app/javascript/react/components/Navbar/Navbar.style.tsx Outdated Show resolved Hide resolved
setLocation={setLocation}
mapRef={mapRef as React.RefObject<Map>}
setNavMenuVisible={setNavMenuVisible}
t={t}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this magic t 🧞‍♂️

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I am just passing translation as a props 😄

Copy link
Collaborator

@JoannaThelema JoannaThelema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! I really like that you extracted Navbar parts into separate components 🙌 This approach is definitely the right direction to take 😎

Just a general remark about CSS - I'm not an expert. If it works, it's good enough for me 🙃

lng: number;
};

const trees: RawTree[] = [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand this is only for the development.
Let's add a TODO in the code and a cleanup ticket. WDYT?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add TODO and add comment in existing ticket which is connected to Markers and Clusters

return (
<APIProvider
apiKey={googleMapsApiKey}
onLoad={() => console.log("Maps API has loaded.")}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this console.log on prod or is it only for development purposes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is only for development purposes

import { MarkerClusterer } from "@googlemaps/markerclusterer";
import type { Marker } from "@googlemaps/markerclusterer";

type Point = google.maps.LatLngLiteral & { key: string };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT about reusing LatLngLiteral type from app/javascript/react/types/googleMaps.ts?


type AutocompletePrediction = google.maps.places.AutocompletePrediction;

const LocationSearch = ({ setLocation, isMapPage }: LocationSearchProps) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that we're passing isMapPage depending on the context Mobile/Desktop header. Is it connected with the map page or rather a mobile view? 🤔

const { t } = useTranslation();

const isMapPage = window.location.pathname === "/";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This approach carries a risk since any URL change can disrupt this functionality. It might be worth reconsidering the design of the navbar. Instead of trying to adapt a single navbar for various views (mobile, desktop, map, non-map), we could explore the possibility of having separate navbars for each page. This isn't necessarily something to address in this PR, but rather a point to consider for future improvements.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would love to use different approach but at this point it was the easiest solution i could think of. We can discuss it about but I would not change in this PR. For now i can just put this url to const

Comment on lines +19 to +22
background-color: transparent;
z-index: 2;
flex-wrap: wrap;
position: absolute;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we confident that this change won't impact the current AirCasting page? I'm just double-checking since I'm not fully familiar with the feature flag setup. Is the current page built entirely in Elm, meaning there are no concerns to worry about?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is ok. React App is not connected yet with the production version

@evulins
Copy link
Collaborator Author

evulins commented May 22, 2024

Done by Monika and Janek. Congrats on delivering it so fast and so well 🥳🚀 One question: why are you building everything on your own? Ex. switch, checkbox, etc.

Thank you. When a switch or checkbox is not complicated, I prefer to build it on my own instead of using a library. In this case, I can style it and rebuild it however I want.

@evulins evulins merged commit 7a5c06b into master May 23, 2024
@evulins evulins deleted the display-map branch May 23, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants