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

feat:types for map #1856

Merged
merged 28 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b814594
feat:types for map
sunilsabatp Aug 31, 2023
c6cce2b
type for register_tree_map
sunilsabatp Aug 31, 2023
889be14
fix: types for map
sunilsabatp Sep 4, 2023
209aef6
fix: type for singlecontribution
sunilsabatp Sep 5, 2023
22fdd54
fix: type feedback
sunilsabatp Sep 18, 2023
21a0f33
fix: type errors
sunilsabatp Sep 19, 2023
4d2a642
fix: add species of Import tree
sunilsabatp Sep 21, 2023
0dadc03
fix: Eslint error
sunilsabatp Sep 21, 2023
52a48a9
resolved merge conflict
sunilsabatp Sep 21, 2023
93b881a
Merge 'develop' to feature/type_for_map
mohitb35 Sep 27, 2023
b47be79
doc: adds comment reg DrawMap functionality
mohitb35 Sep 28, 2023
241e513
refactor: renames ContributionProps for clarity
mohitb35 Sep 28, 2023
24df054
fix: resolve TS warning for TreesIcon usage
mohitb35 Sep 29, 2023
01d3291
fix: TS errors
adityasabat34 Oct 9, 2023
4d6bbad
resolved merge conflict
adityasabat34 Oct 9, 2023
d64e30d
fix: Type issue for Map
adityasabat34 Oct 17, 2023
b14548d
type for Map(feedback)
sunilsabatp Nov 22, 2023
27440c1
resolve type errors for PlantLocationPage
sunilsabatp Nov 28, 2023
afba940
resolve the merge conflict
sunilsabatp Nov 28, 2023
674e19b
feedback(MapComponent)
sunilsabatp Nov 29, 2023
cfb95c8
fix type_issue for staticMap
sunilsabatp Dec 4, 2023
74f28b8
fix type issue for PlantLocation component
sunilsabatp Dec 5, 2023
79d114e
fix type issue for PlantLocationPage
sunilsabatp Dec 6, 2023
bb761fa
Don't show slider if image is missing
sunilsabatp Dec 8, 2023
493f31b
remove any from the Mytrees
sunilsabatp Dec 12, 2023
3d016a5
remove any from the PlantLocationPage
sunilsabatp Dec 12, 2023
39221be
fix application side error
sunilsabatp Jan 17, 2024
8281959
resolve merge conflict
sunilsabatp Jan 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/features/projects/components/maps/PlantLocations.tsx
mohitb35 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default function PlantLocations(): ReactElement {
const { i18n, t } = useTranslation(['maps', 'common']);

const openPl = (pl: PlantLocationSingle | SamplePlantLocation) => {
console.log(pl, '==');
Copy link
Contributor

Choose a reason for hiding this comment

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

Clean up needed

switch (pl.type) {
case 'sample':
setSamplePlantLocation(pl);
Expand Down Expand Up @@ -231,7 +232,10 @@ export default function PlantLocations(): ReactElement {
{viewport.zoom > 14 && (
<div
key={`${pl.id}-marker`}
onClick={() => openPl(pl)}
onClick={() => {
console.log('I ran');
Copy link
Contributor

Choose a reason for hiding this comment

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

Clean up needed

openPl(pl);
}}
onMouseEnter={() => onHover(pl)}
onMouseLeave={onHoverEnd}
className={`${styles.single} ${
Expand Down
25 changes: 14 additions & 11 deletions src/features/projects/components/projectDetails/ImageSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function ImageSlider({
imageSize,
type,
}: Props) {
const [slider, setSlider] = React.useState<ReactElement>();
const [slider, setSlider] = React.useState<ReactElement>(<div></div>);
const projectImages: { content: () => ReactElement }[] = [];

const loadImageSource = (imageName: string): string => {
Expand All @@ -33,7 +33,6 @@ export default function ImageSlider({
images.forEach((sliderImage) => {
if (sliderImage.image) {
const imageURL = loadImageSource(sliderImage.image);

projectImages.push({
content: () => (
<div
Expand All @@ -57,15 +56,19 @@ export default function ImageSlider({
}, [images]);

React.useEffect(() => {
setSlider(
<Stories
stories={projectImages}
defaultInterval={7000}
width="100%"
height={height}
loop={true}
/>
);
if (projectImages.length > 0) {
setSlider(
<Stories
stories={projectImages}
defaultInterval={7000}
width="100%"
height={height}
loop={true}
/>
);
} else {
setSlider(<div></div>);
}
}, [images]);

return <>{slider}</>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export default function SingleContribution({
contributionGUID,
token,
};
console.log(contribution, '==');
const { t, ready } = useTranslation(['me', 'common']);
return ready && contribution !== null ? (
<div className="inputContainer">
Expand Down
prachigarg19 marked this conversation as resolved.
Show resolved Hide resolved
prachigarg19 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css';
import WebMercatorViewport from '@math.gl/web-mercator';
import styles from '../RegisterModal.module.scss';
import getMapStyle from '../../../../utils/maps/getMapStyle';
import { Polygon, Point } from 'geojson';

const Map = ReactMapboxGl({
interactive: false,
Expand Down
9 changes: 4 additions & 5 deletions src/features/user/TreeMapper/components/Map.tsx
mohitb35 marked this conversation as resolved.
Show resolved Hide resolved
mohitb35 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ export default function MyTreesMap({
// };

const zoomToLocation = (geometry: turf.AllGeoJSON) => {
console.log(geometry, '==');
if (viewport.width && viewport.height && geometry) {
const bbox = turf.bbox(geometry);
const { longitude, latitude, zoom } = new WebMercatorViewport(
Expand Down Expand Up @@ -176,7 +175,6 @@ export default function MyTreesMap({
}, []);

React.useEffect(() => {
console.log(locations, '==');
if (locations) {
const features = [];
const ids = [];
Expand All @@ -201,7 +199,6 @@ export default function MyTreesMap({
features,
});
setPlIds(ids);
console.log(locations[0]?.geometry, '==1');
zoomToLocation(locations[0]?.geometry);
} else {
setPlIds(null);
Expand All @@ -211,7 +208,6 @@ export default function MyTreesMap({

React.useEffect(() => {
if (selectedLocation) {
console.log(selectedLocation.geometry, '==2');
zoomToLocation(selectedLocation.geometry);
}
}, [geoJson, selectedLocation]);
Expand Down Expand Up @@ -338,7 +334,10 @@ export default function MyTreesMap({
{viewport.zoom > 14 && (
<div
key={`${pl.id}-marker`}
onClick={() => setselectedLocation(pl)}
onClick={() => {
// console.log(pl, '==');
setselectedLocation(pl);
}}
// onMouseEnter={() => onHover(pl)}
// onMouseLeave={() => onHoverEnd(pl)}
className={`${styles.single} ${
Expand Down
1 change: 0 additions & 1 deletion src/features/user/TreeMapper/components/TreeMapperList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export default function TreeMapperList({
links,
}: Props): ReactElement {
const { t } = useTranslation('treemapper');
console.log(location, '==');
return (
<div
className={`${location ? styles.hideOnMobile : ''} ${
Expand Down