-
Notifications
You must be signed in to change notification settings - Fork 79
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
frontend - feat: add new list view of users on map #4848 #5294
Open
marco-digennaro
wants to merge
18
commits into
develop
Choose a base branch
from
add-new-list-view-of-users-on-map#4848
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 16 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
0b1bab0
frontend - feat: add new list view of users on map #4848
marco-digennaro 3a9bea6
Merge branch 'develop' into add-new-list-view-of-users-on-map#4848
marco-digennaro 87bfa29
fix: some ux issues, rework style with nmew styled from mui
marco-digennaro a92b4af
fix: fine tuning on open-close dawer button
marco-digennaro 89cea8c
fix: format and lint
marco-digennaro 4cff999
merge conflict
bakeiro 9361705
new update
bakeiro 8b39389
small fixes
bakeiro 9f1dfe9
Minor improvements
bakeiro ca7ee0c
minor changes
bakeiro d4003da
updated tests
bakeiro cc629e0
more bug fixed
bakeiro 98bba62
lint
bakeiro 75587b0
fix test
bakeiro 251db12
minor changes
bakeiro b9dc3d3
format
bakeiro aec81fc
minor CSS changes
bakeiro 8e1c488
Update SearchResultsMobileVerticalList.tsx
bakeiro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import { Collapse, useMediaQuery, useTheme } from "@mui/material"; | ||
import makeStyles from "@mui/styles/makeStyles"; | ||
import HtmlMeta from "components/HtmlMeta"; | ||
import { Coordinates } from "features/search/constants"; | ||
|
@@ -76,9 +75,8 @@ export default function SearchPage({ | |
const { t } = useTranslation([GLOBAL, SEARCH]); | ||
const queryClient = new QueryClient(); | ||
const classes = useStyles(); | ||
const theme = useTheme(); | ||
const map = useRef<MaplibreMap>(); | ||
const isMobile = useMediaQuery(theme.breakpoints.down("md")); | ||
const searchFromDashboard = locationName !== ""; | ||
|
||
// State | ||
const [wasSearchPerformed, setWasSearchPerformed] = useState(false); | ||
|
@@ -174,52 +172,35 @@ export default function SearchPage({ | |
locationResult.location.lat, | ||
]); | ||
|
||
/** | ||
* Every time a new result is set (new search) we unselect the selected result | ||
*/ | ||
useEffect(() => { | ||
setSelectedResult(undefined); | ||
}, [locationResult]); | ||
|
||
const errorMessage = error?.message; | ||
|
||
return ( | ||
<QueryClientProvider client={queryClient}> | ||
<HtmlMeta title={t("global:nav.map_search")} /> | ||
<div className={classes.container}> | ||
{/* Desktop */} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unnecesary code There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why was it unnecessary? Looks like a big chunk removed. |
||
{!isMobile && ( | ||
<SearchResultsList | ||
searchType={searchType} | ||
setSearchType={setSearchType} | ||
locationResult={locationResult} | ||
setLocationResult={setLocationResult} | ||
queryName={queryName} | ||
setQueryName={setQueryName} | ||
results={data} | ||
error={errorMessage} | ||
hasNext={hasNextPage} | ||
selectedResult={selectedResult} | ||
setSelectedResult={setSelectedResult} | ||
isLoading={isLoading || isFetching} | ||
/> | ||
)} | ||
{/* Mobile */} | ||
{isMobile && ( | ||
<Collapse | ||
in={wasSearchPerformed || !!selectedResult} | ||
timeout={theme.transitions.duration.standard} | ||
className={classes.mobileCollapse} | ||
> | ||
<SearchResultsList | ||
searchType={searchType} | ||
setSearchType={setSearchType} | ||
locationResult={locationResult} | ||
setLocationResult={setLocationResult} | ||
queryName={queryName} | ||
setQueryName={setQueryName} | ||
results={data} | ||
error={errorMessage} | ||
hasNext={hasNextPage} | ||
selectedResult={selectedResult} | ||
setSelectedResult={setSelectedResult} | ||
isLoading={isLoading || isFetching} | ||
/> | ||
</Collapse> | ||
)} | ||
<SearchResultsList | ||
searchType={searchType} | ||
setSearchType={setSearchType} | ||
locationResult={locationResult} | ||
setLocationResult={setLocationResult} | ||
queryName={queryName} | ||
setQueryName={setQueryName} | ||
results={data} | ||
error={errorMessage} | ||
hasNext={hasNextPage} | ||
selectedResult={selectedResult} | ||
setSelectedResult={setSelectedResult} | ||
wasSearchPerformed={wasSearchPerformed} | ||
isLoading={isLoading || isFetching} | ||
searchFromDashboard={searchFromDashboard} | ||
/> | ||
<FilterDialog | ||
isOpen={isFiltersOpen} | ||
queryName={queryName} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
fixes the bug when a selected result remains even after searching
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.
Sorry I just saw this. I think it makes more sense to set this in the same place the search happens rather than a separate useEffect? So where you set the new location, then set this there instead.