-
Notifications
You must be signed in to change notification settings - Fork 26
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
fix(feed): boundaries and zoom for map feed #1399
Conversation
✅ Deploy Preview for teritori-dapp ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for testitori ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
surely there must be a way to compute a zoom level that always fit the width of the map no?
it should probably be used in #1398 also
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested and reviewed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you take a look at my comments pls :) thanks.
const lat = 45; | ||
const lng = 90; | ||
|
||
const adjustedWorldMapBounds: LatLngBoundsLiteral = [ | ||
[-lat, -lng], | ||
[lat, lng], | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part is independent of the Component so we should put it outside of the component and we can use UPPER_CASE to define the constants
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't follow this convention, please use normal variable naming as in js, there is no real constants
we can put it outside of the func though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed here: b42b56d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't follow this convention, please use normal variable naming as in js, there is no real constants
we can put it outside of the func though
IMHO, if it's a constant and declared outside of function scope, it should be a UPPER_CASE.
if it's just a keyword const and declared in function scope, it's ok to define it with normal case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this makes refacto harder if the variable stops being a constant according to your definition
also we don't have a way to enforce this rule so this means more review work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the rust language it make more sense because constant are real constant and thus when you see UPPER_CASE, you have some guarantees. Even then it doesn't have much value IMO but at least it can be verified by tooling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can vote on this
[lat, lng], | ||
]; | ||
|
||
const updateMinZoom = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not defined the function inside of useEffect which makes the code less readable.
I suggest sth like
useEffect(() => {
!!map && updateMinZoom(map);
.......
}, [[map, setMinZoom])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree, we followed this in berty and it made the code very hard to maintain IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can extract a hook though if you really want
const useUpdateMinZoom = (map) => {
useEffect(...)
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed here: 066f8cc
I read comments from both PR's (#1398 #1399) and it refers to each other, can we just have one PR with split and specific commits for more clarity ? For the code it's seems okay for me, i understand norman who said that it should be better to have a calcul that fit with any screen size, and it's not really what it's implemented here, can you explain @sujal-into where But i tested the behavior and i tried to resize in big and small screens and it works well 👍 |
This PR will receive some changes from this PR #1398 |
Signed-off-by: clegirar <[email protected]>
We are obligate to pass zoom initial value to One thing about the ternary condition in Found it little bit confusing to have one value minZoom that is shared for zoom and minZoom value in |
✅ Deploy Preview for gno-dapp ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
aussi, en vertu de l'article 49 alinéa 3 de la constitution, j'engage la responsabilité de mon organisation décentralisée sur l'application de la requête de fusionnement numéro 1399 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would prefer that it's fully responsive but it's already pretty good
Like even set the boundaries dynamically ? |
I mean add back the resize event handler, but it's okay to do it later |
qu'ils viennent me chercher |
fix: #1371
Description:
Set the zoom level to 3, so the map gets fit into the container, however, it doesn't show the whole map